protected void btnReport_Click(object sender, EventArgs e) { try { DateTime startDate, endDate; int iLedgerID = 1; ReportsBL.ReportClass rptCashReport; rptCashReport = new ReportsBL.ReportClass(); CashPanel.Visible = true; //startDate = Convert.ToDateTime(txtStartDate.Text); //endDate = Convert.ToDateTime(txtEndDate.Text); //lblStartDate.Text = txtStartDate.Text; //lblEndDate.Text = txtEndDate.Text; //DataSet ds = rptCashReport.generateReportDS(iLedgerID, startDate, endDate, sDataSource, 0); //gvCash.DataSource = ds; //gvCash.DataBind(); //CalculateDebitCredit(); //CashPanel.Visible = true; } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
public void gvExecutive_RowDataBound(object sender, GridViewRowEventArgs e) { try { double dTot = 0; int iExec = 0; if (e.Row.RowType == DataControlRowType.DataRow) { if (DataBinder.Eval(e.Row.DataItem, "Empno") != DBNull.Value) { iExec = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Empno")); } GridView gv = e.Row.FindControl("gvDealer") as GridView; ReportsBL.ReportClass rptOutstandingReport; DataSet ds = new DataSet(); rptOutstandingReport = new ReportsBL.ReportClass(); //Sundry Debtors (Customers) - 1 ds = rptOutstandingReport.generateOutStandingReportDS(1, iExec, sDataSource); gv.DataSource = ds; gv.DataBind(); Label lblTotal = (Label)e.Row.FindControl("lblTotal"); lblTotal.Text = sTotal; //dTotal.ToString("f2"); if (sTotal.Contains("Dr")) { dExTot = dExTot + dTotal; } else { dExTot = dExTot - dTotal; //e.Row.Style.Add("Display", "none"); } if (dTotal == 0 || dTotal < 0) { e.Row.Style.Add("Display", "none"); } } else if (e.Row.RowType == DataControlRowType.Footer) { Label lblTotEx = (Label)e.Row.FindControl("lblTotEx"); if (dExTot > 0) { lblTotEx.Text = dExTot.ToString("f2") + " Dr "; } else { lblTotEx.Text = Math.Abs(dExTot).ToString("f2") + " Cr "; } dExTot = 0; } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void btnReport_Click(object sender, EventArgs e) { try { DateTime startDate, endDate; if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } ReportsBL.ReportClass rptDayBook; startDate = Convert.ToDateTime(txtStartDate.Text); endDate = Convert.ToDateTime(txtEndDate.Text); lblStartDate.Text = txtStartDate.Text; lblEndDate.Text = txtEndDate.Text; rptDayBook = new ReportsBL.ReportClass(); DayBookPanel.Visible = true; DataSet ds = new DataSet(); string Branch = drpBranchAdd.SelectedValue; //ds = rptDayBook.generateDayBookDS(startDate, endDate, sDataSource); //gvLedger.DataSource = ds; //gvLedger.DataBind(); //CalculateDebitCredit(); DayBookPanel.Visible = false; div1.Visible = true; Response.Write("<script language='javascript'> window.open('DayBookReport1.aspx?startDate=" + Convert.ToDateTime(startDate) + "&endDate=" + Convert.ToDateTime(endDate) + "&Branch=" + Branch + " ' , 'window','height=700,width=1000,left=172,top=10,toolbar=yes,scrollbars=yes,resizable=yes');</script>"); } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
public void GetLedgerIndex() { ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = rpt.getLedgerIndex(sDataSource); //gvLedger.DataSource = ds; //gvLedger.DataBind(); }
protected void btnReport_Click(object sender, EventArgs e) { try { DateTime startDate, endDate; if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } ReportsBL.ReportClass rptDayBook; startDate = Convert.ToDateTime(txtStartDate.Text); endDate = Convert.ToDateTime(txtEndDate.Text); lblStartDate.Text = txtStartDate.Text; lblEndDate.Text = txtEndDate.Text; rptDayBook = new ReportsBL.ReportClass(); DayBookPanel.Visible = true; DataSet ds = new DataSet(); ds = rptDayBook.generateDayBookDS(startDate, endDate, sDataSource); gvLedger.DataSource = ds; gvLedger.DataBind(); CalculateDebitCredit(); DayBookPanel.Visible = true; div1.Visible = false; } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void btnReport_Click(object sender, EventArgs e) { try { DateTime startDate, endDate; int iLedgerID = 0; //string sDataSource = Server.MapPath(ConfigurationSettings.AppSettings["DataSource"].ToString()); // string sDataSource = Server.MapPath("App_Data\\Store0910.mdb"); ReportsBL.ReportClass rptBankReport; bnkPanel.Visible = true; iLedgerID = Convert.ToInt32(drpBankName.SelectedItem.Value); startDate = Convert.ToDateTime(txtStartDate.Text); endDate = Convert.ToDateTime(txtEndDate.Text); lblStartDate.Text = txtStartDate.Text; lblEndDate.Text = txtEndDate.Text; rptBankReport = new ReportsBL.ReportClass(); DataSet ds = rptBankReport.generateReportDS(iLedgerID, startDate, endDate, sDataSource, 0); gvBank.DataSource = ds; gvBank.DataBind(); bnkPanel.Visible = true; div1.Visible = false; } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void gvCreditSales_RowDataBound(object sender, GridViewRowEventArgs e) { try { //string sDataSource = ConfigurationManager.AppSettings["DataSource"].ToString(); // Server.MapPath("App_Data\\Store0910.mdb"); if (e.Row.RowType == DataControlRowType.DataRow) { GridView gv = e.Row.FindControl("gvProducts") as GridView; Label lblTotalAmt = e.Row.FindControl("lblTotal") as Label; Label lblPurchaseID = e.Row.FindControl("lblBillno") as Label; int billno = Convert.ToInt32(lblPurchaseID.Text); ReportsBL.ReportClass rptProduct = new ReportsBL.ReportClass(); DataSet ds = rptProduct.getProductsSales(billno, sDataSource); if (ds.Tables[0].Rows.Count > 0) { gv.DataSource = ds; gv.DataBind(); } SumCreditSales = SumCreditSales + Convert.ToDouble(lblTotalAmt.Text); lblGrandCreditSales.Text = "Rs. " + SumCreditSales.ToString("f2"); } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
public void setProfitAndLoss() { double purchaseTot = 0.0; double salesTot = 0.0; double expensesTot = 0.0d; double closingstockTotal = 0.0d; DateTime startDate, endDate; sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); startDate = Convert.ToDateTime(txtStartDate.Text); endDate = Convert.ToDateTime(txtEndDate.Text); ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); purchaseTot = rpt.GetPurchaseTotal(sDataSource, startDate, endDate); salesTot = rpt.GetSalesTotal(sDataSource, startDate, endDate); expensesTot = rpt.GetExpenseTotal(sDataSource, startDate, endDate); closingstockTotal = rpt.GetClosingStockTotal(sDataSource); lblPurchaseTotal.Text = purchaseTot.ToString("f2"); lblSalesTotal.Text = salesTot.ToString("f2"); lblExpensesTotal.Text = expensesTot.ToString("f2"); //lblClosingStock.Text = closingstockTotal.ToString("f2"); lblFromDate.Text = startDate.ToShortDateString(); lblToDate.Text = endDate.ToShortDateString(); GenerateGrossProfit(sDataSource, startDate, endDate); }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { try { sumDbl = 0; //string sDataSource = Server.MapPath(ConfigurationSettings.AppSettings["DataSource"].ToString()); // string sDataSource = Server.MapPath("App_Data\\Store0910.mdb"); if (e.Row.RowType == DataControlRowType.DataRow) { GridView gv = e.Row.FindControl("gvProducts") as GridView; Label lblCatID = e.Row.FindControl("lblCategoryID") as Label; Label lblTotal = e.Row.FindControl("lblTotal") as Label; //Label lblCategory = e.Row.FindControl("lblCategory") as Label; Label lblGrand = e.Row.FindControl("lblGrandTotal") as Label; // int catID = Convert.ToInt32(lblCatID.Text); int catID = Convert.ToInt32(gvCategory.DataKeys[e.Row.RowIndex].Value); ReportsBL.ReportClass rptProduct = new ReportsBL.ReportClass(); DataSet ds = rptProduct.getBundleProducts(sDataSource, catID); if (ds.Tables[0].Rows.Count > 0) { gv.DataSource = ds; gv.DataBind(); } else { //lblCategory.Text = ""; } lblTotal.Text = sumDbl.ToString("f2"); } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void GenerateVat(string sDataSource, DateTime startDate, DateTime endDate, string sType) { ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = null; // rpt.generateVatReport(sDataSource, startDate, endDate, sType); grdVat.DataSource = ds; grdVat.DataBind(); }
protected void GenerateGrossProfit(string sDataSource, DateTime startDate, DateTime endDate, string sType, string pType) { ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = null; // rpt.GrossProfit(sDataSource, startDate, endDate, sType, pType); gvGross.DataSource = ds; gvGross.DataBind(); }
protected void GenerateChequeReceived(string sDataSource, DateTime startDate, DateTime endDate, string pType) { ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = rpt.generateChequeReceived(sDataSource, startDate, endDate, pType); gvChequeReceived.DataSource = ds; gvChequeReceived.DataBind(); }
protected void GenerateItemwisePurchase(string sDataSource, DateTime startDate, DateTime endDate, string sType) { ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = rpt.itemwisePurchase(sDataSource, startDate, endDate, sType); gvPurchase.DataSource = ds; gvPurchase.DataBind(); }
protected void GenerateCashPaid(string sDataSource, DateTime startDate, DateTime endDate, string sType) { ReportsBL.ReportClass rptCash = new ReportsBL.ReportClass(); DataSet ds = rptCash.generateCashPaid(sDataSource, startDate, endDate, sType); gvCashPaid.DataSource = ds; gvCashPaid.DataBind(); }
protected void GenarateCreditSales(string sDataSource, DateTime startDate, DateTime endDate, string sType) { ReportsBL.ReportClass rptCash = new ReportsBL.ReportClass(); DataSet ds = rptCash.generateSalesReport(3, sDataSource, startDate, endDate, sType); gvCreditSales.DataSource = ds; gvCreditSales.DataBind(); }
protected void GenerateChequePurchase(string sDataSource, DateTime startDate, DateTime endDate, string sType) { ReportsBL.ReportClass rptCash = new ReportsBL.ReportClass(); DataSet ds = rptCash.generatePurchaseReport(2, sDataSource, startDate, endDate, sType); gvChequePurchase.DataSource = ds; gvChequePurchase.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { txtStartDate.Text = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToShortDateString(); txtEndDate.Text = DateTime.Now.ToShortDateString(); if (Session["startDate"] != null) { txtStartDate.Text = Session["startDate"].ToString(); } if (Session["endDate"] != null) { txtEndDate.Text = Session["endDate"].ToString(); } sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = new DataSet(); DataSet salesDs = new DataSet(); BusinessLogic bl = new BusinessLogic(sDataSource); ds = bl.avlVAT("purchase", sDataSource); if (ds != null && ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { vatPurchaseString = vatPurchaseString + dr["VAT"].ToString() + ","; } } if (vatPurchaseString.EndsWith(",")) { vatPurchaseString = vatPurchaseString.Remove(vatPurchaseString.Length - 1, 1); } salesDs = bl.avlVAT("sales", sDataSource); if (salesDs != null && salesDs.Tables[0].Rows.Count > 0) { foreach (DataRow drS in salesDs.Tables[0].Rows) { vatSalesString = vatSalesString + drS["VAT"].ToString() + ","; } } if (vatSalesString.EndsWith(",")) { vatSalesString = vatSalesString.Remove(vatSalesString.Length - 1, 1); } hdPurchase.Value = vatPurchaseString; hdSales.Value = vatSalesString; } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
public void gvTrailBalance_RowDataBound(object sender, GridViewRowEventArgs e) { try { /*March 17*/ DateTime startDate, endDate; startDate = Convert.ToDateTime(txtStartDate.Text); endDate = Convert.ToDateTime(txtEndDate.Text); /*March 17*/ if (e.Row.RowType == DataControlRowType.DataRow) { Label lblDebit = (Label)e.Row.FindControl("lblDebit"); Label lblCredit = (Label)e.Row.FindControl("lblCredit"); if (lblDebit != null && lblDebit.Text != "") { debitTotal = debitTotal + Convert.ToDouble(lblDebit.Text); } if (lblCredit != null && lblCredit.Text != "") { creditTotal = creditTotal + Convert.ToDouble(lblCredit.Text); } } lblDebitTotal.Text = debitTotal.ToString("f2"); lblCreditTotal.Text = creditTotal.ToString("f2"); if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='ALiceblue';"); e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='khaki';"); } if (e.Row.RowType == DataControlRowType.DataRow) { GridView gv = e.Row.FindControl("gvLiaLedger") as GridView; GridView gvGroup = (GridView)sender; if (gvGroup.DataKeys[e.Row.RowIndex].Value != "") { int groupID = Convert.ToInt32(gvGroup.DataKeys[e.Row.RowIndex].Value); ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = rpt.getLedgerTransaction(groupID, sDataSource, startDate, endDate); if (ds.Tables[0].Rows.Count > 0) { gv.DataSource = ds; gv.DataBind(); } } } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void btnReport_Click(object sender, EventArgs e) { try { DateTime startDate, endDate; if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } SalesPanel.Visible = true; startDate = Convert.ToDateTime(txtStartDate.Text); endDate = Convert.ToDateTime(txtEndDate.Text); lblStartDate.Text = txtStartDate.Text; lblEndDate.Text = txtEndDate.Text; ReportsBL.ReportClass rptSalesReport; string option = string.Empty; option = optionmethod.SelectedItem.Text; rptSalesReport = new ReportsBL.ReportClass(); BusinessLogic bl = new BusinessLogic(sDataSource); DataSet ds = new DataSet(); string cond = ""; cond = getCond(); //if (optionmethod.SelectedItem.Text == "All") //{ // ds = rptSalesReport.generateSalesReportDS(startDate, endDate, sDataSource); //} //else //{ // ds = bl.generateSalesReportDSE(startDate, endDate, sDataSource, option); //} //gvSales.DataSource = ds; //gvSales.DataBind(); SalesPanel.Visible = false; div1.Visible = true; if (lstBranch.SelectedIndex == -1) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('Select any Branch')", true); } else { Response.Write("<script language='javascript'> window.open('SalesReport1.aspx?startDate=" + startDate + "&cond=" + Server.UrlEncode(cond) + "&endDate=" + endDate + "&option=" + option + " ' , 'window','height=700,width=1000,left=172,top=10,toolbar=yes,scrollbars=yes,resizable=yes');</script>"); } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void CalculateDebitCredit() { ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } DateTime stDate; stDate = Convert.ToDateTime(txtStartDate.Text.Trim()); lblOB.Text = rpt.GetDayBookOB(stDate, sDataSource).ToString("N2"); }
public void gvLiabilityBalance_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { Label lblSum = (Label)e.Row.FindControl("lblSum"); if (lblSum != null && lblSum.Text != "") { creditTotal = creditTotal + Convert.ToDouble(lblSum.Text); } lblCreditTotal.Text = creditTotal.ToString("f2"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='ALiceblue';"); e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='khaki';"); GridView gv = e.Row.FindControl("gvLiaGroup") as GridView; if (gvLiabilityBalance.DataKeys[e.Row.RowIndex].Value != "") { int headID = Convert.ToInt32(gvLiabilityBalance.DataKeys[e.Row.RowIndex].Value); ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = GetBalanceSheet2(headID); if (ds != null) { ds.Tables[0].Rows[0].Delete(); if (ds.Tables[0].Rows.Count > 0) { gv.DataSource = ds; gv.DataBind(); } } } } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[0].HorizontalAlign = HorizontalAlign.Center; e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Right; e.Row.Cells[0].Text = "Total"; e.Row.Cells[1].Text = creditTotal.ToString("f2"); } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void printPreview() { string sFilename = string.Empty; DataSet ds = new DataSet(); double opCr = 0.0; double opDr = 0.0; double netOp = 0.0; Double cbDr = 0.00; Double cbCr = 0.00; ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); if (Session["dataSet"] != null) { sFilename = Server.MapPath(Session["dataSet"].ToString()); if (File.Exists(sFilename)) { ds.ReadXml(sFilename, XmlReadMode.InferSchema); ViewState["filename"] = ds; } else { ds = (DataSet)ViewState["filename"]; } gvLedger.DataSource = ds; gvLedger.DataBind(); } if (Session["Ledger"] != null) { lblLedger.Text = Session["Ledger"].ToString(); } int ledgerID = 0; if (Session["LedgerID"] != null) { ledgerID = Convert.ToInt32(Session["LedgerID"]); } if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } lblBillDate.Text = DateTime.Now.ToShortDateString(); deleteFile(); }
public void GetLedgerTran(DateTime startDate, DateTime endDate) { ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); DataSet ds = rpt.getLedgerTransaction(0, sDataSource, startDate, endDate); if (ds != null) { gvMainLedger.DataSource = ds; gvMainLedger.DataBind(); grdDs.Tables[0].Rows[0].Delete(); gvLedger.DataSource = grdDs; gvLedger.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { try { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); if (!IsPostBack) { DataSet companyInfo = new DataSet(); BusinessLogic bl = new BusinessLogic(sDataSource); if (Request.Cookies["Company"] != null) { companyInfo = bl.getCompanyInfo(Request.Cookies["Company"].Value); if (companyInfo != null) { if (companyInfo.Tables[0].Rows.Count > 0) { foreach (DataRow dr in companyInfo.Tables[0].Rows) { lblTNGST.Text = Convert.ToString(dr["TINno"]); lblCompany.Text = Convert.ToString(dr["CompanyName"]); lblPhone.Text = Convert.ToString(dr["Phone"]); lblGSTno.Text = Convert.ToString(dr["GSTno"]); lblAddress.Text = Convert.ToString(dr["Address"]); lblCity.Text = Convert.ToString(dr["city"]); lblPincode.Text = Convert.ToString(dr["Pincode"]); lblState.Text = Convert.ToString(dr["state"]); } } } } } lblBillDate.Text = DateTime.Now.ToString("dd/MM/yyyy"); lblHeadDate.Text = DateTime.Now.ToString("dd/MM/yyyy"); //string sDataSource = Server.MapPath("App_Data\\Store0910.mdb"); //string sDataSource = Server.MapPath(ConfigurationSettings.AppSettings["DataSource"].ToString()); ReportsBL.ReportClass rptStock = new ReportsBL.ReportClass(); DataSet ds = rptStock.getCategory(sDataSource); gvCategory.DataSource = ds; gvCategory.DataBind(); } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void gvSales_RowDataBound(object sender, GridViewRowEventArgs e) { try { //string sDataSource = Server.MapPath("App_Data\\Store0910.mdb"); if (e.Row.RowType == DataControlRowType.DataRow) { GridView gv = e.Row.FindControl("gvProducts") as GridView; Label lblPurchaseID = e.Row.FindControl("lblBillno") as Label; Label lblPaymode = e.Row.FindControl("lblPaymode") as Label; if (lblPaymode.Text == "1") { lblPaymode.Text = "Cash"; } else if (lblPaymode.Text == "2") { lblPaymode.Text = "Bank"; } else { lblPaymode.Text = "Credit"; } if (lblPurchaseID.Text != "") { int billno = Convert.ToInt32(lblPurchaseID.Text); ReportsBL.ReportClass rptProduct = new ReportsBL.ReportClass(); if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } DataSet ds = rptProduct.getProductsSales(billno, sDataSource); if (ds.Tables[0].Rows.Count > 0) { gv.DataSource = ds; gv.DataBind(); } } //SumCashSales = SumCashSales + Convert.ToDouble(lblTotalAmt.Text); //lblGrandCashSales.Text = "Rs. " + SumCashSales.ToString("f2"); } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); BusinessLogic bl = new BusinessLogic(sDataSource); DataSet ds = new DataSet(); DataSet salesDs = new DataSet(); ds = bl.avlCST("purchase", sDataSource); if (ds != null && ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { CSTPurchaseString = CSTPurchaseString + dr["CST"].ToString() + ","; } } if (CSTPurchaseString.EndsWith(",")) { CSTPurchaseString = CSTPurchaseString.Remove(CSTPurchaseString.Length - 1, 1); } salesDs = bl.avlCST("sales", sDataSource); if (salesDs != null && salesDs.Tables[0].Rows.Count > 0) { foreach (DataRow drS in salesDs.Tables[0].Rows) { CSTSalesString = CSTSalesString + drS["CST"].ToString() + ","; } } if (CSTSalesString.EndsWith(",")) { CSTSalesString = CSTSalesString.Remove(CSTSalesString.Length - 1, 1); } hdPurchase.Value = CSTPurchaseString; hdSales.Value = CSTSalesString; } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void btnReport_Click(object sender, EventArgs e) { try { divPrint.Visible = true; divPr.Visible = true; ReportsBL.ReportClass rptStock = new ReportsBL.ReportClass(); DataSet ds = rptStock.getCategory(sDataSource); GrdProduct.DataSource = ds; GrdProduct.DataBind(); // div1.Visible = false; } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void printPreview() { string sFilename = string.Empty; DataSet ds = new DataSet(); if (Session["dataSet"] != null) { sFilename = Server.MapPath(Session["dataSet"].ToString()); if (File.Exists(sFilename)) { ds.ReadXml(sFilename, XmlReadMode.InferSchema); ViewState["filename"] = ds; } else { ds = (DataSet)ViewState["filename"]; } gvLedger.DataSource = ds; gvLedger.DataBind(); } if (Session["startDate"] != null) { lblStartDate.Text = Session["startDate"].ToString(); } if (Session["endDate"] != null) { lblEndDate.Text = Session["endDate"].ToString(); } lblBillDate.Text = DateTime.Now.ToShortDateString(); ReportsBL.ReportClass rpt = new ReportsBL.ReportClass(); if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } DateTime stDate; stDate = Convert.ToDateTime(Session["startDate"].ToString()); lblOB.Text = rpt.GetDayBookOB(stDate, sDataSource).ToString("N2"); deleteFile(); }
//public static string GetMacAdd() //{ // ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); // ManagementObjectCollection moc = mc.GetInstances(); // string MACAddress = ""; // foreach (ManagementObject mo in moc) // { // if (mo["MacAddress"] != null) // { // if ((bool)mo["IPEnabled"] == true) // { // MACAddress = mo["MacAddress"].ToString(); // } // } // } // return MACAddress; //} //public static string GetMacAddress() //{ // ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); // ManagementObjectCollection moc = mc.GetInstances(); // string MACAddress = ""; // foreach (ManagementObject mo in moc) // { // if (mo["MacAddress"] != null) // { // MACAddress = mo["MacAddress"].ToString(); // } // } // return MACAddress; //} protected void btnReport_Click(object sender, EventArgs e) { try { DateTime startDate, endDate; if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } SalesPanel.Visible = true; startDate = Convert.ToDateTime(txtStartDate.Text); endDate = Convert.ToDateTime(txtEndDate.Text); lblStartDate.Text = txtStartDate.Text; lblEndDate.Text = txtEndDate.Text; ReportsBL.ReportClass rptSalesReport; string option = string.Empty; option = optionmethod.SelectedItem.Text; rptSalesReport = new ReportsBL.ReportClass(); BusinessLogic bl = new BusinessLogic(sDataSource); DataSet ds = new DataSet(); if (optionmethod.SelectedItem.Text == "All") { ds = rptSalesReport.generateSalesReportDS(startDate, endDate, sDataSource, ""); } else { ds = bl.generateSalesReportDSE(startDate, endDate, sDataSource, option, ""); } gvSales.DataSource = ds; gvSales.DataBind(); SalesPanel.Visible = true; div1.Visible = false; } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
protected void btnRep_Click(object sender, EventArgs e) { try { DateTime startDate, endDate; if (Request.Cookies["Company"] != null) { sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } startDate = Convert.ToDateTime(txtStartDate.Text); endDate = Convert.ToDateTime(txtEndDate.Text); var rptSalesReport = new ReportsBL.ReportClass(); DataSet ds = rptSalesReport.generatePurchaseLevel1Report(startDate, endDate, sDataSource); gvPurchaseLevel1.DataSource = ds; gvPurchaseLevel1.DataBind(); ds = rptSalesReport.generatePurchaseLevel2Report(startDate, endDate, sDataSource); gvPurchaseLevel2.DataSource = ds; gvPurchaseLevel2.DataBind(); ds = rptSalesReport.generatePurchaseLevel3Report(startDate, endDate, sDataSource); gvPurchaseLevel3.DataSource = ds; gvPurchaseLevel3.DataBind(); ds = rptSalesReport.generatePurchaseLevel4Report(startDate, endDate, sDataSource); gvPurchaseLevel4.DataSource = ds; gvPurchaseLevel4.DataBind(); divPrint.Visible = false; div1.Visible = true; divmain.Visible = false; Response.Write("<script language='javascript'> window.open('PurchaseLevelReport1.aspx?startDate=" + Convert.ToDateTime(startDate) + "&endDate=" + Convert.ToDateTime(endDate) + " ' , 'window','height=700,width=1000,left=172,top=10,toolbar=yes,scrollbars=yes,resizable=yes');</script>"); } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }