public void BindGrid() { string sDataSource = string.Empty; if (Request.Cookies["Company"] != null) { sDataSource = System.Configuration.ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } else { Response.Redirect("~/Login.aspx"); } DataSet ds = new DataSet(); BusinessLogic bl = new BusinessLogic(sDataSource); ds = bl.ListJournal(txtTransno.Text.Trim(), txtRefno.Text.Trim(), txtLedger.Text.Trim(), txtDate.Text, sDataSource); if (ds != null) { GrdViewJournal.DataSource = ds.Tables[0].DefaultView; GrdViewJournal.DataBind(); } else { GrdViewJournal.DataSource = null; GrdViewJournal.DataBind(); } }
protected void cmdSearch_Click(object sender, EventArgs e) { try { string sDataSource = string.Empty; string textt = string.Empty; string dropd = string.Empty; if (Request.Cookies["Company"] != null) { sDataSource = System.Configuration.ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } else { Response.Redirect("~/frm_Login.aspx"); } textt = txtSearch.Text; dropd = ddCriteria.SelectedValue; DataSet ds = new DataSet(); BusinessLogic bl = new BusinessLogic(sDataSource); //ds = bl.ListJournal(txtTransno.Text.Trim(), txtRefno.Text.Trim(), txtLedger.Text.Trim(), txtDate.Text, sDataSource); ds = bl.ListJournalDatas(textt, dropd, sDataSource); if (ds != null) { GrdViewJournal.DataSource = ds.Tables[0].DefaultView; GrdViewJournal.DataBind(); } else { GrdViewJournal.EmptyDataText = "No journals found"; GrdViewJournal.DataSource = null; GrdViewJournal.DataBind(); } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }
public void BindJournal() { string sDataSource = string.Empty; if (Request.Cookies["Company"] != null) { sDataSource = System.Configuration.ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); } else { Response.Redirect("~/Login.aspx"); } bool deletedItems = false; deletedItems = ChkJournal.Checked; DataSet ds = new DataSet(); BusinessLogic bl = new BusinessLogic(sDataSource); ds = bl.lsJournal(txtRefno.Text.Trim(), txtNaration.Text.Trim(), txtDate.Text, sDataSource, deletedItems); if (ds != null) { GrdViewJournal.DataSource = ds.Tables[0].DefaultView; GrdViewJournal.DataBind(); } else { GrdViewJournal.DataSource = null; GrdViewJournal.DataBind(); } if (ChkJournal.Checked) { GrdViewJournal.Columns[7].Visible = false; GrdViewJournal.Columns[6].Visible = true; } else { GrdViewJournal.Columns[6].Visible = false; GrdViewJournal.Columns[7].Visible = true; } }
protected void rdoType_SelectedIndexChanged(object sender, EventArgs e) { try { if (rdoType.SelectedValue == "Payment") { divPayment.Visible = true; divReceipt.Visible = false; divJournal.Visible = false; divPurchase.Visible = false; divSales.Visible = false; divPaymentResult.Visible = true; GrdViewJournal.DataSource = null; GrdViewJournal.DataBind(); GrdViewPurchase.DataSource = null; GrdViewPurchase.DataBind(); GrdViewReceipt.DataSource = null; GrdViewReceipt.DataBind(); GrdViewSales.DataSource = null; GrdViewSales.DataBind(); ChkSales.Checked = false; ChkJournal.Checked = false; ChkPurchase.Checked = false; ChkReceipt.Checked = false; BindPayment(); } else if (rdoType.SelectedValue == "Receipt") { divPayment.Visible = false; divReceipt.Visible = true; divJournal.Visible = false; divPurchase.Visible = false; divSales.Visible = false; ChkSales.Checked = false; ChkJournal.Checked = false; ChkPurchase.Checked = false; ChkPayDel.Checked = false; divPaymentResult.Visible = false; divJournalResult.Visible = false; divPurchaseResult.Visible = false; divReceiptResult.Visible = true; divSalesResult.Visible = false; GrdViewPayment.DataSource = null; GrdViewPayment.DataBind(); GrdViewJournal.DataSource = null; GrdViewJournal.DataBind(); GrdViewPurchase.DataSource = null; GrdViewPurchase.DataBind(); GrdViewSales.DataSource = null; GrdViewSales.DataBind(); BindReceipt(); } else if (rdoType.SelectedValue == "Journal") { divPayment.Visible = false; divReceipt.Visible = false; divJournal.Visible = true; divPurchase.Visible = false; divSales.Visible = false; ChkSales.Checked = false; ChkPayDel.Checked = false; ChkPurchase.Checked = false; ChkReceipt.Checked = false; divPaymentResult.Visible = false; divJournalResult.Visible = true; divPurchaseResult.Visible = false; divReceiptResult.Visible = false; divSalesResult.Visible = false; GrdViewPayment.DataSource = null; GrdViewPayment.DataBind(); GrdViewPurchase.DataSource = null; GrdViewPurchase.DataBind(); GrdViewReceipt.DataSource = null; GrdViewReceipt.DataBind(); GrdViewSales.DataSource = null; GrdViewSales.DataBind(); BindJournal(); } else if (rdoType.SelectedValue == "Purchase") { divPayment.Visible = false; divReceipt.Visible = false; divJournal.Visible = false; divPurchase.Visible = true; divSales.Visible = false; divPaymentResult.Visible = false; divJournalResult.Visible = false; divPurchaseResult.Visible = true; divReceiptResult.Visible = false; divSalesResult.Visible = false; ChkSales.Checked = false; ChkJournal.Checked = false; ChkPayDel.Checked = false; ChkReceipt.Checked = false; GrdViewPayment.DataSource = null; GrdViewPayment.DataBind(); GrdViewJournal.DataSource = null; GrdViewJournal.DataBind(); GrdViewReceipt.DataSource = null; GrdViewReceipt.DataBind(); GrdViewSales.DataSource = null; GrdViewSales.DataBind(); BindPurchase("0"); } else { divReceipt.Visible = false; divPayment.Visible = false; divJournal.Visible = false; divPurchase.Visible = false; divSales.Visible = true; ChkPayDel.Checked = false; ChkJournal.Checked = false; ChkPurchase.Checked = false; ChkReceipt.Checked = false; divPaymentResult.Visible = false; divJournalResult.Visible = false; divPurchaseResult.Visible = false; divReceiptResult.Visible = false; divSalesResult.Visible = true; GrdViewPayment.DataSource = null; GrdViewPayment.DataBind(); GrdViewJournal.DataSource = null; GrdViewJournal.DataBind(); GrdViewPurchase.DataSource = null; GrdViewPurchase.DataBind(); GrdViewReceipt.DataSource = null; GrdViewReceipt.DataBind(); BindSales(0); } } catch (Exception ex) { TroyLiteExceptionManager.HandleException(ex); } }