protected void btnUpdateBank_Click(object sender, EventArgs e) { try { BankInfoEntity.BankDetailID = Convert.ToInt32(ViewState["BankDetailID"]); BankInfoEntity.Type = 1; BankInfoEntity.SAID = ViewState["ReferenceSAID"].ToString(); BankInfoEntity.ReferenceID = ViewState["ReferenceSAID"].ToString(); BankInfoEntity.UIC = "0"; BankInfoEntity.BankName = txtBankName.Text; BankInfoEntity.BranchNumber = txtBranchNumber.Text; BankInfoEntity.AccountNumber = txtAccountNumber.Text; BankInfoEntity.AccountType = Convert.ToInt32(ddlAccountType.SelectedValue); BankInfoEntity.Currency = txtCurrency.Text; BankInfoEntity.SWIFT = txtSwift.Text; BankInfoEntity.CreatedBy = 0; BankInfoEntity.AdvisorID = 0; BankInfoEntity.UpdatedBy = 0; int result = bankbl.CURDBankInfo(BankInfoEntity, 'u'); if (result == 1) { lblTitle.Text = "Thank You!"; lblTitle.ForeColor = System.Drawing.Color.Green; message.Text = "Bank details updated successfully!"; message.ForeColor = System.Drawing.Color.Green; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); ClearBank(); GetBankDetails(); } else { lblTitle.Text = "Warning!"; lblTitle.ForeColor = System.Drawing.Color.Red; message.ForeColor = System.Drawing.Color.Red; message.Text = "Sorry, Please try again!"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); ClearBank(); GetBankDetails(); } } catch { lblTitle.Text = "Warning!"; lblTitle.ForeColor = System.Drawing.Color.Red; message.ForeColor = System.Drawing.Color.Red; message.Text = "Sorry, Something went wrong, please contact administrator"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); } }