using Swift.DAL.AccountReport; using Swift.web.Library; using System; using System.Data; using System.Text; using System.Web; namespace Swift.web.AccountReport.DayBook { public partial class dayBookReportUser : System.Web.UI.Page { private string vName = null; private string fromDate = null; private string toDate = null; private string vType = null; private string userName = null; private SwiftLibrary _sl = new SwiftLibrary(); private DayBookReportDAO st = new DayBookReportDAO(); protected void Page_Load(object sender, EventArgs e) { _sl.CheckSession(); if (!IsPostBack) { GenerateDayBookRepotUser(); } } protected string FromDate() { return GetStatic.ReadQueryString("startDate", ""); } protected string ToDate() { return GetStatic.ReadQueryString("endDate", ""); } protected string VoucherType() { return GetStatic.ReadQueryString("vType", ""); } protected string VoucherName() { return GetStatic.ReadQueryString("vName", ""); } protected string UserName() { return GetStatic.ReadQueryString("userName", ""); } private void GenerateDayBookRepotUser() { vName = VoucherName(); fromDate = FromDate(); toDate = ToDate(); vType = VoucherType(); userName = UserName(); DataSet ds = st.GetDayBookReportUser(fromDate, toDate, vType, userName); if (ds == null || ds.Tables.Count == 0) { return; } int i = 0; if (ds.Tables != null) { var tbl = ds.Tables[i]; var sb = new StringBuilder(); double DRTotal = 0, cRTotal = 0; int sNo = 1; sb.AppendLine("
"); // sb.AppendLine(" // // "); sb.AppendLine(" "); sb.AppendLine(" // // "); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); string vNumber = null; foreach (DataRow item in tbl.Rows) { vNumber = item["billno"].ToString(); } sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine("
"); sb.AppendLine("
// Daybook Report
"); sb.AppendLine("
User Name: " + userName + " "); sb.AppendLine("
Voucher No :   " + vNumber + "Voucher Type :   " + vName + "
"); sb.AppendLine("
"); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); foreach (DataRow item in tbl.Rows) { sb.AppendLine(""); DRTotal += GetStatic.ParseDouble(item["DRTotal"].ToString()); cRTotal += GetStatic.ParseDouble(item["cRTotal"].ToString()); //var vNumber = item["billno"].ToString(); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sNo++; } sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine("
SNAC NoNameDr AmountCr Amount
" + sNo + " " + item["acc_num"] + " " + item["acct_name"] + " " + GetStatic.ShowDecimal(item["DRTotal"].ToString()) + " " + GetStatic.ShowDecimal(item["cRTotal"].ToString()) + "
" + "Total" + " " + GetStatic.ShowDecimal(DRTotal.ToString()) + " " + GetStatic.ShowDecimal(cRTotal.ToString()) + "
"); sb.AppendLine("
"); reportDiv.InnerHtml = sb.ToString(); i++; } //var sb = new StringBuilder(); //double DRTotal = 0, cRTotal = 0; //int sNo = 1; //drTotal.Text = GetStatic.ShowDecimal(cRTotal.ToString()); //crTotal.Text = GetStatic.ShowDecimal(DRTotal.ToString()); //foreach (DataRow item in dt.Rows) //{ // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // DRTotal += GetStatic.ParseDouble(item["DRTotal"].ToString()); // cRTotal += GetStatic.ParseDouble(item["cRTotal"].ToString()); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine(""); sb.AppendLine(""); // sb.AppendLine(""); // sb.AppendLine("
Voucher No :   " + item["billno"] + "Voucher Type :   " + vName + "
SNAC NoNameDr AmountCr Amount
" + sNo + " " + item["acc_num"] + " " + item["acct_name"] + " " + // GetStatic.ShowDecimal(item["DRTotal"].ToString()) + " " + GetStatic.ShowDecimal(item["cRTotal"].ToString()) + "
"); // sNo++; // reportDiv.InnerHtml = sb.ToString(); //} //drTotal.Text = GetStatic.ShowDecimal(cRTotal.ToString()); //crTotal.Text = GetStatic.ShowDecimal(DRTotal.ToString()); } protected void pdf_Click(object sender, EventArgs e) { GetStatic.GetPDF(HttpUtility.UrlDecode(hidden.Value)); } } }