protected void recordListButton_Click(object sender, EventArgs e) { SalesOrderBLL salesOrder = new SalesOrderBLL(); try { if (salesCenterDropDownList.SelectedValue == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Sales Center 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 salesCenterId = salesCenterDropDownList.SelectedValue.Trim(); string fromDate = LumexLibraryManager.ParseAppDate(fromDateTextBox.Text.Trim()); string toDate = LumexLibraryManager.ParseAppDate(toDateTextBox.Text.Trim()); string status = statusDropDownList.SelectedValue.Trim(); DataTable dt = new DataTable(); //if (chkatDropdownList.SelectedValue == "SC") //{ // dt= salesOrder.GetDamageRecordsListBySalesCenterDateRangeAndStatus(salesCenterId, fromDate, toDate, status); //} //else //{ dt=salesOrder.GetDamageRecordsListByWarehouseDateRangeAndStatus(salesCenterId, fromDate, toDate, status); damageRecordListGridView.DataSource = dt; damageRecordListGridView.DataBind(); if (damageRecordListGridView.Rows.Count > 0) { damageRecordListGridView.UseAccessibleHeader = true; damageRecordListGridView.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 { salesOrder = null; } }