protected void Page_Load(object sender, EventArgs e) { this.storeBankingDetailId = Common.GetEncryptedQueryStringValue("storeBankingDetailId", 0); this.storeId = Common.GetEncryptedQueryStringValue("StoreId", 0); string storeName = Store.GetStoreByStoreId(this.storeId).Description; LabelPageTitle.Text = (this.storeBankingDetailId == 0) ? storeName + " - New Bank Account Details" : storeName + " - Edit Bank Account Details"; PanelError.Visible = false; Page.Form.DefaultFocus = DropDownListStoreBankAccountType.ClientID; Page.Form.DefaultButton = ButtonSaveList.UniqueID; if (!IsPostBack) { BindStoreBankAccountTypeList(); DropDownListStoreBankAccountType.Focus(); if (ViewState["storeBankingDetailId"] != null) { this.storeBankingDetailId = Convert.ToInt32(ViewState["storeBankingDetailId"].ToString()); } if (this.storeBankingDetailId != 0) { BindStoreBankingDetail(); } else { ButtonDelete.Visible = false; } } }
private void BindStoreBankAccountTypeList() { DropDownListStoreBankAccountType.DataSource = StoreBankAccountType.GetStoreBankAccountTypeList(); DropDownListStoreBankAccountType.DataTextField = "Description"; DropDownListStoreBankAccountType.DataValueField = "StoreBankAccountTypeId"; DropDownListStoreBankAccountType.DataBind(); if (DropDownListStoreBankAccountType.Items.Count > 1) { DropDownListStoreBankAccountType.Items.Insert(0, new ListItem("Please select", "0")); } }