using Swift.DAL.AccountReportOld; using Swift.web.Library; using System; using System.Data; using System.Text; namespace Swift.web.AccountReportOld.AccountStatementOld { public partial class userreportResultSingleOld : System.Web.UI.Page { private SwiftLibrary _sl = new SwiftLibrary(); private AccountStatementOldDAO st = new AccountStatementOldDAO(); protected void Page_Load(object sender, EventArgs e) { _sl.CheckSession(); if (GetStatic.ReadQueryString("r", "") == "Y") { divReverse.Visible = _sl.HasRight(""); } GenerateReport(); } protected string TransactionNumber() { return GetStatic.ReadQueryString("tran_num", ""); } protected string TransactionDate() { return GetStatic.ReadQueryString("trn_date", ""); } protected string VoucherType() { return GetStatic.ReadQueryString("vouchertype", ""); } private void GenerateReport() { string tranNum = TransactionNumber(); string tranactionDate = TransactionDate(); string vType = VoucherType(); tranNumber.Text = tranNum; tranDate.Text = tranactionDate; voucherType.Text = GetStatic.GetVoucherType(vType, ""); letterHead.InnerHtml = GetStatic.getCompanyHead(); var dt = st.GetUserReportResultSingle(tranNum, tranactionDate, vType); var sb = new StringBuilder(""); sb.AppendLine("
"); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); string fcyCurr = dt.Rows[0]["fcy_Curr"].ToString(); int totalSpan = 3; if (!string.IsNullOrWhiteSpace(fcyCurr)) { sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); totalSpan = 6; } sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); int sno = 0; double drTotal = 0, crTotal = 0; foreach (DataRow item in dt.Rows) { sno++; drTotal = drTotal + GetStatic.ParseDouble(item["DRTotal"].ToString()); crTotal = crTotal + GetStatic.ParseDouble(item["cRTotal"].ToString()); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); if (!string.IsNullOrWhiteSpace(fcyCurr)) { 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(""); sb.AppendLine(""); sb.AppendLine("
SN AC No Name FCYRate FCY Amount Dr Amount Cr Amount
" + sno.ToString() + " " + item["acc_num"].ToString() + " " + item["acct_name"].ToString() + "" + item["fcy_Curr"].ToString() + "" + item["usd_rate"].ToString() + "" + GetStatic.ShowDecimal(item["usd_amt"].ToString()) + " " + GetStatic.ShowDecimal(item["DRTotal"].ToString()) + " " + GetStatic.ShowDecimal(item["cRTotal"].ToString()) + "
Total  
" + GetStatic.ShowDecimal(drTotal.ToString()) + " " + GetStatic.ShowDecimal(crTotal.ToString()) + "
Narration:   " + dt.Rows[0]["tran_particular"].ToString() + "
"); if (!string.IsNullOrWhiteSpace(dt.Rows[0]["voucher_image"].ToString())) { voucherImg.Visible = true; voucherImg.ImageUrl = "~/doc/VoucherDoc/" + dt.Rows[0]["voucher_image"].ToString(); } userId.Text = dt.Rows[0]["entry_user_id"].ToString(); reportTable.InnerHtml = sb.ToString(); } protected void pdf_Click(object sender, EventArgs e) { //GetStatic.GetPDF(HttpUtility.UrlDecode(hidden.Value)); } protected void btnReversal_Click(object sender, EventArgs e) { var vouchertype = GetStatic.ReadQueryString("vouchertype", ""); var tran_num = GetStatic.ReadQueryString("tran_num", ""); if (string.IsNullOrWhiteSpace(date.Text)) { GetStatic.AlertMessage(this, "Please Choose Reversal Date"); return; } if (!string.IsNullOrWhiteSpace(vouchertype) && !string.IsNullOrWhiteSpace(tran_num)) { var dbResult = st.GetVoucherReverse(tran_num, vouchertype, GetStatic.GetUser(), date.Text, Narration.Text); if (dbResult.ErrorCode == "0") { btnReversal.Visible = false; } reportTable.InnerHtml = dbResult.Msg; } else { GetStatic.AlertMessage(this, "Voucher Detail not found! Go back to Statement and try again"); return; } } } }