You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

102 lines
3.5 KiB

using Swift.DAL.AccountReportOld;
using Swift.web.Library;
using System;
using System.Data;
using System.Text;
using System.Web;
namespace Swift.web.AccountReportOld.DayBookOld
{
public partial class dayBookReportOld : System.Web.UI.Page
{
private string vName = null;
private string fromDate = null;
private string toDate = null;
private string voucherType = null;
private SwiftLibrary _sl = new SwiftLibrary();
private DayBookReportOldDAO st = new DayBookReportOldDAO();
protected void Page_Load(object sender, EventArgs e)
{
_sl.CheckSession();
if (!IsPostBack)
{
GenerateDayBookReport("manual");
}
}
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", "");
}
private void GenerateDayBookReport(string showType)
{
fromDate = FromDate();
toDate = ToDate();
voucherType = VoucherType();
vName = VoucherName();
var dt = st.GetDayBookReport(fromDate, toDate, voucherType, showType);
if (dt == null || dt.Rows.Count == 0)
{
return;
}
var sb = new StringBuilder();
double AmountTotal = 0;
int sNo = 1;
foreach (DataRow item in dt.Rows)
{
sb.AppendLine("<tr>");
AmountTotal += GetStatic.ParseDouble(item["amount"].ToString());
string vNumber = item["Voucher"].ToString();
string vNumLink = "<a href='../../BillVoucherOld/VoucherReportOld/VoucherReportDetailsOld.aspx?typeDDL=" + item["tran_type"].ToString() + "&vNum=" + item["Voucher"].ToString() + "&vText=" + vName;
vNumLink += "&type=trannumber&trn_date=" + item["tran_date"].ToString() + "&tran_num=" + item["Voucher"].ToString() + "' title='Voucher Detail' >";
vNumLink += vNumber + "</a>";
sb.AppendLine("<td nowrap='nowrap' align='center' >" + sNo + " </td>");
sb.AppendLine("<td nowrap='nowrap' >" + vNumLink + "</td>");
sb.AppendLine("<td nowrap='nowrap'>" + GetStatic.GetVoucherName(item["tran_type"].ToString()) + " </td>");
sb.AppendLine("<td nowrap='nowrap' >" + item["acc_num"] + " </td>");
sb.AppendLine("<td nowrap='nowrap'>" + item["acct_name"] + " </td>");
sb.AppendLine("<td nowrap='nowrap'>" + item["tran_date"] + " </td>");
sb.AppendLine("<td nowrap='nowrap' align='right'>" + GetStatic.ShowDecimal(item["amount"].ToString()) + " </td>");
sb.AppendLine("</tr>");
sNo++;
}
dayBook.InnerHtml = sb.ToString();
totalBalance.Text = GetStatic.ShowDecimal(AmountTotal.ToString());
}
protected void pdf_Click(object sender, EventArgs e)
{
GetStatic.GetPDF(HttpUtility.UrlDecode(hidden.Value));
}
protected void ddlShowAll_SelectedIndexChanged(object sender, EventArgs e)
{
GenerateDayBookReport(ddlShowAll.SelectedValue);
}
}
}