protected void LoadVendors() { VendorBLL vendor = new VendorBLL(); try { vendor.WarehouseId = warehouseDropDownList.SelectedValue; DataTable dt = vendor.GetVendorListByWareHouseId(); vendorDropDownList.DataSource = dt; vendorDropDownList.DataValueField = "VendorId"; vendorDropDownList.DataTextField = "VendorName"; vendorDropDownList.DataBind(); vendorDropDownList.Items.Insert(0, ""); vendorDropDownList.SelectedIndex = 0; } catch (Exception ex) { msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { vendor = null; } }
protected void GetVendorList() { VendorBLL vendor = new VendorBLL(); try { vendor.WarehouseId = warehouseDropDownList.SelectedValue; DataTable dt = vendor.GetVendorListByWareHouseId(); vendorListGridView.DataSource = dt; vendorListGridView.DataBind(); if (vendorListGridView.Rows.Count > 0) { vendorListGridView.UseAccessibleHeader = true; vendorListGridView.HeaderRow.TableSection = TableRowSection.TableHeader; } else { msgbox.Visible = true; msgTitleLabel.Text = "Vendor List Data Not Found!!!"; msgDetailLabel.Text = ""; msgbox.Attributes.Add("class", "alert alert-warning"); } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { vendor = null; } }