protected void btnCustomerPaymentList_OnClick(object sender, EventArgs e) { CustomerBLL customerBll=new CustomerBLL(); try { if (customerDropDownList.SelectedValue == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Business Name field is required."; } else if (fromDateTextBox.Text.Trim() == "" || LumexLibraryManager.ParseAppDate(fromDateTextBox.Text.Trim()) == "False") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Date From field is required."; } else if (toDateTextBox.Text.Trim() == "" || LumexLibraryManager.ParseAppDate(toDateTextBox.Text.Trim()) == "False") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Date To field is required."; } else { string customerId = customerDropDownList.SelectedValue.Trim(); string fromDate = LumexLibraryManager.ParseAppDate(fromDateTextBox.Text.Trim()); string toDate = LumexLibraryManager.ParseAppDate(toDateTextBox.Text.Trim()); string status = statusDropDownList.SelectedValue; DataTable dt = customerBll.GetCustomerWisePaymentList(customerId, fromDate, toDate, status); customerPaymentListGridView.DataSource = dt; customerPaymentListGridView.DataBind(); if (customerPaymentListGridView.Rows.Count > 0) { customerPaymentListGridView.UseAccessibleHeader = true; customerPaymentListGridView.HeaderRow.TableSection = TableRowSection.TableHeader; } else { msgbox.Visible = true; msgTitleLabel.Text = "Data Not Found!!!"; msgDetailLabel.Text = ""; } } } catch (Exception ex) { msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { customerBll = null; } }