private void BindInsightSupplier() { try { InsightSupplier insightSupplier = InsightSupplier.GetInsightSupplierByInsightSupplierId(Convert.ToInt32(ViewState["InsightSupplierId"])); TextBoxSupplierName.Text = insightSupplier.SupplierName; TextBoxCustomSupplierId.Text = InsightSupplierMerchandising.GetCustomSupplierByInsightSupplierId(Convert.ToInt32(ViewState["InsightSupplierId"])).CustomSupplierId; DropDownListModelType.ClearSelection(); DropDownListModelType.Items.FindByValue(insightSupplier.ModelTypeId.ToString()).Selected = true; BindModelTypeSecurity(); CloseSupplierAuthorization(); } catch (System.Data.SqlClient.SqlException sqlEx) { for (int i = 0; i < sqlEx.Errors.Count; i++) { LabelError.Text += (sqlEx.Errors[i].Message + "<br />"); } PanelError.Visible = true; } catch (Exception exception) { LabelError.Text += (exception.Message + "<br />"); PanelError.Visible = true; } }
private void BindModelType() { DropDownListModelType.DataSource = SPARInsightManagement.Web.Code.ModelType.GetModelTypeList(); DropDownListModelType.DataTextField = "Description"; DropDownListModelType.DataValueField = "ModelTypeId"; DropDownListModelType.DataBind(); if (DropDownListModelType.Items.Count > 1) { DropDownListModelType.Items.Insert(0, new ListItem("Please select", "0")); } }