using Swift.DAL.AccountReport; using Swift.web.Library; using System; using System.Data; using System.Text; namespace Swift.web.AccountReport.BalanceSheet { public partial class SubLedger : System.Web.UI.Page { private readonly SwiftLibrary _s1 = new SwiftLibrary(); private readonly AccountStatementDAO st = new AccountStatementDAO(); protected void Page_Load(object sender, EventArgs e) { _s1.CheckSession(); GenerateReport(); } protected string GetMapCode() { return GetStatic.ReadQueryString("mapcode", ""); } protected string GetHead() { return GetStatic.ReadQueryString("head", ""); } protected string GetTreeSape() { return GetStatic.ReadQueryString("treeSape", ""); } protected string GetDate() { return GetStatic.ReadQueryString("dt", ""); } protected string GetDate1() { return GetStatic.ReadQueryString("dt1", ""); } protected string GetSentFromFlag() { return GetStatic.ReadQueryString("sentfrom", ""); } private void GenerateReport() { string mapcode = GetMapCode(); string head = GetHead(); string treeSape = GetTreeSape(); string rdate = GetDate(); string date = (GetSentFromFlag() == "pl_account_dt") ? GetDate1() : ""; var secondCall = ""; var secondCallDate = ""; if (GetSentFromFlag() == "pl_account") { secondCall = "&sentfrom=pl_account"; secondCallDate = date; } var sb = new StringBuilder(""); var sb2 = new StringBuilder(""); var dt = st.GetSubLedgerReport(mapcode, treeSape, rdate, date); int sno = 0; double total = 0, DR = 0, CR = 0; if (dt.Rows.Count > 0 && dt != null) { foreach (DataRow item in dt.Rows) { sno++; total = total + Convert.ToDouble(item["Total"].ToString()); DR = DR + Convert.ToDouble(item["DR"].ToString()); CR = CR + Convert.ToDouble(item["CR"].ToString()); var drcrMode = " (CR)"; if (Convert.ToDouble(item["DR"].ToString()) - Convert.ToDouble(item["CR"].ToString()) > 0) { drcrMode = " (DR)"; } sb.AppendLine("
SN | "); sb2.AppendLine("AC Num | "); sb2.AppendLine("AC Name | "); sb2.AppendLine("DR Closing | "); sb2.AppendLine("CR Closing | "); sb2.AppendLine("Balance | "); sb2.AppendLine("
---|---|---|---|---|---|
" + sno.ToString() + " | "); sb2.AppendLine("" + item["acct_num"].ToString() + " | ");//link here in account number sb2.AppendLine("" + item["acct_name"].ToString() + " | "); sb2.AppendLine("" + GetStatic.ShowAbsDecimal(item["dr_closing"].ToString()) + " | "); sb2.AppendLine("" + GetStatic.ShowAbsDecimal(item["cr_closing"].ToString()) + " | "); sb2.AppendLine("" + GetStatic.ShowAbsDecimal(item["total"].ToString()) + drcrMode + " | "); sb2.AppendLine("
TOTAL: | "); sb2.AppendLine("" + GetStatic.ShowAbsDecimal(DR.ToString()) + " | "); sb2.AppendLine("" + GetStatic.ShowAbsDecimal(CR.ToString()) + " | "); sb2.AppendLine("" + GetStatic.ShowAbsDecimal(total.ToString()) + " | "); sb2.AppendLine("