/// <summary>
        /// Gets All the Details of a Bank Account beloging to a Customer
        /// </summary>
        /// <param name="customerId">CustomerId of the customer who holds the Bank Account</param>
        /// <param name="customerBankAccId">Bank Account Id of the Bank Account to be retrieved</param>
        /// <returns>Returns Object holding Bank Details</returns>
        public CustomerBankAccountVo GetCustomerBankAccount(int customerId, int customerBankAccId)
        {
            CustomerBankAccountVo  customerBankAccountVo  = new CustomerBankAccountVo();
            CustomerBankAccountDao customerBankAccountDao = new CustomerBankAccountDao();

            try
            {
                customerBankAccountVo = customerBankAccountDao.GetCusomerBankAccount(customerId, customerBankAccId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountBo.cs:GetCusomerBankAccount()");


                object[] objects = new object[2];
                objects[0] = customerId;
                objects[1] = customerBankAccId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(customerBankAccountVo);
        }
        /// <summary>
        /// Method to Edit the Bank Account Details
        /// </summary>
        /// <param name="customerBankAccountVo">Object holding all the details of the Bank Account to be created.</param>
        /// <param name="customerId">CustomerId of the customer whose Bank Account the method Edits</param>
        /// <returns>Returns a boolean Variable stating if the Method is successful</returns>
        public bool UpdateCustomerBankAccount(CustomerBankAccountVo customerBankAccountVo, int customerId)
        {
            bool bResult = false;
            CustomerBankAccountDao customerBankAccountDao = new CustomerBankAccountDao();

            try
            {
                bResult = customerBankAccountDao.UpdateCustomerBankAccount(customerBankAccountVo, customerId);
                bResult = true;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountBo.cs:EditCustomerBankAccount()");


                object[] objects = new object[2];
                objects[0] = customerId;
                objects[1] = customerBankAccountVo;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(bResult);
        }
        public bool UpdateCustomerBankAccount(CustomerBankAccountVo customerBankAccountVo, int customerId)
        {
            bool      bResult = false;
            Database  db;
            DbCommand updateCustomerBankCmd;

            //string query = "update CustomerBankAccount set CB_CustBankAccId='" + customerBankAccountVo.CustBankAccId + "',CB_BankName='" + customerBankAccountVo.BankName + "',CB_AccountType='" + customerBankAccountVo.AccountType + "',CB_AccountNum='" + customerBankAccountVo.AccountNum + "',CB_ModeOfOperation='" + customerBankAccountVo.ModeOfOperation + "',CB_BranchName='" + customerBankAccountVo.BankName + "',CB_BranchAdrLine1='" + customerBankAccountVo.BranchAdrLine1 + "',CB_BranchAdrLine2='" + customerBankAccountVo.BranchAdrLine2 + "',CB_BranchAdrLine3='" + customerBankAccountVo.BranchAdrLine3 + "',CB_BranchAdrPinCode='" + customerBankAccountVo.BranchAdrPinCode + "',CB_BranchAdrCity='" + customerBankAccountVo.BranchAdrCity + "',CB_BranchAdrState='" + customerBankAccountVo.BranchAdrState + "',CB_BranchAdrCountry='" + customerBankAccountVo.BranchAdrCountry + "',CB_MICR='" + customerBankAccountVo.MICR + "',CB_IFSC='" + customerBankAccountVo.IFSC + "'where C_CustomerId='" + customerId + "'";

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                updateCustomerBankCmd = db.GetStoredProcCommand("SP_UpdateCustomerBankAccount");


                db.AddInParameter(updateCustomerBankCmd, "@CB_CustBankAccId", DbType.Int32, customerBankAccountVo.CustBankAccId);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BankName", DbType.String, customerBankAccountVo.BankName);
                db.AddInParameter(updateCustomerBankCmd, "@XBAT_BankAccountTypeCode", DbType.String, customerBankAccountVo.AccountType);
                db.AddInParameter(updateCustomerBankCmd, "@CB_AccountNum", DbType.String, customerBankAccountVo.AccountNum);
                db.AddInParameter(updateCustomerBankCmd, "@XMOH_ModeOfHoldingCode", DbType.String, customerBankAccountVo.ModeOfOperation);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchName", DbType.String, customerBankAccountVo.BankName);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrLine1", DbType.String, customerBankAccountVo.BranchAdrLine1);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrLine2", DbType.String, customerBankAccountVo.BranchAdrLine2);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrLine3", DbType.String, customerBankAccountVo.BranchAdrLine3);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrPinCode", DbType.String, customerBankAccountVo.BranchAdrPinCode);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrCity", DbType.String, customerBankAccountVo.BranchAdrCity);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrState", DbType.String, customerBankAccountVo.BranchAdrState);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrCountry", DbType.String, customerBankAccountVo.BranchAdrCountry);
                db.AddInParameter(updateCustomerBankCmd, "@CB_Balance", DbType.Decimal, customerBankAccountVo.Balance);
                db.AddInParameter(updateCustomerBankCmd, "@CB_MICR", DbType.Int64, customerBankAccountVo.MICR);
                db.AddInParameter(updateCustomerBankCmd, "@CB_IFSC", DbType.String, customerBankAccountVo.IFSC);
                db.AddInParameter(updateCustomerBankCmd, "@C_CustomerId", DbType.Int32, customerId);
                db.ExecuteNonQuery(updateCustomerBankCmd);

                bResult = true;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountDao.cs:UpdateCustomerBankAccount()");


                object[] objects = new object[2];
                objects[0] = customerId;
                objects[1] = customerBankAccountVo;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(bResult);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                BindSatesToDP(path);
            }

            try
            {
                SessionBo.CheckSession();
                customerVo            = (CustomerVo)Session["customerVo"];
                customerId            = customerVo.CustomerId;
                customerBankAccId     = int.Parse(Session["CustBankAccId"].ToString());
                customerBankAccountVo = customerBankAccountBo.GetCustomerBankAccount(customerId, customerBankAccId);

                txtAccountNumber.Text        = customerBankAccountVo.BankAccountNum.ToString();
                ddlAccountType.SelectedValue = customerBankAccountVo.AccountType;
                if (customerBankAccountVo.ModeOfOperation != null && customerBankAccountVo.ModeOfOperation != "")
                {
                    ddlModeOfOperation.SelectedValue = customerBankAccountVo.ModeOfOperation;
                }
                txtBankName.Text       = customerBankAccountVo.BankName.ToString();
                txtBranchName.Text     = customerBankAccountVo.BranchName.ToString();
                txtBankAdrLine1.Text   = customerBankAccountVo.BranchAdrLine1.ToString();
                txtBankAdrLine2.Text   = customerBankAccountVo.BranchAdrLine2.ToString();
                txtBankAdrLine3.Text   = customerBankAccountVo.BranchAdrLine3.ToString();
                txtBankAdrPinCode.Text = customerBankAccountVo.BranchAdrPinCode.ToString();
                txtBankAdrCity.Text    = customerBankAccountVo.BranchAdrCity.ToString();
                txtIfsc.Text           = customerBankAccountVo.IFSC.ToString();
                txtMicr.Text           = customerBankAccountVo.MICR.ToString();
                if (customerBankAccountVo.BranchAdrState != null && customerBankAccountVo.BranchAdrState != "")
                {
                    ddlBankAdrState.SelectedValue = customerBankAccountVo.BranchAdrState;
                }
                //ddlBankAdrState.SelectedValue = customerBankAccountVo.BranchAdrState;
                ddlBankAdrCountry.SelectedValue = customerBankAccountVo.BranchAdrCountry;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "EditCustomerBankAccount.ascx:Page_Load()");
                object[] objects = new object[3];
                objects[0]   = customerBankAccountVo;
                objects[1]   = customerId;
                objects[2]   = customerBankAccId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        public CustomerBankAccountVo GetCusomerIndBankAccount(int customerBankAccId)
        {
            CustomerBankAccountDao customerBankAccountDao = new CustomerBankAccountDao();
            CustomerBankAccountVo  customerBankAccountVo  = new CustomerBankAccountVo();

            try
            {
                //  userVo = userDao.Getselectlist();
                customerBankAccountVo = customerBankAccountDao.GetCusomerIndBankAccount(customerBankAccId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            return(customerBankAccountVo);
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                customerId            = int.Parse(Session["CustomerId"].ToString());
                customerBankAccId     = int.Parse(Session["CustBankAccId"].ToString());
                customerBankAccountVo = customerBankAccountBo.GetCustomerBankAccount(customerId, customerBankAccId);

                txtAccountNumber.Text            = customerBankAccountVo.AccountNum.ToString();
                ddlAccountType.SelectedValue     = customerBankAccountVo.AccountType;
                ddlModeOfOperation.SelectedValue = customerBankAccountVo.ModeOfOperation;
                txtBankName.Text                = customerBankAccountVo.BankName.ToString();
                txtBranchName.Text              = customerBankAccountVo.BranchName.ToString();
                txtBankAdrLine1.Text            = customerBankAccountVo.BranchAdrLine1.ToString();
                txtBankAdrLine2.Text            = customerBankAccountVo.BranchAdrLine2.ToString();
                txtBankAdrLine3.Text            = customerBankAccountVo.BranchAdrLine3.ToString();
                txtBankAdrPinCode.Text          = customerBankAccountVo.BranchAdrPinCode.ToString();
                txtBankAdrCity.Text             = customerBankAccountVo.BranchAdrCity.ToString();
                txtIfsc.Text                    = customerBankAccountVo.IFSC.ToString();
                txtMicr.Text                    = customerBankAccountVo.MICR.ToString();
                ddlBankAdrState.SelectedValue   = customerBankAccountVo.BranchAdrState;
                ddlBankAdrCountry.SelectedValue = customerBankAccountVo.BranchAdrCountry;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewAllBankDetails.ascx:Page_Load()");
                object[] objects = new object[3];
                objects[0]   = customerBankAccountVo;
                objects[1]   = customerBankAccId;
                objects[2]   = customerId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        /// <summary>
        /// Method for Creating a Bank Account for the Customer.
        /// </summary>
        /// <param name="customerBankAccountVo">Object holding all the details of the Bank Account to be created.</param>
        /// <param name="customerId">CustomerId of the customer whose Bank Account the method Creates</param>
        /// <param name="userId">UserId of the user who is creating the Bank Account for the Customer</param>
        /// <returns>Returns a boolean Variable stating if the Method is successful</returns>
        public int CreateCustomerBankAccount(CustomerBankAccountVo customerBankAccountVo, int customerId, int userId)
        {
            int accountId;
            CustomerBankAccountDao customerBankAccountDao = new CustomerBankAccountDao();

            try
            {
                accountId = customerBankAccountDao.CreateCustomerBankAccount(customerBankAccountVo, customerId, userId);
                // bResult=true;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountBo.cs:CreateCustomerBankAccount()");


                object[] objects = new object[3];
                objects[0] = customerBankAccountVo;
                objects[1] = customerId;
                objects[2] = userId;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(accountId);
        }
        public List <CustomerBankAccountVo> GetCustomerBankAccounts(int customerId)
        {
            List <CustomerBankAccountVo> accountList = null;
            CustomerBankAccountVo        customerBankAccountVo;
            Database  db;
            DataSet   getCustomerBankDs;
            DbCommand getCustomerBankCmd;

            //string query = "select * from CustomerBankAccount where C_CustomerId=" + customerId.ToString() + "and CB_CustBankAccId=" + customerBankAccId.ToString();
            try
            {
                db                 = DatabaseFactory.CreateDatabase("wealtherp");
                accountList        = new List <CustomerBankAccountVo>();
                getCustomerBankCmd = db.GetStoredProcCommand("SP_GetCustomerBankAccounts");
                db.AddInParameter(getCustomerBankCmd, "@C_CustomerId", DbType.Int32, customerId);
                getCustomerBankDs = db.ExecuteDataSet(getCustomerBankCmd);
                if (getCustomerBankDs.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in getCustomerBankDs.Tables[0].Rows)
                    {
                        customerBankAccountVo = new CustomerBankAccountVo();
                        customerBankAccountVo.CustBankAccId   = int.Parse(dr["CB_CustBankAccId"].ToString());
                        customerBankAccountVo.BankName        = dr["CB_BankName"].ToString();
                        customerBankAccountVo.AccountType     = dr["XBAT_BankAccountTye"].ToString();
                        customerBankAccountVo.AccountNum      = dr["CB_AccountNum"].ToString();
                        customerBankAccountVo.ModeOfOperation = dr["XMOH_ModeOfHolding"].ToString();
                        customerBankAccountVo.BranchName      = dr["CB_BranchName"].ToString();
                        ////customerBankAccountVo.BranchAdrLine1 = dr["CB_BranchAdrLine1"].ToString();
                        ////customerBankAccountVo.BranchAdrLine2 = dr["CB_BranchAdrLine2"].ToString();
                        ////customerBankAccountVo.BranchAdrLine3 = dr["CB_BranchAdrLine3"].ToString();
                        ////customerBankAccountVo.BranchAdrPinCode = int.Parse(dr["CB_BranchAdrPinCode"].ToString());
                        ////customerBankAccountVo.BranchAdrCity = dr["CB_BranchAdrCity"].ToString();
                        ////customerBankAccountVo.BranchAdrState = dr["CB_BranchAdrState"].ToString();
                        ////customerBankAccountVo.BranchAdrCountry = dr["CB_BranchAdrCountry"].ToString();
                        ////customerBankAccountVo.Balance = float.Parse(dr["CB_Balance"].ToString());
                        ////customerBankAccountVo.MICR = long.Parse(dr["CB_MICR"].ToString());
                        ////customerBankAccountVo.IFSC = dr["CB_IFSC"].ToString();
                        accountList.Add(customerBankAccountVo);
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountDao.cs:GetCustomerBankAccounts()");


                object[] objects = new object[1];
                objects[0] = customerId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(accountList);
        }
Example #9
0
        /// <summary>
        /// Function to bind the Details to the Bank Grid
        /// </summary>
        public void BindBankDetails()
        {
            try
            {
                customerBankAccountList = customerBankAccountBo.GetCustomerBankAccounts(customerId);
                if (customerBankAccountList.Count != 0)
                {
                    DataTable dtCustomerBankAccounts = new DataTable();
                    //dtCustomerBankAccounts.Columns.Add("CustBankAccId");
                    dtCustomerBankAccounts.Columns.Add("Bank Name");
                    //dtCustomerBankAccounts.Columns.Add("Branch Name");
                    dtCustomerBankAccounts.Columns.Add("Account Type");
                    //dtCustomerBankAccounts.Columns.Add("Mode Of Operation");
                    dtCustomerBankAccounts.Columns.Add("Account Number");


                    DataRow drCustomerBankAccount;
                    for (int i = 0; i < customerBankAccountList.Count; i++)
                    {
                        drCustomerBankAccount = dtCustomerBankAccounts.NewRow();
                        customerBankAccountVo = new CustomerBankAccountVo();
                        customerBankAccountVo = customerBankAccountList[i];
                        //drCustomerBankAccount[0] = customerBankAccountVo.CustBankAccId.ToString();
                        drCustomerBankAccount[0] = customerBankAccountVo.BankName.ToString();
                        //drCustomerBankAccount[2] = customerBankAccountVo.BranchName.ToString();
                        drCustomerBankAccount[1] = customerBankAccountVo.AccountType.ToString();
                        //drCustomerBankAccount[4] = customerBankAccountVo.ModeOfOperation.ToString();
                        drCustomerBankAccount[2] = customerBankAccountVo.AccountNum.ToString();

                        dtCustomerBankAccounts.Rows.Add(drCustomerBankAccount);
                    }

                    gvBankDetails.DataSource = dtCustomerBankAccounts;
                    gvBankDetails.DataBind();
                    gvBankDetails.Visible = true;
                }
                else
                {
                    gvBankDetails.Visible      = false;
                    lblBankDetailsMsg.Visible  = true;
                    lnkMoreBankDetails.Visible = false;
                    gvBankDetails.DataSource   = null;
                    gvBankDetails.DataBind();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "RMCustIndividualDashboard.ascx:BindBankDetails()");

                object[] objects = new object[0];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());

                customerVo = (CustomerVo)Session["CustomerVo"];
                customerId = customerVo.CustomerId;

                customerBankAccId     = int.Parse(Session["CustBankAccId"].ToString());
                customerBankAccountVo = customerBankAccountBo.GetCustomerBankAccount(customerId, customerBankAccId);

                lblAccNum.Text = customerBankAccountVo.BankAccountNum.ToString();
                //lblAccType.Text = customerBankAccountVo.AccountType;
                if (customerBankAccountVo.AccountType == "CC")
                {
                    lblAccType.Text = "C.C.";
                }
                if (customerBankAccountVo.AccountType == "CR")
                {
                    lblAccType.Text = "Current";
                }
                if (customerBankAccountVo.AccountType == "FR")
                {
                    lblAccType.Text = "F.C.N.R.";
                }
                if (customerBankAccountVo.AccountType == "NE")
                {
                    lblAccType.Text = "NRE";
                }
                if (customerBankAccountVo.AccountType == "NO")
                {
                    lblAccType.Text = "NRO";
                }
                if (customerBankAccountVo.AccountType == "OD")
                {
                    lblAccType.Text = "O.D.";
                }
                if (customerBankAccountVo.AccountType == "SV")
                {
                    lblAccType.Text = "Savings";
                }
                if (customerBankAccountVo.AccountType == "OT")
                {
                    lblAccType.Text = "Other";
                }
                if (customerBankAccountVo.AccountType == "TBC")
                {
                    lblAccType.Text = "To Be Categorized";
                }
                //lblAccType.Text = XMLBo.GetBankAccountTypes(path, customerBankAccountVo.AccountType);
                if (customerBankAccountVo.ModeOfOperation == "SO")
                {
                    lblModeOfOperation.Text = "Self Only";
                }
                if (customerBankAccountVo.ModeOfOperation == "SI")
                {
                    lblModeOfOperation.Text = "Singly";
                }
                if (customerBankAccountVo.ModeOfOperation == "SE")
                {
                    lblModeOfOperation.Text = "Severaly";
                }
                if (customerBankAccountVo.ModeOfOperation == "JO")
                {
                    lblModeOfOperation.Text = "Jointly";
                }
                if (customerBankAccountVo.ModeOfOperation == "AS")
                {
                    lblModeOfOperation.Text = "Anyone or Survivor";
                }
                if (customerBankAccountVo.ModeOfOperation == "BR")
                {
                    lblModeOfOperation.Text = "As per Board Resolution";
                }
                if (customerBankAccountVo.ModeOfOperation == "ES")
                {
                    lblModeOfOperation.Text = "Either or Survivor";
                }
                if (customerBankAccountVo.ModeOfOperation == "FS")
                {
                    lblModeOfOperation.Text = "Former or Survivor";
                }
                if (customerBankAccountVo.ModeOfOperation == "TBC")
                {
                    lblModeOfOperation.Text = "To Be Categorized";
                }
                //lblModeOfOperation.Text = customerBankAccountVo.ModeOfOperation;
                lblBankName.Text   = customerBankAccountVo.BankName.ToString();
                lblBranchName.Text = customerBankAccountVo.BranchName.ToString();
                lblLine1.Text      = customerBankAccountVo.BranchAdrLine1.ToString();
                lblLine2.Text      = customerBankAccountVo.BranchAdrLine2.ToString();
                lblLine3.Text      = customerBankAccountVo.BranchAdrLine3.ToString();
                lblPinCode.Text    = customerBankAccountVo.BranchAdrPinCode.ToString();
                lblCity.Text       = customerBankAccountVo.BranchAdrCity.ToString();
                lblIfsc.Text       = customerBankAccountVo.IFSC.ToString();
                lblMicr.Text       = customerBankAccountVo.MICR.ToString();
                state           = XMLBo.GetStateName(path, customerBankAccountVo.BranchAdrState);
                lblState.Text   = state;
                lblCountry.Text = customerBankAccountVo.BranchAdrCountry;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewCustomerAllBankDetails.ascx:PageLoad()");
                object[] objects = new object[3];
                objects[0]   = customerBankAccId;
                objects[1]   = customerBankAccountVo;
                objects[2]   = customerId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        public CustomerBankAccountVo GetCusomerIndBankAccount(int customerBankAccId)
        {
            CustomerBankAccountVo customerBankAccountVo = null;
            Database  db;
            DataSet   getCustomerBankDs;
            DbCommand getCustomerBankAccCmd;
            DataRow   dr;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getCustomerBankAccCmd = db.GetStoredProcCommand("SP_GetCustomerIndividualBankAccounts");
                db.AddInParameter(getCustomerBankAccCmd, "@CB_CustBankAccId", DbType.Int32, customerBankAccId);
                getCustomerBankDs = db.ExecuteDataSet(getCustomerBankAccCmd);

                if (getCustomerBankDs.Tables[0].Rows.Count > 0)
                {
                    customerBankAccountVo = new CustomerBankAccountVo();
                    dr = getCustomerBankDs.Tables[0].Rows[0];
                    if (dr["CB_CustBankAccId"].ToString() != "")
                    {
                        customerBankAccountVo.CustBankAccId = int.Parse(dr["CB_CustBankAccId"].ToString());
                    }
                    if (dr["CP_PortfolioId"].ToString() != "")
                    {
                        customerBankAccountVo.PortfolioId = int.Parse(dr["CP_PortfolioId"].ToString());
                    }
                    //customerBankAccountVo.BankName = dr["WERPBM_BankCode"].ToString();
                    //if (dr["XBAT_BankAccountTypeCode"].ToString() == "SB")
                    //{

                    //    customerBankAccountVo.AccountType = "SV";
                    //}
                    //else
                    //customerBankAccountVo.AccountType = dr["PAIC_AssetInstrumentCategoryCode"].ToString();
                    //customerBankAccountVo.AccountTypeCode = dr["PAIC_AssetInstrumentCategoryCode"].ToString();
                    customerBankAccountVo.BankAccountNum      = dr["CB_AccountNum"].ToString();
                    customerBankAccountVo.ModeOfOperation     = dr["XMOH_ModeOfHoldingCode"].ToString();
                    customerBankAccountVo.ModeOfOperationCode = dr["XMOH_ModeOfHolding"].ToString();
                    customerBankAccountVo.BranchName          = dr["CB_BranchName"].ToString();
                    customerBankAccountVo.BankCity            = dr["CB_BankCity"].ToString();
                    if (dr["CB_IsHeldJointly"].ToString() != "")
                    {
                        customerBankAccountVo.IsJointHolding = int.Parse(dr["CB_IsHeldJointly"].ToString());
                    }
                    customerBankAccountVo.BranchAdrLine1 = dr["CB_BranchAdrLine1"].ToString();
                    customerBankAccountVo.BranchAdrLine2 = dr["CB_BranchAdrLine2"].ToString();
                    customerBankAccountVo.BranchAdrLine3 = dr["CB_BranchAdrLine3"].ToString();
                    if (dr["CB_BranchAdrPinCode"].ToString() != "")
                    {
                        customerBankAccountVo.BranchAdrPinCode = int.Parse(dr["CB_BranchAdrPinCode"].ToString());
                    }
                    customerBankAccountVo.RTGSCode = dr["CB_RTGS"].ToString();
                    customerBankAccountVo.NeftCode = dr["CB_NEFT"].ToString();
                    //customerBankAccountVo.BranchAdrCity = dr["CB_BranchAdrCity"].ToString();
                    //customerBankAccountVo.BranchAdrState = dr["CB_BranchAdrState"].ToString();
                    //customerBankAccountVo.BranchAdrCountry = dr["CB_BranchAdrCountry"].ToString();

                    if (dr["CB_Balance"].ToString() != "")
                    {
                        customerBankAccountVo.Balance = float.Parse(dr["CB_Balance"].ToString());
                    }
                    //if (dr["CB_MICR"].ToString() != "")
                    customerBankAccountVo.MICR = dr["CB_MICR"].ToString();
                    customerBankAccountVo.IFSC = dr["CB_IFSC"].ToString();

                    if (!string.IsNullOrEmpty(dr["WCMV_BankName"].ToString()))
                    {
                        customerBankAccountVo.BankName = dr["WCMV_BankName"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["WCMV_LookupId_BankId"].ToString()))
                    {
                        customerBankAccountVo.BankId = int.Parse(dr["WCMV_LookupId_BankId"].ToString());
                    }

                    if (!string.IsNullOrEmpty(dr["WCMV_LookupId_AccType"].ToString()))
                    {
                        customerBankAccountVo.BankAccTypeId = int.Parse(dr["WCMV_LookupId_AccType"].ToString());
                    }


                    if (!string.IsNullOrEmpty(dr["WCMV_Lookup_BranchAddCityId"].ToString()))
                    {
                        customerBankAccountVo.BranchAddCityId = int.Parse(dr["WCMV_Lookup_BranchAddCityId"].ToString());
                    }
                    if (!string.IsNullOrEmpty(dr["WCMV_Lookup_BranchAddStateId"].ToString()))
                    {
                        customerBankAccountVo.BranchAddStateId = int.Parse(dr["WCMV_Lookup_BranchAddStateId"].ToString());
                    }
                    if (!string.IsNullOrEmpty(dr["WCMV_Lookup_BranchAddCountryId"].ToString()))
                    {
                        customerBankAccountVo.BranchAddCountryId = int.Parse(dr["WCMV_Lookup_BranchAddCountryId"].ToString());
                    }
                    if (!string.IsNullOrEmpty(dr["CB_BankBranchCode"].ToString()))
                    {
                        customerBankAccountVo.BankBranchCode = dr["CB_BankBranchCode"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["CB_IsCurrent"].ToString()))
                    {
                        customerBankAccountVo.IsCurrent = Convert.ToBoolean(dr["CB_IsCurrent"]);
                    }
                }
            }

            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountDao.cs:GetCusomerBankAccount()");
                object[] objects = new object[2];
                objects[0]   = customerBankAccId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(customerBankAccountVo);
        }
        public bool UpdateCustomerBankAccount(CustomerBankAccountVo customerBankAccountVo, int customerId)
        {
            bool      bResult = false;
            Database  db;
            DbCommand updateCustomerBankCmd;

            //string query = "update CustomerBankAccount set CB_CustBankAccId='" + customerBankAccountVo.CustBankAccId + "',CB_BankName='" + customerBankAccountVo.BankName + "',CB_AccountType='" + customerBankAccountVo.AccountType + "',CB_AccountNum='" + customerBankAccountVo.AccountNum + "',CB_ModeOfOperation='" + customerBankAccountVo.ModeOfOperation + "',CB_BranchName='" + customerBankAccountVo.BankName + "',CB_BranchAdrLine1='" + customerBankAccountVo.BranchAdrLine1 + "',CB_BranchAdrLine2='" + customerBankAccountVo.BranchAdrLine2 + "',CB_BranchAdrLine3='" + customerBankAccountVo.BranchAdrLine3 + "',CB_BranchAdrPinCode='" + customerBankAccountVo.BranchAdrPinCode + "',CB_BranchAdrCity='" + customerBankAccountVo.BranchAdrCity + "',CB_BranchAdrState='" + customerBankAccountVo.BranchAdrState + "',CB_BranchAdrCountry='" + customerBankAccountVo.BranchAdrCountry + "',CB_MICR='" + customerBankAccountVo.MICR + "',CB_IFSC='" + customerBankAccountVo.IFSC + "'where C_CustomerId='" + customerId + "'";

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                updateCustomerBankCmd = db.GetStoredProcCommand("SP_UpdateCustomerBankAccount");
                db.AddInParameter(updateCustomerBankCmd, "@CB_CustBankAccId", DbType.Int32, customerBankAccountVo.CustBankAccId);
                //db.AddInParameter(updateCustomerBankCmd, "@WERPBM_BankCode", DbType.String, customerBankAccountVo.BankName);
                //db.AddInParameter(updateCustomerBankCmd, "@PAIC_AssetInstrumentCategoryCode", DbType.String, customerBankAccountVo.AccountType);
                db.AddInParameter(updateCustomerBankCmd, "@CB_AccountNum", DbType.String, customerBankAccountVo.BankAccountNum);
                db.AddInParameter(updateCustomerBankCmd, "@CB_IsHeldJointly", DbType.Int32, customerBankAccountVo.IsJointHolding);
                db.AddInParameter(updateCustomerBankCmd, "@XMOH_ModeOfHoldingCode", DbType.String, customerBankAccountVo.ModeOfOperation);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BankCity", DbType.String, customerBankAccountVo.BankCity);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchName", DbType.String, customerBankAccountVo.BranchName);
                //if (!string.IsNullOrEmpty(customerBankAccountVo.BranchAdrLine1))
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrLine1", DbType.String, customerBankAccountVo.BranchAdrLine1);
                // if (!string.IsNullOrEmpty(customerBankAccountVo.BranchAdrLine2))
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrLine2", DbType.String, customerBankAccountVo.BranchAdrLine2);
                // if (!string.IsNullOrEmpty(customerBankAccountVo.BranchAdrLine3))
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrLine3", DbType.String, customerBankAccountVo.BranchAdrLine3);
                db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrPinCode", DbType.Int64, customerBankAccountVo.BranchAdrPinCode);
                //if (!string.IsNullOrEmpty(customerBankAccountVo.BranchAdrCity))
                //db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrCity", DbType.String, customerBankAccountVo.BranchAdrCity);
                // if (!string.IsNullOrEmpty(customerBankAccountVo.BranchAdrState))
                //db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrState", DbType.String, customerBankAccountVo.BranchAdrState);
                //if (!string.IsNullOrEmpty(customerBankAccountVo.BranchAdrCountry))
                //db.AddInParameter(updateCustomerBankCmd, "@CB_BranchAdrCountry", DbType.String, customerBankAccountVo.BranchAdrCountry);
                db.AddInParameter(updateCustomerBankCmd, "@CB_Balance", DbType.Decimal, customerBankAccountVo.Balance);
                db.AddInParameter(updateCustomerBankCmd, "@CB_MICR", DbType.String, customerBankAccountVo.MICR);
                // if (!string.IsNullOrEmpty(customerBankAccountVo.IFSC))
                db.AddInParameter(updateCustomerBankCmd, "@CB_RTGS", DbType.String, customerBankAccountVo.RTGSCode);
                db.AddInParameter(updateCustomerBankCmd, "@CB_NEFT", DbType.String, customerBankAccountVo.NeftCode);

                db.AddInParameter(updateCustomerBankCmd, "@CB_IFSC", DbType.String, customerBankAccountVo.IFSC);
                db.AddInParameter(updateCustomerBankCmd, "@C_CustomerId", DbType.Int32, customerId);

                db.AddInParameter(updateCustomerBankCmd, "@WCMV_LookupId_BankId", DbType.Int32, customerBankAccountVo.BankId);
                db.AddInParameter(updateCustomerBankCmd, "@WCMV_LookupId_AccType", DbType.Int32, customerBankAccountVo.BankAccTypeId);

                if (customerBankAccountVo.BranchAddCityId != 0)
                {
                    db.AddInParameter(updateCustomerBankCmd, "@WCMV_Lookup_BranchAddCityId", DbType.Int32, customerBankAccountVo.BranchAddCityId);
                }

                if (customerBankAccountVo.BranchAddStateId != 0)
                {
                    db.AddInParameter(updateCustomerBankCmd, "@WCMV_Lookup_BranchAddStateId", DbType.Int32, customerBankAccountVo.BranchAddStateId);
                }

                if (customerBankAccountVo.BranchAddCountryId != 0)
                {
                    db.AddInParameter(updateCustomerBankCmd, "@WCMV_Lookup_BranchAddCountryId", DbType.Int32, customerBankAccountVo.BranchAddCountryId);
                }
                db.AddInParameter(updateCustomerBankCmd, "@CB_IsCurrent", DbType.Int32, Convert.ToInt32(customerBankAccountVo.IsCurrent));
                db.AddInParameter(updateCustomerBankCmd, "@CB_BankBranchCode", DbType.String, customerBankAccountVo.BankBranchCode);
                db.ExecuteNonQuery(updateCustomerBankCmd);

                bResult = true;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountDao.cs:UpdateCustomerBankAccount()");


                object[] objects = new object[2];
                objects[0] = customerId;
                objects[1] = customerBankAccountVo;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(bResult);
        }
        public CustomerBankAccountVo GetCusomerBankAccount(int customerId, int customerBankAccId)
        {
            CustomerBankAccountVo customerBankAccountVo = null;
            Database  db;
            DataSet   getCustomerBankDs;
            DbCommand getCustomerBankAccCmd;
            DataRow   dr;
            string    query = "select * from CustomerBank a INNER JOIN WERPBankDataTransalationMapping b ON a.WERPBM_BankCode = b.WERPBM_BankCode where C_CustomerId=" + customerId + "and CB_CustBankAccId=" + customerBankAccId;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getCustomerBankAccCmd = db.GetSqlStringCommand(query);
                db.AddInParameter(getCustomerBankAccCmd, "@C_CustomerId", DbType.Int32, customerId);
                db.AddInParameter(getCustomerBankAccCmd, "@CB_CustBankAccId", DbType.Int32, customerBankAccId);
                getCustomerBankDs = db.ExecuteDataSet(getCustomerBankAccCmd);

                if (getCustomerBankDs.Tables[0].Rows.Count > 0)
                {
                    customerBankAccountVo = new CustomerBankAccountVo();
                    dr = getCustomerBankDs.Tables[0].Rows[0];

                    if (dr["CB_CustBankAccId"].ToString() != "")
                    {
                        customerBankAccountVo.CustBankAccId = int.Parse(dr["CB_CustBankAccId"].ToString());
                    }
                    customerBankAccountVo.BankName = dr["WERPBM_BankCode"].ToString();
                    if (dr["XBAT_BankAccountTypeCode"].ToString() == "SB")
                    {
                        customerBankAccountVo.AccountType = "SV";
                    }
                    else
                    {
                        customerBankAccountVo.AccountType = dr["XBAT_BankAccountTye"].ToString();
                    }
                    customerBankAccountVo.BankAccountNum  = dr["CB_AccountNum"].ToString();
                    customerBankAccountVo.ModeOfOperation = dr["XMOH_ModeOfHolding"].ToString();
                    customerBankAccountVo.BranchName      = dr["CB_BranchName"].ToString();
                    customerBankAccountVo.BranchAdrLine1  = dr["CB_BranchAdrLine1"].ToString();
                    customerBankAccountVo.BranchAdrLine2  = dr["CB_BranchAdrLine2"].ToString();
                    customerBankAccountVo.BranchAdrLine3  = dr["CB_BranchAdrLine3"].ToString();
                    if (dr["CB_BranchAdrPinCode"].ToString() != "")
                    {
                        customerBankAccountVo.BranchAdrPinCode = int.Parse(dr["CB_BranchAdrPinCode"].ToString());
                    }
                    customerBankAccountVo.RTGSCode         = dr["CB_RTGS"].ToString();
                    customerBankAccountVo.NeftCode         = dr["CB_NEFT"].ToString();
                    customerBankAccountVo.BranchAdrCity    = dr["CB_BranchAdrCity"].ToString();
                    customerBankAccountVo.BranchAdrState   = dr["CB_BranchAdrState"].ToString();
                    customerBankAccountVo.BranchAdrCountry = dr["CB_BranchAdrCountry"].ToString();
                    if (dr["CB_Balance"].ToString() != "")
                    {
                        customerBankAccountVo.Balance = float.Parse(dr["CB_Balance"].ToString());
                    }
                    //if (dr["CB_MICR"].ToString() != "")
                    //    customerBankAccountVo.MICR = long.Parse(dr["CB_MICR"].ToString());
                    customerBankAccountVo.MICR = dr["CB_MICR"].ToString();
                    customerBankAccountVo.IFSC = dr["CB_IFSC"].ToString();
                }
            }

            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountDao.cs:GetCusomerBankAccount()");


                object[] objects = new object[2];
                objects[0] = customerId;
                objects[1] = customerBankAccId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(customerBankAccountVo);
        }
        public int CreateCustomerBankAccount(CustomerBankAccountVo customerBankAccountVo, int customerId, int userId)
        {
            int accountId = 0;
            //  bool bResult = false;
            Database  db;
            DbCommand createCustomerBankCmd;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                createCustomerBankCmd = db.GetStoredProcCommand("SP_CreateCustomerBankAccount");
                db.AddInParameter(createCustomerBankCmd, "@C_CustomerId", DbType.Int32, customerId);
                db.AddInParameter(createCustomerBankCmd, "@WERPBM_BankCode", DbType.String, customerBankAccountVo.BankName);
                db.AddInParameter(createCustomerBankCmd, "@CP_PortfolioId", DbType.Int32, customerBankAccountVo.PortfolioId);
                if (!string.IsNullOrEmpty("PAIC_AssetInstrumentCategoryCode".ToString()))
                {
                    db.AddInParameter(createCustomerBankCmd, "@PAIC_AssetInstrumentCategoryCode", DbType.String, customerBankAccountVo.AccountType);
                }
                else
                {
                    db.AddInParameter(createCustomerBankCmd, "@PAIC_AssetInstrumentCategoryCode", DbType.String, DBNull.Value);
                }
                db.AddInParameter(createCustomerBankCmd, "@CB_AccountNum", DbType.String, customerBankAccountVo.BankAccountNum);
                db.AddInParameter(createCustomerBankCmd, "@CB_IsHeldJointly", DbType.Int32, customerBankAccountVo.IsJointHolding);
                db.AddInParameter(createCustomerBankCmd, "@XMOH_ModeOfHoldingCode", DbType.String, customerBankAccountVo.ModeOfOperation);
                db.AddInParameter(createCustomerBankCmd, "@CB_BankCity", DbType.String, customerBankAccountVo.BankCity);
                db.AddInParameter(createCustomerBankCmd, "@CB_BranchName", DbType.String, customerBankAccountVo.BranchName);
                db.AddInParameter(createCustomerBankCmd, "@CB_BranchAdrLine1", DbType.String, customerBankAccountVo.BranchAdrLine1);
                db.AddInParameter(createCustomerBankCmd, "@CB_BranchAdrLine2", DbType.String, customerBankAccountVo.BranchAdrLine2);
                db.AddInParameter(createCustomerBankCmd, "@CB_BranchAdrLine3", DbType.String, customerBankAccountVo.BranchAdrLine3);
                db.AddInParameter(createCustomerBankCmd, "@CB_BranchAdrPinCode", DbType.Int32, customerBankAccountVo.BranchAdrPinCode);
                db.AddInParameter(createCustomerBankCmd, "@CB_BranchAdrCity", DbType.String, customerBankAccountVo.BranchAdrCity);
                db.AddInParameter(createCustomerBankCmd, "@CB_BranchAdrState", DbType.String, customerBankAccountVo.BranchAdrState);
                db.AddInParameter(createCustomerBankCmd, "@CB_BranchAdrCountry", DbType.String, customerBankAccountVo.BranchAdrCountry);
                db.AddInParameter(createCustomerBankCmd, "@CB_Balance", DbType.Decimal, customerBankAccountVo.Balance);
                if (!string.IsNullOrEmpty(customerBankAccountVo.MICR.ToString()))
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_MICR", DbType.Int64, customerBankAccountVo.MICR);
                }
                else
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_MICR", DbType.Int64, DBNull.Value);
                }
                if (!string.IsNullOrEmpty(customerBankAccountVo.RTGSCode.ToString()))
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_RTGS", DbType.String, customerBankAccountVo.RTGSCode);
                }
                else
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_RTGS", DbType.String, DBNull.Value);
                }
                if (!string.IsNullOrEmpty(customerBankAccountVo.NeftCode.ToString()))
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_NEFT", DbType.String, customerBankAccountVo.NeftCode);
                }
                else
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_NEFT", DbType.String, DBNull.Value);
                }
                if (!string.IsNullOrEmpty(customerBankAccountVo.IFSC.ToString()))
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_IFSC", DbType.String, customerBankAccountVo.IFSC);
                }
                else
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_IFSC", DbType.String, DBNull.Value);
                }
                db.AddInParameter(createCustomerBankCmd, "@CB_CreatedBy", DbType.Int32, userId);
                db.AddInParameter(createCustomerBankCmd, "@CB_ModifiedBy", DbType.Int32, userId);

                db.AddInParameter(createCustomerBankCmd, "@WCMV_LookupId_BankId", DbType.Int32, customerBankAccountVo.BankId);
                db.AddInParameter(createCustomerBankCmd, "@WCMV_LookupId_AccType", DbType.Int32, customerBankAccountVo.BankAccTypeId);

                if (customerBankAccountVo.BranchAddCityId != 0)
                {
                    db.AddInParameter(createCustomerBankCmd, "@WCMV_Lookup_BranchAddCityId", DbType.Int32, customerBankAccountVo.BranchAddCityId);
                }

                if (customerBankAccountVo.BranchAddStateId != 0)
                {
                    db.AddInParameter(createCustomerBankCmd, "@WCMV_Lookup_BranchAddStateId", DbType.Int32, customerBankAccountVo.BranchAddStateId);
                }

                if (customerBankAccountVo.BranchAddCountryId != 0)
                {
                    db.AddInParameter(createCustomerBankCmd, "@WCMV_Lookup_BranchAddCountryId", DbType.Int32, customerBankAccountVo.BranchAddCountryId);
                }

                db.AddOutParameter(createCustomerBankCmd, "@CB_CustBankAccId", DbType.Int32, 10000);
                db.AddInParameter(createCustomerBankCmd, "@CB_IsCurrent", DbType.Int16, customerBankAccountVo.IsCurrent);
                if (!string.IsNullOrEmpty(customerBankAccountVo.BankBranchCode.ToString()))
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_BankBranchCode", DbType.String, customerBankAccountVo.BankBranchCode);
                }
                else
                {
                    db.AddInParameter(createCustomerBankCmd, "@CB_BankBranchCode", DbType.String, null);
                }


                // db.ExecuteNonQuery(createCustomerBankCmd);

                if (db.ExecuteNonQuery(createCustomerBankCmd) != 0)
                {
                    accountId = int.Parse(db.GetParameterValue(createCustomerBankCmd, "CB_CustBankAccId").ToString());
                }
                // bResult = true;
            }

            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerBankAccountDao.cs:CreateCustomerBankAccount()");


                object[] objects = new object[3];
                objects[0] = customerBankAccountVo;
                objects[1] = customerId;
                objects[2] = userId;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(accountId);
        }
        //string customerId = Session["customerId"].ToString();


        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                customerVo = (CustomerVo)Session["CustomerVo"];
                customerId = customerVo.CustomerId;

                customerBankAccountList = customerBankAccountBo.GetCustomerBankAccounts(customerId);
                if (customerBankAccountList.Count != 0)
                {
                    lblMsg.Visible = false;
                    DataTable dtCustomerBankAccounts = new DataTable();
                    // dtAdvisorBranches.Columns.Add(Select");
                    dtCustomerBankAccounts.Columns.Add("CustBankAccId");
                    dtCustomerBankAccounts.Columns.Add("Bank Name");
                    dtCustomerBankAccounts.Columns.Add("Branch Name");
                    dtCustomerBankAccounts.Columns.Add("Account Type");
                    dtCustomerBankAccounts.Columns.Add("Mode Of Operation");
                    dtCustomerBankAccounts.Columns.Add("Account Number");


                    DataRow drCustomerBankAccount;
                    for (int i = 0; i < customerBankAccountList.Count; i++)
                    {
                        drCustomerBankAccount    = dtCustomerBankAccounts.NewRow();
                        customerBankAccountVo    = new CustomerBankAccountVo();
                        customerBankAccountVo    = customerBankAccountList[i];
                        drCustomerBankAccount[0] = customerBankAccountVo.CustBankAccId.ToString();
                        drCustomerBankAccount[1] = customerBankAccountVo.BankName.ToString();
                        drCustomerBankAccount[2] = customerBankAccountVo.BranchName.ToString();
                        drCustomerBankAccount[3] = customerBankAccountVo.AccountType.ToString();
                        drCustomerBankAccount[4] = customerBankAccountVo.ModeOfOperation.ToString();
                        drCustomerBankAccount[5] = customerBankAccountVo.AccountNum.ToString();

                        dtCustomerBankAccounts.Rows.Add(drCustomerBankAccount);
                    }

                    gvCustomerBankAccounts.DataSource = dtCustomerBankAccounts;
                    gvCustomerBankAccounts.DataBind();
                    gvCustomerBankAccounts.Visible = true;
                }
                else
                {
                    gvCustomerBankAccounts.DataSource = null;
                    gvCustomerBankAccounts.DataBind();
                    lblMsg.Visible = true;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewBankDetails.ascx:Page_Load()");
                object[] objects = new object[5];
                objects[0] = customerVo;
                objects[2] = customerBankAccountVo;
                objects[3] = customerBankAccountList;
                objects[4] = custBankAccId;
                objects[5] = customerId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }