protected void btnSearch_Click(object sender, EventArgs e) { try { VoucherSearch search = new VoucherSearch(); if (dtpFromDate.Text == string.Empty) { search.FromDate = null; } else { search.FromDate = dtpFromDate.Date; } if (dtpToDate.Text == string.Empty) { search.ToDate = null; } else { search.ToDate = dtpToDate.Date; } DataSet ds = new VoucherDAO().GetDaybookDetailsForReporting(search); Session["DayBookReport"] = ds; dxgvExpenseReport.DataSource = ds; dxgvExpenseReport.DataBind(); } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnSearch_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); else Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } }
private void LoadAccountTypes() { try { // // Fill Customer Code // DataSet dsAccountTypes = new VoucherDAO().GetAllAccountTypes(); if (dsAccountTypes == null || dsAccountTypes.Tables.Count == 0) { ddlAccountTypes.Items.Add(new ListItem("--No Data Found--", "-1")); } else { ddlAccountTypes.DataSource = dsAccountTypes; ddlAccountTypes.DataTextField = "AccountName"; ddlAccountTypes.DataValueField = "AccountID"; ddlAccountTypes.DataBind(); //ddlAccountTypes.Items.Add(new ListItem("--Please Select--", "-1")); //ddlAccountTypes.SelectedValue = "-1"; } } catch (Exception ex) { throw ex; } }
private void LoadAccountTypes() { try { // // Fill Customer Code // DataSet dsAccountTypes = new VoucherDAO().GetAllAccountTypes(); if (dsAccountTypes == null || dsAccountTypes.Tables.Count == 0) { ddlAccountTypes.Items.Add(new ListItem("--No Data Found--", "-1")); } else { Master.BindDropdown("AccountName", "AccountID", dsAccountTypes, ddlAccountTypes); ddlAccountTypes.Items.Add(new ListItem("--Please Select--", "-1")); ddlAccountTypes.SelectedValue = "-1"; } } catch (Exception ex) { throw ex; } }