protected void GetVendorById(string vendorId) { VendorBLL vendor = new VendorBLL(); try { DataTable dt = vendor.GetVendorById(vendorId); if (dt.Rows.Count > 0) { vendorNameLabel.Text = dt.Rows[0]["VendorName"].ToString(); countryLabel.Text = dt.Rows[0]["Country"].ToString(); cityLabel.Text = dt.Rows[0]["City"].ToString(); // districtLabel.Text = dt.Rows[0]["District"].ToString(); // postalCodeLabel.Text = dt.Rows[0]["PostalCode"].ToString(); phoneLabel.Text = dt.Rows[0]["Phone"].ToString(); // mobileLabel.Text = dt.Rows[0]["Mobile"].ToString(); // faxLabel.Text = dt.Rows[0]["Fax"].ToString(); emailLabel.Text = dt.Rows[0]["Email"].ToString(); addressLabel.Text = dt.Rows[0]["Address"].ToString(); } else { msgbox.Visible = true; msgTitleLabel.Text = "Vendor 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; } }
//protected void LoadSalesCenter() //{ // SalesCenterBLL warehouse = new SalesCenterBLL(); // try // { // DataTable dt = warehouse.GetActiveSalesCenterListByUser(); // salescenterDropDownList.DataSource = dt; // salescenterDropDownList.DataValueField = "SalesCenterId"; // salescenterDropDownList.DataTextField = "SalesCenterName"; // salescenterDropDownList.DataBind(); // salescenterDropDownList.Items.Insert(0, "For all Sales Center"); // // salescenterDropDownList.SelectedIndex = 0; // salescenterDropDownList.Items[0].Value = "A"; // // salescenterDropDownList.SelectedValue = LumexSessionManager.Get("UserSalesCenterId").ToString(); // } // catch (Exception ex) // { // string message = ex.Message; // if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } // MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); // } // finally // { // warehouse = null; // } //} protected void GetVendorById(string vendorId) { VendorBLL vendor = new VendorBLL(); try { DataTable dt = vendor.GetVendorById(vendorId); if (dt.Rows.Count > 0) { vendorNameForUpdateHiddenField.Value = vendorNameTextBox.Text = dt.Rows[0]["VendorName"].ToString(); countryTextBox.Text = dt.Rows[0]["Country"].ToString(); cityTextBox.Text = dt.Rows[0]["City"].ToString(); //districtTextBox.Text = dt.Rows[0]["District"].ToString(); // postalCodeTextBox.Text = dt.Rows[0]["PostalCode"].ToString(); phoneTextBox.Text = dt.Rows[0]["Phone"].ToString(); // mobileTextBox.Text = dt.Rows[0]["Mobile"].ToString(); // faxTextBox.Text = dt.Rows[0]["Fax"].ToString(); txtbxOwnerName.Text = dt.Rows[0]["OwnerName"].ToString(); txtbxOwnerCell.Text = dt.Rows[0]["OwnerCell"].ToString(); txtbxDescription.Text = dt.Rows[0]["Description"].ToString(); txtbxContactPersonDesignation.Text = dt.Rows[0]["ContactDesignation"].ToString(); txtbxContactPersonAddress.Text = dt.Rows[0]["ContactAddress"].ToString(); txtbxContactPerson.Text = dt.Rows[0]["ContactPerson"].ToString(); ListItem listItem = new ListItem(); listItem = warehouseDropDownList.Items.FindByValue(dt.Rows[0]["WareHouse"].ToString()); if (listItem != null) { warehouseDropDownList.SelectedValue = dt.Rows[0]["WareHouse"].ToString(); } else { warehouseDropDownList.Items.Insert(0, "Not Parmitted"); warehouseDropDownList.Items[0].Value = dt.Rows[0]["WareHouse"].ToString(); warehouseDropDownList.SelectedIndex = 0; warehouseDropDownList.Enabled = false; updateButton.Enabled = false; } emailTextBox.Text = dt.Rows[0]["Email"].ToString(); addressTextBox.Text = dt.Rows[0]["Address"].ToString(); } else { msgbox.Visible = true; msgTitleLabel.Text = "Vendor 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; } }