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);
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.DataBind();
            //cvAccopenDateCheckCurrent.ValueToCompare = DateTime.Now.ToShortDateString();
            try
            {
                // cvDepositDate1.ValueToCompare = DateTime.Now.ToShortDateString();
                path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"]).ToString();
                setMode(); //Set Add/Edit/View Mode based on the query string parameter.

                if (Session[SessionContents.PortfolioId] != null)
                {
                    portfolioId = int.Parse(Session[SessionContents.PortfolioId].ToString());
                }

                userVo     = (UserVo)Session["userVo"];
                customerVo = (CustomerVo)Session["customerVo"];

                if (!Page.IsPostBack)
                {
                    if (userVo == null || customerVo == null || portfolioId == 0 || customerAccountsVo == null || govtSavingsVo == null)
                    {
                        //Invalid data. Write redirect code here. or show error message.
                    }
                    if (mode == Mode.Edit)
                    {
                        govtSavingsVo = (GovtSavingsVo)Session["govtSavingsVo"];
                        if (govtSavingsVo != null)
                        {
                            customerAccountsVo = customerAccountBo.GetGovtSavingsAccount(govtSavingsVo.AccountId);
                        }
                        Session["customerAccountVo"] = customerAccountsVo;
                        GetData();
                        LoadDropdownValues();
                        SetFields();
                        SetValues();
                        lnkEdit.Visible        = false;
                        btnSubmit.Visible      = false;
                        btnSaveChanges.Visible = true;
                    }
                    else if (mode == Mode.View)
                    {
                        govtSavingsVo = (GovtSavingsVo)Session["govtSavingsVo"];
                        if (govtSavingsVo != null)
                        {
                            customerAccountsVo = customerAccountBo.GetGovtSavingsAccount(govtSavingsVo.AccountId);
                        }

                        GetData();
                        LoadDropdownValues();
                        SetFields();
                        SetValues();

                        btnSubmit.Visible      = false;
                        btnSaveChanges.Visible = false;
                        lnkEdit.Visible        = true;
                        DisableControls(this);
                    }
                    else if (mode == Mode.Add)
                    {
                        customerAccountsVo = (CustomerAccountsVo)Session["customerAccountVo"];
                        LoadDropdownValues();
                        SetFields();
                        btnSubmit.Visible      = true;
                        btnSaveChanges.Visible = false;
                        lnkEdit.Visible        = false;
                    }
                }
                else
                {
                    if (mode == Mode.Add)
                    {
                        customerAccountsVo = (CustomerAccountsVo)Session["customerAccountVo"];
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioGovtSavingsEntry.ascx:Page_Load()");
                object[] objects = new object[6];
                objects[0]   = userVo;
                objects[1]   = customerVo;
                objects[2]   = portfolioId;
                objects[3]   = customerAccountsVo;
                objects[4]   = command;
                objects[5]   = path;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool isGrpHead = false;

            try
            {
                SessionBo.CheckSession();
                customerVo = (CustomerVo)Session["CustomerVo"];
                if (customerVo != null)
                {
                    Session[SessionContents.FPS_ProspectList_CustomerId] = customerVo.CustomerId;
                }
                if (!IsPostBack)
                {
                    //customerVo = (CustomerVo)Session["CustomerVo"];
                    //customerVo = (CustomerVo)Session["CustomerVo"];
                    if (customerVo.FirstName != null && customerVo.MiddleName != null && customerVo.LastName != null)
                    {
                        string First  = customerVo.FirstName.ToString();
                        string Middle = customerVo.MiddleName.ToString();
                        string Last   = customerVo.LastName.ToString();

                        isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId);
                        if (isGrpHead == true)
                        {
                            TreeView1.Nodes.AddAt(1, new TreeNode("Group Dashboard"));
                        }

                        if (Middle != "")
                        {
                            lblNameValue.Text = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString();
                        }
                        else
                        {
                            lblNameValue.Text = customerVo.FirstName.ToString() + " " + customerVo.LastName.ToString();
                        }

                        lblEmailIdValue.Text = customerVo.Email.ToString();
                    }
                    TreeView1.CollapseAll();
                    TreeView1.FindNode("Portfolio Dashboard").Expand();
                }
                if (customerVo.UserType == "IND")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadtopmenu('CustomerIndividualLeftPane');", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadtopmenu('CustomerNonIndividualLeftPane');", true);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioLeftPane.ascx:Page_Load()");
                object[] objects = new object[1];
                objects[0] = customerVo;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        public void SetBranches()
        {
            bool bResult = false;

            try
            {
                branchList = advisorBranchBo.GetAdvisorBranches(advisorVo.advisorId, "");
                for (int i = 0; i < branchList.Count; i++)
                {
                    advisorBranchVo = new AdvisorBranchVo();
                    advisorBranchVo = branchList[i];
                    bResult         = advisorBranchBo.ChkBranchManagerAvail(advisorBranchVo.BranchId);
                    if (bResult)
                    {
                        newBranchList.Add(advisorBranchVo);
                    }
                }

                if (newBranchList.Count == 0)
                {
                    lblIllegal.Visible     = true;
                    lnkAddBranch.Visible   = true;
                    btnAssociateBM.Visible = false;
                }
                else
                {
                    lblIllegal.Visible     = false;
                    lnkAddBranch.Visible   = false;
                    btnAssociateBM.Visible = true;
                    DataTable dtAdvisorBranch = new DataTable();
                    dtAdvisorBranch.Columns.Add("Sl.No.");
                    dtAdvisorBranch.Columns.Add("BranchId");
                    dtAdvisorBranch.Columns.Add("Branch Name");
                    dtAdvisorBranch.Columns.Add("Branch Address");
                    dtAdvisorBranch.Columns.Add("Branch Phone");
                    DataRow drAdvisorBranch;
                    for (int i = 0; i < newBranchList.Count; i++)
                    {
                        drAdvisorBranch    = dtAdvisorBranch.NewRow();
                        advisorBranchVo    = new AdvisorBranchVo();
                        advisorBranchVo    = newBranchList[i];
                        drAdvisorBranch[0] = (i + 1).ToString();
                        drAdvisorBranch[1] = advisorBranchVo.BranchId.ToString();
                        drAdvisorBranch[2] = advisorBranchVo.BranchName.ToString();
                        drAdvisorBranch[3] = advisorBranchVo.AddressLine1.ToString() + "'" + advisorBranchVo.AddressLine2.ToString() + "'" + advisorBranchVo.AddressLine3.ToString() + "," + advisorBranchVo.City.ToString() + "'" + advisorBranchVo.State.ToString();
                        drAdvisorBranch[4] = advisorBranchVo.Phone1Isd + "-" + advisorBranchVo.Phone1Std + "-" + advisorBranchVo.Phone1Number;
                        dtAdvisorBranch.Rows.Add(drAdvisorBranch);
                    }
                    gvBranchListBM.DataSource = dtAdvisorBranch;
                    gvBranchListBM.DataBind();
                    gvBranchListBM.Visible = true;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "BMBranchAssociation.ascx.cs:SetBranches()");
                object[] objects = new object[3];
                objects[0]   = advisorBranchVo;
                objects[1]   = branchList;
                objects[2]   = newBranchList;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #5
0
        /// <summary>
        /// Read the user entered values from fields and assign it to GovtSavingsVo object.
        /// </summary>
        /// <returns></returns>
        private GovtSavingsVo GetValuesFromFields()
        {
            GovtSavingsVo newGovtSavingsVo = new GovtSavingsVo();

            try
            {
                customerAccountsVo           = (CustomerAccountsVo)Session["customerAccountVo"];
                customerAccountsVo.AccountId = customerAccountsVo.AccountId;//Convert.ToInt32(txtAccountId.Text);
                if (txtAccOpenDate != null && txtAccOpenDate.Text != string.Empty)
                {
                    customerAccountsVo.AccountOpeningDate = Convert.ToDateTime(txtAccOpenDate.Text);
                }

                customerAccountsVo.AccountSource = txtAccountWith.Text;
                //If Edit, get the Id of  govt savings net data.
                if (mode == Mode.Edit)
                {
                    GovtSavingsVo govtSavngs = (GovtSavingsVo)Session["govtSavingsVo"];
                    newGovtSavingsVo.GoveSavingsPortfolioId = govtSavngs.GoveSavingsPortfolioId;
                }
                newGovtSavingsVo.PortfolioId    = customerAccountsVo.PortfolioId;
                newGovtSavingsVo.AccountId      = customerAccountsVo.AccountId;
                newGovtSavingsVo.AssetGroupCode = customerAccountsVo.AssetClass;
                newGovtSavingsVo.AssetInstrumentCategoryCode = customerAccountsVo.AssetCategory;

                if (ddlDebtIssuerCode != null && ddlDebtIssuerCode.SelectedItem.Value != string.Empty)
                {
                    newGovtSavingsVo.DebtIssuerCode = ddlDebtIssuerCode.SelectedItem.Value.ToString();
                }

                newGovtSavingsVo.Name = txtAssetParticulars.Text;

                if (txtCurrentValue != null && txtCurrentValue.Text != "")
                {
                    newGovtSavingsVo.CurrentValue = float.Parse(txtCurrentValue.Text);
                }



                if (txtDepositDate != null && txtDepositDate.Text != "")
                {
                    newGovtSavingsVo.PurchaseDate = DateTime.Parse(txtDepositDate.Text.ToString());
                }

                if (txtMaturityValue != null && txtMaturityValue.Text != "")
                {
                    newGovtSavingsVo.MaturityValue = float.Parse(txtMaturityValue.Text);
                }
                if (txtMaturityDate != null && txtMaturityDate.Text != "")
                {
                    newGovtSavingsVo.MaturityDate = DateTime.Parse(txtMaturityDate.Text.ToString());
                }
                if (txtDepositAmount != null && txtDepositAmount.Text != "")
                {
                    newGovtSavingsVo.DepositAmt = float.Parse(txtDepositAmount.Text);
                }
                if (txtInterstRate != null && txtInterstRate.Text != "")
                {
                    newGovtSavingsVo.InterestRate = float.Parse(txtInterstRate.Text);
                }
                if (ddlInterestBasis != null)
                {
                    newGovtSavingsVo.InterestBasisCode = ddlInterestBasis.SelectedItem.Value.ToString();
                }
                if (txtAmount != null && txtAmount.Text != "")
                {
                    newGovtSavingsVo.Amount = float.Parse(txtAmount.Text);
                }
                if (ddlPaymentMode != null)
                {
                    newGovtSavingsVo.ModeOfPayment = ddlPaymentMode.SelectedItem.Value.ToString();
                }
                if (txtPaymentNumber != null && txtPaymentNumber.Text != "")
                {
                    newGovtSavingsVo.PaymentInstrumentNumber = txtPaymentNumber.Text;
                }
                if (txtPaymentInstDate.SelectedDate != DateTime.MinValue)
                {
                    newGovtSavingsVo.PaymentInstrumentDate = Convert.ToDateTime(txtPaymentInstDate.SelectedDate);
                }
                if (txtBranchName != null && txtBranchName.Text != "")
                {
                    newGovtSavingsVo.BankBranch = txtBranchName.Text;
                }
                //if (ddlBankName != null && ddlBankName.SelectedValue !="")
                //    newGovtSavingsVo.BankName = ddlBankName.SelectedValue.ToString();
                //    newGovtSavingsVo.bankcode = int.Parse(ddlBankName.SelectedValue);

                if (newGovtSavingsVo.InterestBasisCode == "SI")
                {
                    newGovtSavingsVo.InterestPayableFrequencyCode  = ddlSimpleInterestFC.SelectedItem.Value.ToString();
                    newGovtSavingsVo.CompoundInterestFrequencyCode = "NA";
                }
                else if (newGovtSavingsVo.InterestBasisCode == "CI")
                {
                    newGovtSavingsVo.InterestPayableFrequencyCode  = "NA";
                    newGovtSavingsVo.CompoundInterestFrequencyCode = ddlCompoundInterestFC.SelectedItem.Value.ToString();
                }
                else
                {
                    newGovtSavingsVo.InterestBasisCode = null;
                }

                if (rbtnAccumulated.Checked)
                {
                    newGovtSavingsVo.IsInterestAccumalated = 1;
                    if (txtInterestAmtCredited != null && txtInterestAmtCredited.Text != string.Empty)
                    {
                        newGovtSavingsVo.InterestAmtAccumalated = float.Parse(txtInterestAmtCredited.Text);
                    }
                    newGovtSavingsVo.InterestAmtPaidOut = 0;
                }
                else
                {
                    newGovtSavingsVo.IsInterestAccumalated = 0;
                    if (txtInterestAmtCredited != null && txtInterestAmtCredited.Text != string.Empty)
                    {
                        newGovtSavingsVo.InterestAmtPaidOut = float.Parse(txtInterestAmtCredited.Text);
                    }
                    newGovtSavingsVo.InterestAmtAccumalated = 0;
                }

                //Post Office Recurring Deposit Account- Subsequent deposit details
                if (customerAccountsVo.AssetCategory != null && customerAccountsVo.AssetCategory.ToString().Trim() == "GSRD")
                {
                    if (txtSubsqntDepositAmount != null && txtSubsqntDepositAmount.Text != string.Empty)
                    {
                        newGovtSavingsVo.SubsqntDepositAmount = float.Parse(txtSubsqntDepositAmount.Text.Trim());
                    }
                    if (txtSubsqntDepositDate != null && txtSubsqntDepositDate.Text != string.Empty)
                    {
                        newGovtSavingsVo.SubsqntDepositDate = Convert.ToDateTime(txtSubsqntDepositDate.Text);
                    }

                    if (ddlDepositFrequency != null && ddlDepositFrequency.SelectedValue != string.Empty)
                    {
                        newGovtSavingsVo.DepositFrequencyCode = ddlDepositFrequency.SelectedValue;
                    }
                }

                newGovtSavingsVo.Remarks = txtRemarks.Text;
                return(newGovtSavingsVo);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioGovtSavingsEntry.ascx:GetValuesFromFields()");
                object[] objects = new object[3];
                //objects[0] = govtSavingsVo;
                //objects[1] = customerAccountsVo;
                //objects[2] = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void BindTradebusinessdate()
        {
            try
            {
                DataSet   dsGetAllTradeBussiness = new DataSet();
                DataTable dtGetAllTradeBussiness = new DataTable();
                dsGetAllTradeBussiness = OnlineOrderBackOfficeBo.GetAllTradeBussiness(int.Parse(Ddlyears.SelectedItem.Value), int.Parse(Ddlholiday.SelectedItem.Value));
                dtGetAllTradeBussiness = dsGetAllTradeBussiness.Tables[0];
                if (dtGetAllTradeBussiness.Rows.Count > 0)
                {
                    if (Cache[userVo.UserId.ToString() + "TradeBusinessDates"] != null)
                    {
                        Cache.Remove(userVo.UserId.ToString() + "TradeBusinessDates");
                    }
                    Cache.Insert(userVo.UserId.ToString() + "TradeBusinessDates", dtGetAllTradeBussiness);

                    //gvTradeBusinessDate.DataSource = dtGetAllTradeBussiness;
                    //gvTradeBusinessDate.DataBind();

                    //if (Cache[userVo.UserId.ToString() + "TradeBusinessDates"] != null)
                    //{
                    //    Cache.Remove("Tradebussiness" + adviserVo.advisorId);
                    //    Cache.Insert("Tradebussiness" + adviserVo.advisorId, dtGetAllTradeBussiness);
                    //    Cache.Insert("Tradebussiness" + adviserVo.advisorId, dtGetAllTradeBussiness);
                    //}
                    //else
                    //{

                    //}


                    //  sai
                    //if (Cache["Tradebussiness" + adviserVo.advisorId] == null)
                    //{
                    //    Cache.Insert("Tradebussiness" + adviserVo.advisorId, dtGetAllTradeBussiness);
                    //}
                    //else
                    //{
                    //    Cache.Remove("Tradebussiness" + adviserVo.advisorId);
                    //    Cache.Insert("Tradebussiness" + adviserVo.advisorId, dtGetAllTradeBussiness);
                    //}


                    //int i = 0;

                    //string s = string.Format("{0:yyyy-MM-dd}", DateTime.Now);

                    //foreach (DataRow dr in dtGetAllTradeBussiness.Rows)
                    //{
                    //    if (dtGetAllTradeBussiness.Rows[i][0].ToString().ToLower().Trim() == s.ToLower().Trim())
                    //    {
                    //        var page = (i / 20);  //eg row 50 means page = 10
                    //        gvTradeBusinessDate.CurrentPageIndex = page;

                    //        break;
                    //    }
                    //    else
                    //    {
                    //        i++;
                    //        gvTradeBusinessDate.CurrentPageIndex = 0;
                    //    }
                    //}

                    gvTradeBusinessDate.DataSource = dtGetAllTradeBussiness;
                    gvTradeBusinessDate.DataBind();
                    //BindTradebusinessdate();
                }
                else
                {
                    gvTradeBusinessDate.DataSource = dtGetAllTradeBussiness;
                    gvTradeBusinessDate.DataBind();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "OnlineSchemeMIS.ascx.cs:SetParameter()");
                object[] objects = new object[4];
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            cvDepositDate1.ValueToCompare = DateTime.Now.ToShortDateString();
            txtLivingSince_CompareValidator.ValueToCompare = DateTime.Now.ToShortDateString();
            cvJobStartDate.ValueToCompare = DateTime.Now.ToShortDateString();
            txtMarriageDate_CompareValidator.ValueToCompare = DateTime.Now.ToShortDateString();

            try
            {
                SessionBo.CheckSession();
                path       = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                userVo     = (UserVo)Session["userVo"];
                customerVo = (CustomerVo)Session["CustomerVo"];
                RMVo customerRMVo = new RMVo();
                if (!IsPostBack)
                {
                    lblPanDuplicate.Visible = false;

                    if (customerVo.SubType != "NRI")
                    {
                        txtRBIRefDate.Visible = false;
                        txtRBIRefNo.Visible   = false;
                        lblRBIRefDate.Visible = false;
                        lblRBIRefNo.Visible   = false;
                    }
                    if (customerVo.SubType == "MNR")
                    {
                        trGuardianName.Visible = true;
                    }
                    else
                    {
                        trGuardianName.Visible = false;
                    }
                    BindDropDowns();

                    //Bind Adviser Branch List

                    BindListBranch(customerVo.RmId, "rm");


                    if (customerVo.Type.ToUpper().ToString() == "IND")
                    {
                        rbtnIndividual.Checked = true;
                    }
                    else
                    {
                        rbtnNonIndividual.Checked = true;
                    }
                    ddlAdviserBranchList.SelectedValue = customerVo.BranchId.ToString();
                    customerRMVo = adviserStaffBo.GetAdvisorStaffDetails(customerVo.RmId);
                    if (customerRMVo.FirstName + " " + customerRMVo.MiddleName + " " + customerRMVo.LastName != null && (customerRMVo.FirstName + " " + customerRMVo.MiddleName + " " + customerRMVo.LastName).ToString() != "")
                    {
                        lblRM.Text = customerRMVo.FirstName + " " + customerRMVo.MiddleName + " " + customerRMVo.LastName;
                    }
                    else
                    {
                        lblRM.Text = "";
                    }
                    if (customerVo.MaritalStatus != null)
                    {
                        ddlMaritalStatus.SelectedValue = customerVo.MaritalStatus.ToString();
                    }
                    if (ddlMaritalStatus.SelectedValue == "MA")
                    {
                        txtMarriageDate.Enabled = true;
                    }
                    else
                    {
                        txtMarriageDate.Enabled = false;
                    }

                    if (customerVo.MarriageDate == DateTime.MinValue)
                    {
                        txtMarriageDate.Text = "";
                    }
                    else
                    {
                        txtMarriageDate.Text = customerVo.MarriageDate.ToShortDateString();
                    }
                    if (customerVo.Nationality != null)
                    {
                        ddlNationality.SelectedValue = customerVo.Nationality.ToString();
                    }
                    if (customerVo.Occupation != null)
                    {
                        ddlOccupation.SelectedValue = customerVo.Occupation.ToString();
                    }
                    if (customerVo.Qualification != null)
                    {
                        ddlQualification.SelectedValue = customerVo.Qualification.ToString();
                    }

                    if (customerVo.ProfilingDate == DateTime.MinValue)
                    {
                        txtProfilingDate.Text = "";
                    }
                    else
                    {
                        txtProfilingDate.Text = customerVo.ProfilingDate.ToShortDateString();
                    }

                    if (customerVo.Dob == DateTime.MinValue)
                    {
                        txtDob.Text = "";
                    }
                    else
                    {
                        txtDob.Text = customerVo.Dob.ToShortDateString();
                    }
                    if (!string.IsNullOrEmpty(customerVo.Salutation))
                    {
                        ddlSalutation.SelectedValue = customerVo.Salutation;
                    }
                    else
                    {
                        ddlSalutation.SelectedIndex = 0;
                    }
                    if (customerVo.DummyPAN == 1)
                    {
                        chkdummypan.Checked = true;
                    }
                    else
                    {
                        chkdummypan.Checked = false;
                    }
                    //if (customerVo.IsProspect == 1)
                    //{
                    //    chkprospect.Checked = true;
                    //}
                    //else
                    //{
                    //    chkprospect.Checked = false;
                    //}
                    if (customerVo.ViaSMS == 1)
                    {
                        chksms.Checked = true;
                    }
                    else
                    {
                        chksms.Checked = false;
                    }
                    if (customerVo.AlertViaEmail == 1)
                    {
                        chkmail.Checked = true;
                    }
                    else
                    {
                        chkmail.Checked = false;
                    }

                    txtGuardianFirstName.Text  = customerVo.ContactFirstName;
                    txtGuardianLastName.Text   = customerVo.ContactLastName;
                    txtGuardianMiddleName.Text = customerVo.ContactMiddleName;
                    txtFirstName.Text          = customerVo.FirstName;
                    txtMiddleName.Text         = customerVo.MiddleName;
                    txtLastName.Text           = customerVo.LastName;
                    txtCustomerCode.Text       = customerVo.CustCode;
                    txtPanNumber.Text          = customerVo.PANNum;

                    txtCorrAdrLine1.Text          = customerVo.Adr1Line1;
                    txtCorrAdrLine2.Text          = customerVo.Adr1Line2;
                    txtCorrAdrLine3.Text          = customerVo.Adr1Line3;
                    txtCorrAdrPinCode.Text        = customerVo.Adr1PinCode.ToString();
                    txtCorrAdrCity.Text           = customerVo.Adr1City;
                    ddlCorrAdrState.SelectedValue = customerVo.Adr1State;
                    txtCorrAdrCountry.Text        = customerVo.Adr1Country;
                    txtPermAdrLine1.Text          = customerVo.Adr2Line1;
                    txtPermAdrLine2.Text          = customerVo.Adr2Line2;

                    txtPermAdrLine3.Text          = customerVo.Adr2Line3;
                    txtPermAdrPinCode.Text        = customerVo.Adr2PinCode.ToString();
                    txtPermAdrCity.Text           = customerVo.Adr2City;
                    ddlPermAdrState.SelectedValue = customerVo.Adr2State;
                    txtPermAdrCountry.Text        = customerVo.Adr2Country;
                    txtOfcCompanyName.Text        = customerVo.CompanyName;
                    txtOfcAdrLine1.Text           = customerVo.OfcAdrLine1;
                    txtOfcAdrLine2.Text           = customerVo.OfcAdrLine2;
                    txtOfcAdrLine3.Text           = customerVo.OfcAdrLine3;
                    txtOfcAdrPinCode.Text         = customerVo.OfcAdrPinCode.ToString();
                    txtOfcAdrCity.Text            = customerVo.OfcAdrCity;
                    ddlOfcAdrState.SelectedValue  = customerVo.OfcAdrState;
                    txtOfcAdrCountry.Text         = customerVo.OfcAdrCountry;
                    txtResPhoneNoIsd.Text         = customerVo.ResISDCode.ToString();
                    txtResPhoneNoStd.Text         = customerVo.ResSTDCode.ToString();
                    txtResPhoneNo.Text            = customerVo.ResPhoneNum.ToString();
                    txtOfcPhoneNoIsd.Text         = customerVo.OfcISDCode.ToString();
                    txtOfcPhoneNoStd.Text         = customerVo.OfcSTDCode.ToString();
                    txtOfcPhoneNo.Text            = customerVo.OfcPhoneNum.ToString();
                    txtOfcFaxIsd.Text             = customerVo.OfcISDFax.ToString();
                    txtOfcFaxStd.Text             = customerVo.OfcSTDFax.ToString();
                    txtOfcFax.Text    = customerVo.OfcFax.ToString();
                    txtResFax.Text    = customerVo.Fax.ToString();
                    txtResFaxIsd.Text = customerVo.ISDFax.ToString();
                    txtResFaxStd.Text = customerVo.STDFax.ToString();
                    txtMobile1.Text   = customerVo.Mobile1.ToString();
                    txtMobile2.Text   = customerVo.Mobile2.ToString();
                    txtEmail.Text     = customerVo.Email;
                    txtAltEmail.Text  = customerVo.AltEmail;
                    txtRBIRefNo.Text  = customerVo.RBIRefNum;
                    if (customerVo.RBIApprovalDate == DateTime.MinValue)
                    {
                        txtRBIRefDate.Text = "";
                    }
                    else
                    {
                        txtRBIRefDate.Text = customerVo.RBIApprovalDate.ToShortDateString();
                    }

                    if (customerVo.ResidenceLivingDate == DateTime.MinValue)
                    {
                        txtLivingSince.Text = "";
                    }
                    else
                    {
                        txtLivingSince.Text = customerVo.ResidenceLivingDate.ToShortDateString();
                    }

                    if (customerVo.JobStartDate == DateTime.MinValue)
                    {
                        txtJobStartDate.Text = "";
                    }
                    else
                    {
                        txtJobStartDate.Text = customerVo.JobStartDate.ToShortDateString();
                    }

                    txtMotherMaidenName.Text = customerVo.MothersMaidenName;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "EditCustomerIndividualProfile.ascx:btnSubmit_Click()");
                object[] objects = new object[3];
                objects[0]   = customerVo;
                objects[1]   = path;
                objects[2]   = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void btnAddBankDetails_Click(object sender, EventArgs e)
        {
            try
            {
                if (Validation())
                {
                    userVo = (UserVo)Session["UserVo"];
                    rmId   = rmVo.RMId;

                    customerVo.ProfilingDate = DateTime.Parse(txtProfilingDate.Text.ToString());
                    if (!string.IsNullOrEmpty(customerVo.Salutation))
                    {
                        customerVo.Salutation = ddlSalutation.SelectedItem.Value.ToString();
                    }
                    customerVo.FirstName  = txtFirstName.Text.ToString();
                    customerVo.MiddleName = txtMiddleName.Text.ToString();
                    customerVo.LastName   = txtLastName.Text.ToString();
                    customerVo.CustCode   = txtCustomerCode.Text.ToString();
                    if (rbtnMale.Checked)
                    {
                        customerVo.Gender = "M";
                    }
                    else if (rbtnFemale.Checked)
                    {
                        customerVo.Gender = "F";
                    }

                    if (txtDob.Text.ToString().Trim() != "")
                    {
                        customerVo.Dob = DateTime.Parse(txtDob.Text.ToString());
                    }
                    else
                    {
                        customerVo.Dob = DateTime.MinValue;
                    }
                    customerVo.PANNum = txtPanNumber.Text.ToString();
                    customerVo.RmId   = rmId;

                    if (chkCorrPerm.Checked)
                    {
                        customerVo.Adr2Line1   = txtCorrAdrLine1.Text.ToString();
                        customerVo.Adr2Line2   = txtCorrAdrLine2.Text.ToString();
                        customerVo.Adr2Line3   = txtCorrAdrLine3.Text.ToString();
                        customerVo.Adr2PinCode = (txtCorrAdrPinCode.Text.ToString().Trim() != "") ? Int32.Parse(txtCorrAdrPinCode.Text.ToString().Trim()) : 0;
                        customerVo.Adr2City    = txtCorrAdrCity.Text.ToString();
                        customerVo.Adr2State   = ddlCorrAdrState.SelectedValue.ToString();
                        customerVo.Adr2Country = ddlCorrAdrCountry.SelectedValue.ToString();
                    }
                    else
                    {
                        customerVo.Adr2Line1   = txtPermAdrLine1.Text.ToString();
                        customerVo.Adr2Line2   = txtPermAdrLine2.Text.ToString();
                        customerVo.Adr2Line3   = txtPermAdrLine3.Text.ToString();
                        customerVo.Adr2PinCode = (txtPermAdrPinCode.Text.ToString().Trim() != "") ? Int32.Parse(txtPermAdrPinCode.Text.ToString().Trim()) : 0;
                        customerVo.Adr2City    = txtPermAdrCity.Text.ToString();
                        customerVo.Adr2State   = ddlPermAdrState.SelectedValue.ToString();
                        customerVo.Adr2Country = ddlPermAdrCountry.SelectedValue.ToString();
                    }
                    customerVo.Adr1Line1     = txtCorrAdrLine1.Text.ToString();
                    customerVo.Adr1Line2     = txtCorrAdrLine2.Text.ToString();
                    customerVo.Adr1Line3     = txtCorrAdrLine3.Text.ToString();
                    customerVo.Adr1PinCode   = (txtCorrAdrPinCode.Text.ToString().Trim() != "") ? Int32.Parse(txtCorrAdrPinCode.Text.ToString().Trim()) : 0;
                    customerVo.Adr1City      = txtCorrAdrCity.Text.ToString();
                    customerVo.Adr1State     = ddlCorrAdrState.SelectedValue.ToString();
                    customerVo.Adr1Country   = ddlCorrAdrCountry.SelectedItem.Value.ToString();
                    customerVo.OfcAdrLine1   = txtOfcAdrLine1.Text.ToString();
                    customerVo.OfcAdrLine2   = txtOfcAdrLine2.Text.ToString();
                    customerVo.OfcAdrLine3   = txtOfcAdrLine3.Text.ToString();
                    customerVo.OfcAdrPinCode = (txtOfcAdrPinCode.Text.ToString().Trim() != "") ? Int32.Parse(txtOfcAdrPinCode.Text.ToString().Trim()) : 0;
                    customerVo.OfcAdrCity    = txtOfcAdrCity.Text.ToString();
                    customerVo.OfcAdrState   = ddlOfcAdrState.SelectedValue.ToString();
                    customerVo.OfcAdrCountry = ddlOfcAdrCountry.SelectedValue.ToString();
                    customerVo.CompanyName   = txtOfcCompanyName.Text.ToString();
                    customerVo.ResISDCode    = (txtResPhoneNoIsd.Text.ToString().Trim() != "") ? Int32.Parse(txtResPhoneNoIsd.Text.ToString().Trim()) : 0;
                    customerVo.ResSTDCode    = (txtResPhoneNoStd.Text.ToString().Trim() != "") ? Int32.Parse(txtResPhoneNoStd.Text.ToString().Trim()) : 0;
                    customerVo.ResPhoneNum   = (txtResPhoneNo.Text.ToString().Trim() != "") ? Int32.Parse(txtResPhoneNo.Text.ToString().Trim()) : 0;
                    customerVo.OfcISDCode    = (txtOfcPhoneNoIsd.Text.ToString().Trim() != "") ? Int32.Parse(txtOfcPhoneNoIsd.Text.ToString().Trim()) : 0;
                    customerVo.OfcSTDCode    = (txtOfcPhoneNoStd.Text.ToString().Trim() != "") ? Int32.Parse(txtOfcPhoneNoStd.Text.ToString().Trim()) : 0;
                    customerVo.OfcPhoneNum   = (txtOfcPhoneNo.Text.ToString().Trim() != "") ? Int32.Parse(txtOfcPhoneNo.Text.ToString().Trim()) : 0;
                    customerVo.ISDFax        = (txtResFaxIsd.Text.ToString().Trim() != "") ? Int32.Parse(txtResFaxIsd.Text.ToString().Trim()) : 0;
                    customerVo.STDFax        = (txtResFaxStd.Text.ToString().Trim() != "") ? Int32.Parse(txtResFaxStd.Text.ToString().Trim()) : 0;
                    customerVo.Fax           = (txtResFax.Text.ToString().Trim() != "") ? Int32.Parse(txtResFax.Text.ToString().Trim()) : 0;
                    customerVo.OfcISDFax     = (txtOfcFaxIsd.Text.ToString().Trim() != "") ? Int32.Parse(txtOfcFaxIsd.Text.ToString().Trim()) : 0;
                    customerVo.OfcSTDFax     = (txtOfcFaxStd.Text.ToString().Trim() != "") ? Int32.Parse(txtOfcFaxStd.Text.ToString().Trim()) : 0;
                    customerVo.OfcFax        = (txtOfcFax.Text.ToString().Trim() != "") ? Int32.Parse(txtOfcFax.Text.ToString().Trim()) : 0;
                    customerVo.Mobile1       = (txtMobile1.Text.ToString().Trim() != "") ? long.Parse(txtMobile1.Text.ToString().Trim()) : 0;
                    customerVo.Mobile2       = (txtMobile2.Text.ToString().Trim() != "") ? long.Parse(txtMobile2.Text.ToString().Trim()) : 0;
                    customerVo.Email         = txtEmail.Text.ToString();
                    customerVo.AltEmail      = txtAltEmail.Text.ToString();
                    customerVo.Occupation    = ddlOccupation.SelectedItem.Value.ToString();
                    customerVo.Qualification = ddlQualification.SelectedItem.Value.ToString();
                    customerVo.Nationality   = ddlNationality.SelectedItem.Value.ToString();
                    customerVo.MaritalStatus = ddlMaritalStatus.SelectedItem.Value.ToString();
                    customerVo.RBIRefNum     = txtRBIRefNo.Text.ToString();
                    if (customerVo.SubType == "NRI")
                    {
                        if (txtRBIApprovalDate.Text.ToString().Trim() != "")
                        {
                            customerVo.RBIApprovalDate = DateTime.Parse(txtRBIApprovalDate.Text.ToString().Trim());
                        }
                        else
                        {
                            customerVo.RBIApprovalDate = DateTime.MinValue;
                        }
                    }

                    customerPortfolioVo.CustomerId        = customerVo.CustomerId;
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";

                    if (Session["customerIds"] != null)
                    {
                        List <int> customerIds = new List <int>();
                        customerIds           = (List <int>)Session["CustomerIds"];
                        customerVo.CustomerId = customerIds[1];
                        customerBo.UpdateCustomer(customerVo);
                    }
                    Session["Check"] = "CustomerAdd";
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('AddBankDetails','none');", true);
                }
                else
                {
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerIndividualAdd.ascx:btnAddBankDetails_Click()");
                object[] objects = new object[4];
                objects[0]   = rmVo;
                objects[2]   = customerVo;
                objects[3]   = customerPortfolioVo;
                objects[4]   = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userVo = (UserVo)Session["UserVo"];
            path   = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
            txtLivingSince_CompareValidator.ValueToCompare  = DateTime.Now.ToShortDateString();
            txtMarriageDate_CompareValidator.ValueToCompare = DateTime.Now.ToShortDateString();
            cvJobStartDate.ValueToCompare = DateTime.Now.ToShortDateString();

            try
            {
                this.Page.Culture = "en-GB";
                rmVo = (RMVo)Session["rmVo"];

                customerVo = (CustomerVo)Session["CustomerVo"];
                if (Request.QueryString["RmId"] != null)
                {
                    rmId = int.Parse(Request.QueryString["RmId"].ToString());

                    rmVo = advisorStaffBo.GetAdvisorStaffDetails(customerVo.RmId);
                }
                else
                {
                    rmId = rmVo.RMId;
                }
                if (!IsPostBack)
                {
                    if (customerVo.SubType != "NRI")
                    {
                        txtRBIApprovalDate.Visible = false;
                        txtRBIRefNo.Visible        = false;
                        lblRBIApprovalDate.Visible = false;
                        lblRBIRefNum.Visible       = false;
                        trGuardianName.Visible     = true;
                    }
                    if (customerVo.SubType == "MNR")
                    {
                        trGuardianName.Visible = true;
                    }
                    else
                    {
                        trGuardianName.Visible = false;
                    }

                    // txtRmName.Text = rmVo.FirstName.ToString() + " " + rmVo.MiddleName.ToString() + " " + rmVo.LastName.ToString();
                    if (!string.IsNullOrEmpty(customerVo.Salutation))
                    {
                        ddlSalutation.SelectedValue = customerVo.Salutation;
                    }
                    txtFirstName.Text  = customerVo.FirstName.ToString();
                    txtMiddleName.Text = customerVo.MiddleName.ToString();
                    txtLastName.Text   = customerVo.LastName.ToString();
                    txtEmail.Text      = customerVo.Email.ToString();
                    txtPanNumber.Text  = customerVo.PANNum;
                    if (customerVo.DummyPAN == 1)
                    {
                        chkdummypan.Checked = true;
                    }
                    else
                    {
                        chkdummypan.Checked = false;
                    }

                    txtProfilingDate.Text = DateTime.Today.Date.ToShortDateString().ToString();
                    txtRMName.Text        = rmVo.FirstName + " " + rmVo.MiddleName + " " + rmVo.LastName;
                    BindDropDowns(path);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerIndividualAdd.ascx:Page_Load()");
                object[] objects = new object[3];
                objects[0]   = rmVo;
                objects[1]   = customerVo;
                objects[2]   = path;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        public PensionAndGratuitiesVo GetPensionAndGratuities(int portfolioId)
        {
            PensionAndGratuitiesVo pensionAndGratuitiesVo = null;
            Database  db;
            DbCommand getPensionAndGratuitiesCmd;
            DataSet   getPensionAndGratuitiesDs;
            DataRow   dr;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getPensionAndGratuitiesCmd = db.GetStoredProcCommand("SP_GetPensionAndGratuities");
                db.AddInParameter(getPensionAndGratuitiesCmd, "@CPGNP_PensionGratutiesNPId", DbType.Int32, portfolioId);
                getPensionAndGratuitiesDs = db.ExecuteDataSet(getPensionAndGratuitiesCmd);
                if (getPensionAndGratuitiesDs.Tables[0].Rows.Count > 0)
                {
                    pensionAndGratuitiesVo = new PensionAndGratuitiesVo();
                    dr = getPensionAndGratuitiesDs.Tables[0].Rows[0];

                    pensionAndGratuitiesVo.PensionGratuitiesPortfolioId = Int32.Parse(dr["CPGNP_PensionGratutiesNPId"].ToString());
                    pensionAndGratuitiesVo.AccountId = int.Parse(dr["CPGA_AccountId"].ToString());
                    pensionAndGratuitiesVo.AssetInstrumentCategoryCode = dr["PAIC_AssetInstrumentCategoryCode"].ToString();
                    pensionAndGratuitiesVo.AssetGroupCode = dr["PAG_AssetGroupCode"].ToString();

                    pensionAndGratuitiesVo.FiscalYearCode = dr["XFY_FiscalYearCode"].ToString();
                    pensionAndGratuitiesVo.InterestPayableFrequencyCode  = dr["XF_InterestPayableFrequencyCode"].ToString();
                    pensionAndGratuitiesVo.CompoundInterestFrequencyCode = dr["XF_CompoundInterestFrequencyCode"].ToString();
                    pensionAndGratuitiesVo.InterestRate           = float.Parse(dr["CPGNP_InterestRate"].ToString());
                    pensionAndGratuitiesVo.OrganizationName       = dr["CPGNP_OrganizationName"].ToString();
                    pensionAndGratuitiesVo.DepositAmount          = float.Parse(dr["CPGNP_DepositAmount"].ToString());
                    pensionAndGratuitiesVo.CurrentValue           = float.Parse(dr["CPGNP_CurrentValue"].ToString());
                    pensionAndGratuitiesVo.InterestBasis          = dr["XIB_InterestBasisCode"].ToString();
                    pensionAndGratuitiesVo.IsInterestAccumalated  = int.Parse(dr["CPGNP_IsInterestAccumalated"].ToString());
                    pensionAndGratuitiesVo.InterestAmtAccumalated = float.Parse(dr["CPGNP_InterestAmtAccumalated"].ToString());
                    pensionAndGratuitiesVo.InterestAmtPaidOut     = float.Parse(dr["CPGNP_InterestAmtPaidOut"].ToString());

                    if (dr["CPGNP_EmployeeContri"].ToString() != "")
                    {
                        pensionAndGratuitiesVo.EmployeeContribution = float.Parse(dr["CPGNP_EmployeeContri"].ToString());
                    }
                    else
                    {
                        pensionAndGratuitiesVo.EmployeeContribution = 0;
                    }
                    if (dr["CPGNP_EmployerContri"].ToString() != "")
                    {
                        pensionAndGratuitiesVo.EmployerContribution = float.Parse(dr["CPGNP_EmployerContri"].ToString());
                    }
                    else
                    {
                        pensionAndGratuitiesVo.EmployerContribution = 0;
                    }
                    if (dr["CPGNP_Remark"].ToString() != "")
                    {
                        pensionAndGratuitiesVo.Remarks = dr["CPGNP_Remark"].ToString();
                    }
                    else
                    {
                        pensionAndGratuitiesVo.Remarks = "";
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PensionAndGratuitiesDao.cs:GetPensionAndGratuities()");

                object[] objects = new object[1];
                objects[0]   = portfolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(pensionAndGratuitiesVo);
        }
Beispiel #11
0
        public DataTable downloadBSEEquityData(int UserId, DateTime Startdate, DateTime EndDate)
        {
            string pathval = System.AppDomain.CurrentDomain.BaseDirectory;

            if (pathval.EndsWith("\\bin\\Debug\\"))
            {
                pathval = pathval.Replace("\\bin\\Debug", "");
            }

            string pathNse    = Path.Combine(pathval, @"MarketDataDownloadFiles\BseEquities.zip");
            string pathFilter = Path.Combine(pathval, @"MarketDataDownloadFiles\BseEquitiesFiltered.txt");
            //string pathXml = Path.Combine(pathval, @"MarketDataDownloadFiles\BseEquities.xml");
            string pathextract    = Path.Combine(pathval, @"MarketDataDownloadFiles");
            string pathEquityFile = Path.Combine(pathval, @"MarketDataDownloadFiles\BseEquities.CSV");
            string Downloadtype   = "BSEEquities";

            MarketDataPullDao marketdatapullDao = new MarketDataPullDao();
            DataTable         dtResult          = new DataTable("BseDownloadResult");

            dtResult.Columns.Add("Date", typeof(string));
            dtResult.Columns.Add("Result", typeof(string));
            dtResult.Columns.Add("NumofRecords", typeof(int));
            DataRow  dr;
            DateTime date = Startdate;



            do
            {
                bool   result = true;
                string ProcessStatus_BSEEqt = "";
                int    num_of_rec_BSEEqt    = -1;
                //date = CEodFetch.ValidateDay(date);

                string   fetchData   = CEodFetch.GetDownloads(date);
                string[] splitstring = fetchData.Split(new Char[] { '_' });

                ProductPriceDownloadLogBo productPriceDownloadLogBo = new ProductPriceDownloadLogBo();
                AdminDownloadProcessLogVo processLogVo = new AdminDownloadProcessLogVo();
                processLogVo.CreatedBy  = UserId;
                processLogVo.AssetClass = "Equity";
                processLogVo.SourceName = "BSE";
                processLogVo.StartTime  = DateTime.Now;
                processLogVo.EndTime    = DateTime.Now;
                processLogVo.ModifiedOn = DateTime.Now;
                processLogVo.ModifiedBy = UserId;
                processLogVo.ForDate    = date;
                //Create a process for the download
                processLogVo.ProcessID = productPriceDownloadLogBo.CreateProcessLog(processLogVo);

                try
                {
                    //// Create a new WebClient instance.
                    WebClient myWebClient = new WebClient();

                    // Concatenate the domain with the Web resource filename.
                    string myStringWebResource = fetchData + pathNse;

                    myWebClient.DownloadFile(fetchData, pathNse);
                    processLogVo.IsConnectionToSiteEstablished = 1;


                    //Zip Extracting Code
                    FastZip fz = new FastZip();
                    fz.ExtractZip(pathNse, pathextract, "");
                    processLogVo.IsFileDownloaded = 1;
                    result = productPriceDownloadLogBo.UpdateProcessLog(processLogVo);
                    //filename convert

                    string pathBSE = Path.Combine(pathval, @"MarketDataDownloadFiles\") + CEodFetch.GetDownloadFile(date, Downloadtype);

                    FileInfo renamefile = new FileInfo(pathBSE);
                    if (renamefile.Exists)
                    {
                        File.Delete(pathEquityFile);
                        File.Move(pathBSE, pathEquityFile);
                    }
                    if (!String.IsNullOrEmpty(fetchData))
                    {
                        if (result)
                        {
                            Console.WriteLine("Writing into a text file........");
                            //Create a stream reader for the text file
                            StreamReader  sr         = new StreamReader(pathEquityFile);
                            StringBuilder strNewData = new StringBuilder();
                            String        line;

                            //Omit lines which are there in the text files
                            //for information purpose
                            while ((line = sr.ReadLine()) != null)
                            {
                                if (line.Contains(","))
                                {
                                    strNewData.AppendLine(line);
                                }
                            }
                            sr.Close();

                            //Create Filtered Data text file
                            result = CEodFetch.WriteToFile(pathFilter, strNewData.ToString());

                            if (result)
                            {
                                //Create Data Set from the filtered data
                                DataSet ds = TextToDataSet.GetBSEEquitiesDataSet(pathFilter, date);


                                if (null != ds)
                                {
                                    processLogVo.NoOfRecordsDownloaded = ds.Tables[0].Rows.Count;
                                    //Create an XML file from the Created Data set
                                    ds.WriteXml(Path.Combine(pathval, @"MarketDataDownloadFiles\" + processLogVo.ProcessID + ".xml"), XmlWriteMode.WriteSchema);;
                                    processLogVo.IsConversiontoXMLComplete = 1;
                                    processLogVo.XMLFileName = processLogVo.ProcessID + ".xml";
                                    result = productPriceDownloadLogBo.UpdateProcessLog(processLogVo);

                                    //insert into bse temp table

                                    result = marketdatapullDao.InsertDataToTemp(ds, "BSE");


                                    if (result)
                                    {
                                        num_of_rec_BSEEqt = marketdatapullDao.InsertDataintoMarketPriceTable(date, "BSE");
                                        if (num_of_rec_BSEEqt == 0)
                                        {
                                            ProcessStatus_BSEEqt             = "Latest data already exists in the database for the date : " + date + "";
                                            processLogVo.NoOfRecordsInserted = num_of_rec_BSEEqt;
                                            processLogVo.Description         = ProcessStatus_BSEEqt;
                                        }
                                        else
                                        {
                                            ProcessStatus_BSEEqt             = "Data Updated successfully into the table";
                                            processLogVo.NoOfRecordsInserted = num_of_rec_BSEEqt;
                                            processLogVo.IsInsertiontoDBdone = 1;
                                            processLogVo.Description         = ProcessStatus_BSEEqt;
                                        }
                                    }
                                }
                                else
                                {
                                    ProcessStatus_BSEEqt = "Could not create data set from the filtered data!";
                                    num_of_rec_BSEEqt    = 0;
                                    processLogVo.NoOfRecordsDownloaded = num_of_rec_BSEEqt;
                                    processLogVo.Description           = ProcessStatus_BSEEqt;
                                }
                            }
                            else
                            {
                                ProcessStatus_BSEEqt = "Could not write the filtered data to the disk!";
                                num_of_rec_BSEEqt    = 0;
                                processLogVo.NoOfRecordsDownloaded = num_of_rec_BSEEqt;
                                processLogVo.Description           = ProcessStatus_BSEEqt;
                            }
                        }

                        else
                        {
                            ProcessStatus_BSEEqt = "Could not write the downloaded data to the disk!";
                            num_of_rec_BSEEqt    = 0;
                            processLogVo.NoOfRecordsDownloaded = num_of_rec_BSEEqt;
                            processLogVo.Description           = ProcessStatus_BSEEqt;
                        }
                    }
                }
                catch (BaseApplicationException Ex)
                {
                    throw Ex;
                }
                catch (WebException Ex)
                {
                    ProcessStatus_BSEEqt = "Data not available on the site!";
                    num_of_rec_BSEEqt    = 0;
                    processLogVo.NoOfRecordsDownloaded = num_of_rec_BSEEqt;
                    processLogVo.Description           = ProcessStatus_BSEEqt;
                }
                catch (Exception Ex)
                {
                    result = false;
                    ProcessStatus_BSEEqt = "Stacktrace --- :" + Ex.StackTrace + "---Inner Ex:" + Ex.InnerException;

                    processLogVo.Description = ProcessStatus_BSEEqt;

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

                    FunctionInfo.Add("downloadBSEEquityData", "MarketDataPullBo.cs:GetProcessLog()");

                    object[] objects = new object[3];
                    objects[0] = UserId;
                    objects[1] = Startdate;
                    objects[2] = EndDate;

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

                processLogVo.EndTime = DateTime.Now;
                result             = productPriceDownloadLogBo.UpdateProcessLog(processLogVo);
                dr                 = dtResult.NewRow();
                dr["Date"]         = date.ToShortDateString();
                dr["Result"]       = ProcessStatus_BSEEqt;
                dr["NumofRecords"] = num_of_rec_BSEEqt;
                dtResult.Rows.Add(dr);
                date = date.AddDays(1);
            } while (date <= EndDate);

            DataTable dtresulttable = dtResult;

            return(dtResult);
        }
        public bool CreatePensionAndGratuities(PensionAndGratuitiesVo pensionAndGratuitiesVo, int userId)
        {
            bool      bResult = false;
            Database  db;
            DbCommand createPensionAndGratuitiesCmd;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                createPensionAndGratuitiesCmd = db.GetStoredProcCommand("SP_CreatePensionAndGratuities");
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGA_AccountId", DbType.Int32, pensionAndGratuitiesVo.AccountId);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@PAIC_AssetInstrumentCategoryCode", DbType.String, pensionAndGratuitiesVo.AssetInstrumentCategoryCode);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@PAG_AssetGroupCode", DbType.String, pensionAndGratuitiesVo.AssetGroupCode);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_OrganizationName", DbType.String, pensionAndGratuitiesVo.OrganizationName);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_DepositAmount", DbType.Double, pensionAndGratuitiesVo.DepositAmount);
                if (pensionAndGratuitiesVo.FiscalYearCode != "")
                {
                    db.AddInParameter(createPensionAndGratuitiesCmd, "@XFY_FiscalYearCode", DbType.String, pensionAndGratuitiesVo.FiscalYearCode);
                }
                else
                {
                    db.AddInParameter(createPensionAndGratuitiesCmd, "@XFY_FiscalYearCode", DbType.String, DBNull.Value);
                }
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_EmployeeContri", DbType.Double, pensionAndGratuitiesVo.EmployeeContribution);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_EmployerContri", DbType.Double, pensionAndGratuitiesVo.EmployerContribution);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_InterestRate", DbType.Double, pensionAndGratuitiesVo.InterestRate);
                if (pensionAndGratuitiesVo.InterestBasis != "")
                {
                    db.AddInParameter(createPensionAndGratuitiesCmd, "@XIB_InterestBasisCode", DbType.String, pensionAndGratuitiesVo.InterestBasis);
                }
                else
                {
                    db.AddInParameter(createPensionAndGratuitiesCmd, "@XIB_InterestBasisCode", DbType.String, DBNull.Value);
                }
                if (pensionAndGratuitiesVo.CompoundInterestFrequencyCode != "")
                {
                    db.AddInParameter(createPensionAndGratuitiesCmd, "@XF_CompoundInterestFrequencyCode", DbType.String, pensionAndGratuitiesVo.CompoundInterestFrequencyCode);
                }
                else
                {
                    db.AddInParameter(createPensionAndGratuitiesCmd, "@XF_CompoundInterestFrequencyCode", DbType.String, DBNull.Value);
                }

                if (pensionAndGratuitiesVo.InterestPayableFrequencyCode != "")
                {
                    db.AddInParameter(createPensionAndGratuitiesCmd, "@XF_InterestPayableFrequencyCode", DbType.String, pensionAndGratuitiesVo.InterestPayableFrequencyCode);
                }
                else
                {
                    db.AddInParameter(createPensionAndGratuitiesCmd, "@XF_InterestPayableFrequencyCode", DbType.String, DBNull.Value);
                }

                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_IsInterestAccumalated", DbType.Int16, pensionAndGratuitiesVo.IsInterestAccumalated);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_InterestAmtAccumalated", DbType.Double, pensionAndGratuitiesVo.InterestAmtAccumalated);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_InterestAmtPaidOut", DbType.Double, pensionAndGratuitiesVo.InterestAmtPaidOut);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_CurrentValue", DbType.Double, pensionAndGratuitiesVo.CurrentValue);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_Remark", DbType.String, pensionAndGratuitiesVo.Remarks);
                db.AddInParameter(createPensionAndGratuitiesCmd, "@CPGNP_CreatedBy", DbType.Int32, userId);

                if (db.ExecuteNonQuery(createPensionAndGratuitiesCmd) != 0)
                {
                    bResult = true;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PensionAndGratuitiesDao.cs:CreatePensionAndGratuities()");
                object[] objects = new object[2];
                objects[0]   = pensionAndGratuitiesVo;
                objects[1]   = userId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(bResult);
        }
        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);
        }
Beispiel #15
0
        /// <summary>
        /// Used for doing all the data validations for the the Uploads
        /// </summary>
        /// <param name="dtInputfile">Data table of the actual file which is being uploaded</param>
        /// <param name="Uploadtype">Type of R&T</param>
        /// <param name="Extracttype">Profile or Transaction Upload</param>
        /// <param name="Path">Path of the XML</param>
        /// <param name="Skiprowsval">Used for finding the index of the row which is being validated </param>
        /// <returns></returns>
        public DataTable InputValidation(DataTable dtInputfile, string Uploadtype, string Extracttype, string Path, int Skiprowsval)
        {
            DataTable dtresult = new DataTable();

            DataTable dtValidationColumns = new DataTable();

            try
            {
                dtInputfile.Columns.Add("Error", typeof(string));
                //dtresult = dtInputfile.Clone();

                //Get the columnnames for which the validations has to be done for the selected Upload type
                dtValidationColumns = XMLBo.GetUploadInpuValidationColumns(Uploadtype, Extracttype, Path);

                //Loop through the rows for which the validations must be done for the selected upload type
                foreach (DataRow drValidations in dtValidationColumns.Rows)
                {
                    string columnname = drValidations["ColumnName"].ToString();
                    dtresult.Columns.Add(columnname);
                    //Loop through the column names in the input table

                    foreach (DataColumn dcInputFile in dtInputfile.Columns)
                    {
                        if (dcInputFile.ColumnName.ToString() == drValidations["ColumnName"].ToString())
                        {
                            int rowindex = Skiprowsval;
                            //Perform null check for the columnname if flag is set as 1 for the selected column
                            foreach (DataRow drInputfile in dtInputfile.Rows)
                            {
                                rowindex++;
                                //if (drValidations["CheckNull"].ToString() == "1")
                                //{

                                //    if (String.IsNullOrEmpty(drInputfile[columnname].ToString()))
                                //    {
                                //        drInputfile["Error"] = drInputfile["Error"].ToString()+"Invalida data in " + columnname + ",Line:"+rowindex+";";
                                //        continue;
                                //    }

                                //}

                                //Perform Is Numeric check for the columnname if flag is set as 1 for the selected column
                                if (drValidations["CheckNumeric"].ToString() == "1")
                                {
                                    double Num;
                                    //Update value as zero if null
                                    if (String.IsNullOrEmpty(drInputfile[columnname].ToString()))
                                    {
                                        drInputfile[columnname] = 0;
                                        continue;
                                    }
                                    //Update Error field if not numeric
                                    if (double.TryParse(drInputfile[columnname].ToString(), out Num) == false)
                                    {
                                        drInputfile["Error"] = drInputfile["Error"].ToString() + "Invalida data in " + columnname + ",Line:" + rowindex + ";";
                                        continue;
                                    }
                                }

                                //Perform Date check for the columnname if flag is set as 1 for the selected column
                                if (drValidations["CheckDate"].ToString() == "1")
                                {
                                    DateTime date;
                                    if (DateTime.TryParse(drInputfile[columnname].ToString(), out date) == false)
                                    {
                                        drInputfile["Error"] = drInputfile["Error"].ToString() + "Invalida data in " + columnname + ",Line:" + rowindex + ";";
                                        continue;
                                    }
                                }

                                //Perform Length check for the columnname if flag is set as 1 for the selected column
                                if (drValidations["CheckLengthVal"].ToString() != "0")
                                {
                                    //break;
                                }
                            }
                        }
                    }
                }
                dtresult.Columns.Add("Error");
                //Select error rows and assign to resultant table
                DataRow[] drresults = dtInputfile.Select("Error is not null");
                foreach (DataRow dr in drresults)
                {
                    dtresult.ImportRow(dr);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "UploadValidationBo.cs:InputValidation()");


                object[] objects = new object[5];
                objects[0] = dtInputfile;
                objects[1] = Uploadtype;
                objects[2] = Extracttype;
                objects[3] = Path;
                objects[4] = Skiprowsval;

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

            return(dtresult);
        }
        public void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //               customerExpenseVo.DateOfEntry = DateBo.GetFormattedDate(Convert.ToDateTime(txtDateOfEntry.Text.ToString()),"en-GB");
                customerExpenseVo.DateOfEntry                = Convert.ToDateTime(txtDateOfEntry.Text.ToString());
                customerExpenseVo.Transportation             = Double.Parse(txtTranMonthly.Text.ToString());
                customerExpenseVo.TransportationYr           = Double.Parse(txtTranYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeTransportation = int.Parse(ddlTranCurrency.SelectedValue.ToString());
                customerExpenseVo.Food                      = Double.Parse(txtFoodMonthly.Text.ToString());
                customerExpenseVo.FoodYr                    = Double.Parse(txtFoodYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeFood          = int.Parse(ddlFoodCurrency.SelectedValue.ToString());
                customerExpenseVo.Clothing                  = Double.Parse(txtCloMonthly.Text.ToString());
                customerExpenseVo.ClothingYr                = Double.Parse(txtCloYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeClothing      = int.Parse(ddlCloCurrency.SelectedValue.ToString());
                customerExpenseVo.Home                      = Double.Parse(txtHomeMonthly.Text.ToString());
                customerExpenseVo.HomeYr                    = Double.Parse(txtHomeYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeHome          = int.Parse(ddlHomeCurrency.SelectedValue.ToString());
                customerExpenseVo.Utilities                 = Double.Parse(txtUtiMonthly.Text.ToString());
                customerExpenseVo.UtilitiesYr               = Double.Parse(txtUtiYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeUtilities     = int.Parse(ddlUtiCurrency.SelectedValue.ToString());
                customerExpenseVo.SelfCare                  = Double.Parse(txtSCMonthly.Text.ToString());
                customerExpenseVo.SelfCareYr                = Double.Parse(txtSCYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeSelfCare      = int.Parse(ddlSCCurrency.SelectedValue.ToString());
                customerExpenseVo.HealthCare                = Double.Parse(txtHCMonthly.Text.ToString());
                customerExpenseVo.HealthCareYr              = Double.Parse(txtHCYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeHealthCare    = int.Parse(ddlHCCurrency.SelectedValue.ToString());
                customerExpenseVo.Education                 = Double.Parse(txtEduMonthly.Text.ToString());
                customerExpenseVo.EducationYr               = Double.Parse(txtEduYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeEducation     = int.Parse(ddlEduCurrency.SelectedValue.ToString());
                customerExpenseVo.Pets                      = Double.Parse(txtPetsMonthly.Text.ToString());
                customerExpenseVo.PetsYr                    = Double.Parse(txtPetsYearly.Text.ToString());
                customerExpenseVo.CurrencyCodePets          = int.Parse(ddlPetsCurrency.SelectedValue.ToString());
                customerExpenseVo.Entertainment             = Double.Parse(txtEntMonthly.Text.ToString());
                customerExpenseVo.EntertainmentYr           = Double.Parse(txtEntYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeEntertainment = int.Parse(ddlEntCurrency.SelectedValue.ToString());
                customerExpenseVo.Miscellaneous             = Double.Parse(txtMisMonthly.Text.ToString());
                customerExpenseVo.MiscellaneousYr           = Double.Parse(txtMisYearly.Text.ToString());
                customerExpenseVo.CurrencyCodeMiscellaneous = int.Parse(ddlMisCurrency.SelectedValue.ToString());
                txttotal.Text        = (double.Parse(txtTranMonthly.Text) + double.Parse(txtFoodMonthly.Text) + double.Parse(txtCloMonthly.Text) + double.Parse(txtHomeMonthly.Text) + double.Parse(txtUtiMonthly.Text) + double.Parse(txtSCMonthly.Text) + double.Parse(txtHCMonthly.Text) + double.Parse(txtEduMonthly.Text) + double.Parse(txtPetsMonthly.Text) + double.Parse(txtEntMonthly.Text) + double.Parse(txtMisMonthly.Text)).ToString();
                txttotalyear.Text    = (double.Parse(txtTranYearly.Text) + double.Parse(txtFoodYearly.Text) + double.Parse(txtCloYearly.Text) + double.Parse(txtHomeYearly.Text) + double.Parse(txtUtiYearly.Text) + double.Parse(txtSCYearly.Text) + double.Parse(txtHCYearly.Text) + double.Parse(txtEduYearly.Text) + double.Parse(txtPetsYearly.Text) + double.Parse(txtEntYearly.Text) + double.Parse(txtMisYearly.Text)).ToString();
                txttotalyear.Visible = true;
                txttotal.Visible     = true;
                lbltotal.Visible     = true;
                ddlTotal.Visible     = true;
                if (btnSave.Text == "Save")
                {
                    customerBo.AddCustomerExpenseDetails(rmVo.UserId, customerVo.CustomerId, customerExpenseVo);
                    DisableAllControls();
                    btnSave.Visible      = false;
                    btnEdit.Visible      = true;
                    txttotalyear.Visible = true;
                    txttotal.Visible     = true;
                    lbltotal.Visible     = true;
                    ddlTotal.Visible     = true;
                }
                else
                {
                    customerBo.UpdateCustomerExpenseDetails(rmVo.UserId, customerVo.CustomerId, customerExpenseVo);
                    DisableAllControls();
                    btnSave.Visible = false;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerExpense.ascx:btnSave_Click()");
                object[] objects = new object[2];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                path       = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                userVo     = (UserVo)Session["userVo"];
                customerVo = (CustomerVo)Session["CustomerVo"];
                RMVo customerRMVo = new RMVo();
                if (customerVo.SubType == "MNR")
                {
                    trGuardianName.Visible = true;
                }
                else
                {
                    trGuardianName.Visible = false;
                }
                if (userVo.UserType.Trim() == "Adviser" || userVo.UserType.Trim() == "RM" || userVo.UserType.Trim() == "Branch Man" || userVo.UserType.Trim() == "Advisor")
                {
                    trDelete.Visible = true;
                }
                else
                {
                    trDelete.Visible = false;
                }

                if (customerVo.ProfilingDate.Year == 1800 || customerVo.ProfilingDate == DateTime.MinValue)
                {
                    lblProfilingDate.Text = "";
                }
                else
                {
                    lblProfilingDate.Text = customerVo.ProfilingDate.ToShortDateString().ToString();
                }
                if (customerVo.Dob.Year == 1800 || customerVo.Dob == DateTime.MinValue)
                {
                    lblDob.Text = "";
                }
                else
                {
                    lblDob.Text = customerVo.Dob.ToShortDateString().ToString();
                }

                //hdnassociationcount.Value = customerBo.GetAssociationCount("C", customerVo.CustomerId).ToString();
                lblGuardianName.Text = customerVo.ContactFirstName + " " + customerVo.ContactMiddleName + " " + customerVo.ContactLastName;
                lblName.Text         = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString();
                lblCustCode.Text     = customerVo.CustCode.ToString();
                lblPanNum.Text       = customerVo.PANNum.ToString();
                lblCorrLine1.Text    = customerVo.Adr1Line1.ToString();
                lblCorrLine2.Text    = customerVo.Adr1Line2.ToString();
                lblCorrLine3.Text    = customerVo.Adr1Line3.ToString();
                lblCorrPinCode.Text  = customerVo.Adr1PinCode.ToString();
                lblCorrCity.Text     = customerVo.Adr1City.ToString();
                if (customerVo.BranchName != null && customerVo.BranchName.ToString() != "")
                {
                    lblBranch.Text = customerVo.BranchName.ToString();
                }
                else
                {
                    lblBranch.Text = "";
                }
                customerRMVo = adviserStaffBo.GetAdvisorStaffDetails(customerVo.RmId);
                if (customerRMVo.FirstName + " " + customerRMVo.MiddleName + " " + customerRMVo.LastName != null && (customerRMVo.FirstName + " " + customerRMVo.MiddleName + " " + customerRMVo.LastName).ToString() != "")
                {
                    lblRM.Text = customerRMVo.FirstName + " " + customerRMVo.MiddleName + " " + customerRMVo.LastName;
                }
                else
                {
                    lblRM.Text = "";
                }

                if (customerVo.JobStartDate.Year == 1800 || customerVo.JobStartDate == DateTime.MinValue)
                {
                    lblJobStart.Text = "";
                }
                else
                {
                    lblJobStart.Text = customerVo.JobStartDate.ToShortDateString().ToString();
                }

                if (customerVo.ResidenceLivingDate.Year == 1800 || customerVo.ResidenceLivingDate == DateTime.MinValue)
                {
                    lblLiving.Text = "";
                }
                else
                {
                    lblLiving.Text = customerVo.ResidenceLivingDate.ToShortDateString().ToString();
                }

                if (customerVo.Adr1State == "")
                {
                    lblCorrState.Text = "";
                }
                else
                {
                    lblCorrState.Text = XMLBo.GetStateName(path, customerVo.Adr1State.ToString());
                }

                lblMotherMaiden.Text = customerVo.MothersMaidenName.ToString();
                lblCorrCountry.Text  = customerVo.Adr1Country.ToString();
                lblPermLine1.Text    = customerVo.Adr2Line1.ToString();
                lblPermLine2.Text    = customerVo.Adr2Line2.ToString();
                lblPermLine3.Text    = customerVo.Adr2Line3.ToString();
                lblPermPinCode.Text  = customerVo.Adr2PinCode.ToString();
                lblPermCity.Text     = customerVo.Adr2City.ToString();
                if (customerVo.Adr2State == "")
                {
                    lblPermState.Text = "";
                }
                else
                {
                    lblPermState.Text = XMLBo.GetStateName(path, customerVo.Adr2State.ToString());
                }

                lblPermCountry.Text = customerVo.Adr2Country.ToString();
                lblCompanyName.Text = customerVo.CompanyName.ToString();
                lblOfcLine1.Text    = customerVo.OfcAdrLine1.ToString();
                lblOfcLine2.Text    = customerVo.OfcAdrLine2.ToString();
                lblOfcLine3.Text    = customerVo.OfcAdrLine3.ToString();
                lblOfcPinCode.Text  = customerVo.OfcAdrPinCode.ToString();
                lblOfcCity.Text     = customerVo.OfcAdrCity.ToString();

                if (customerVo.OfcAdrState == "")
                {
                    lblOfcState.Text = "";
                }
                else
                {
                    lblOfcState.Text = XMLBo.GetStateName(path, customerVo.OfcAdrState.ToString());
                }
                lblOfcCountry.Text = customerVo.OfcAdrCountry.ToString();
                lblResPhone.Text   = customerVo.ResISDCode.ToString() + "-" + customerVo.ResSTDCode.ToString() + "-" + customerVo.ResPhoneNum.ToString();
                lblOfcPhone.Text   = customerVo.OfcISDCode.ToString() + "-" + customerVo.OfcSTDCode.ToString() + "-" + customerVo.OfcPhoneNum.ToString();
                lblOfcFax.Text     = customerVo.OfcISDFax.ToString() + "-" + customerVo.OfcSTDFax.ToString() + "-" + customerVo.OfcFax.ToString();
                lblResFax.Text     = customerVo.ISDFax.ToString() + "-" + customerVo.STDFax.ToString() + "-" + customerVo.Fax.ToString();
                lblMobile1.Text    = customerVo.Mobile1.ToString();
                lblMobile2.Text    = customerVo.Mobile2.ToString();
                lblEmail.Text      = customerVo.Email.ToString();
                lblAltEmail.Text   = customerVo.AltEmail.ToString();
                if (customerVo.DummyPAN == 1)
                {
                    chkdummypan.Checked = true;
                }
                else
                {
                    chkdummypan.Checked = false;
                }
                if (customerVo.IsProspect == 1)
                {
                    chkprospect.Checked = true;
                }
                else
                {
                    chkprospect.Checked = false;
                }
                if (customerVo.ViaSMS == 1)
                {
                    chksms.Checked = true;
                }
                else
                {
                    chksms.Checked = false;
                }
                if (customerVo.AlertViaEmail == 1)
                {
                    chkmail.Checked = true;
                }
                else
                {
                    chkmail.Checked = false;
                }

                if (customerVo.Occupation != null)
                {
                    lblOccupation.Text = XMLBo.GetOccupationName(path, customerVo.Occupation.ToString());
                }
                else
                {
                    lblOccupation.Text = "";
                }
                if (customerVo.MaritalStatus != null)
                {
                    lblMaritalStatus.Text = XMLBo.GetMaritalStatusName(path, customerVo.MaritalStatus.ToString());
                }
                else
                {
                    lblMaritalStatus.Text = "";
                }
                if (customerVo.MarriageDate.Year == 1800 || customerVo.MarriageDate == DateTime.MinValue)
                {
                    lblMarriageDate.Text = "";
                }
                else
                {
                    lblMarriageDate.Text = customerVo.MarriageDate.ToShortDateString();
                }
                if (customerVo.Qualification != null)
                {
                    lblQualification.Text = XMLBo.GetQualificationName(path, customerVo.Qualification.ToString());
                }
                else
                {
                    lblQualification.Text = "";
                }
                if (customerVo.Nationality != null)
                {
                    lblNationality.Text = XMLBo.GetNationalityName(path, customerVo.Nationality.ToString());
                }
                else
                {
                    lblNationality.Text = "";
                }
                lblRBIRefNo.Text = customerVo.RBIRefNum.ToString();
                if (customerVo.RBIApprovalDate.Year == 1800 || customerVo.RBIApprovalDate == DateTime.MinValue)

                {
                    lblRBIRefDate.Text = "";
                }
                else
                {
                    lblRBIRefDate.Text = customerVo.RBIApprovalDate.ToShortDateString().ToString();
                }
                if (customerVo.Nationality != null)
                {
                    lblNationality.Text = XMLBo.GetNationalityName(path, customerVo.Nationality.ToString());
                }
                else
                {
                    lblNationality.Text = "";
                }
                lblType.Text    = XMLBo.GetCustomerTypeName(path, customerVo.Type);
                lblSubType.Text = XMLBo.GetCustomerSubTypeName(path, customerVo.SubType);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "ViewCustomerIndividualProfile.ascx:Page_Load()");
                object[] objects = new object[3];
                objects[0]   = customerVo;
                objects[1]   = path;
                objects[2]   = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        /// <summary>
        /// It will get the Customer Details and returns their Expense details based on that Customer
        /// </summary>
        /// <param name="customerId"></param>
        public void GetCustomerExpenseDetails(int customerId)
        {
            try
            {
                DataTable  dtExpenseDetails = new DataTable();
                CustomerBo customerBo       = new CustomerBo();
                dtExpenseDetails = customerBo.GetCustomerExpenseDetails(customerId);
                if (dtExpenseDetails.Rows.Count == 0)
                {
                    btnEdit.Visible = false;
                    btnSave.Text    = "Save";
                    EnableAllControls();
                }
                else
                {
                    if (dtExpenseDetails.Rows[0]["CE_Transportation"].ToString() != "")
                    {
                        txtTranMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Transportation"].ToString()));
                        txtTranYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Transportation"].ToString()) * 12).ToString();
                        ddlTranCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeTransportation"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_Food"].ToString() != "")
                    {
                        txtFoodMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Food"].ToString()));
                        txtFoodYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Food"].ToString()) * 12).ToString();
                        ddlFoodCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeFood"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_Clothing"].ToString() != "")
                    {
                        txtCloMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Clothing"].ToString()));
                        txtCloYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Clothing"].ToString()) * 12).ToString();
                        ddlCloCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeClothing"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_Home"].ToString() != "")
                    {
                        txtHomeMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Home"].ToString()));
                        txtHomeYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Home"].ToString()) * 12).ToString();
                        ddlHomeCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeHome"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_Utilities"].ToString() != "")
                    {
                        txtUtiMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Utilities"].ToString()));
                        txtUtiYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Utilities"].ToString()) * 12).ToString();
                        ddlUtiCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeUtilities"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_SelfCare"].ToString() != "")
                    {
                        txtSCMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_SelfCare"].ToString()));
                        txtSCYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_SelfCare"].ToString()) * 12).ToString();
                        ddlSCCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeSelfCare"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_HealthCare"].ToString() != "")
                    {
                        txtHCMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_HealthCare"].ToString()));
                        txtHCYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_HealthCare"].ToString()) * 12).ToString();
                        ddlHCCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeHealthCare"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_Education"].ToString() != "")
                    {
                        txtEduMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Education"].ToString()));
                        txtEduYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Education"].ToString()) * 12).ToString();
                        ddlEduCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeEducation"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_Pets"].ToString() != "")
                    {
                        txtPetsMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Pets"].ToString()));
                        txtPetsYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Pets"].ToString()) * 12).ToString();
                        ddlPetsCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodePets"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_Entertainment"].ToString() != "")
                    {
                        txtEntMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Entertainment"].ToString()));
                        txtEntYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Entertainment"].ToString()) * 12).ToString();
                        ddlEntCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeEntertainment"].ToString();
                    }
                    if (dtExpenseDetails.Rows[0]["CE_Miscellaneous"].ToString() != "")
                    {
                        txtMisMonthly.Text           = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Miscellaneous"].ToString()));
                        txtMisYearly.Text            = String.Format("{0:0.00}", decimal.Parse(dtExpenseDetails.Rows[0]["CE_Miscellaneous"].ToString()) * 12).ToString();
                        ddlMisCurrency.SelectedValue = dtExpenseDetails.Rows[0]["XC_CurrencyCodeMiscellaneous"].ToString();
                    }

                    txttotal.Text = (double.Parse(txtTranMonthly.Text) + double.Parse(txtFoodMonthly.Text) + double.Parse(txtCloMonthly.Text) + double.Parse(txtHomeMonthly.Text) + double.Parse(txtUtiMonthly.Text) + double.Parse(txtSCMonthly.Text) + double.Parse(txtHCMonthly.Text) + double.Parse(txtEduMonthly.Text) + double.Parse(txtPetsMonthly.Text) + double.Parse(txtEntMonthly.Text) + double.Parse(txtMisMonthly.Text)).ToString();


                    txttotalyear.Text = (double.Parse(txtTranYearly.Text) + double.Parse(txtFoodYearly.Text) + double.Parse(txtCloYearly.Text) + double.Parse(txtHomeYearly.Text) + double.Parse(txtUtiYearly.Text) + double.Parse(txtSCYearly.Text) + double.Parse(txtHCYearly.Text) + double.Parse(txtEduYearly.Text) + double.Parse(txtPetsYearly.Text) + double.Parse(txtEntYearly.Text) + double.Parse(txtMisYearly.Text)).ToString();


                    if (dtExpenseDetails.Rows[0]["CE_DateOfEntry"].ToString() != "")
                    {
                        txtDateOfEntry.Text = DateTime.Parse(dtExpenseDetails.Rows[0]["CE_DateOfEntry"].ToString()).ToShortDateString();
                    }

                    btnEdit.Visible = true;
                    btnSave.Text    = "Update";
                    btnSave.Visible = false;
                    DisableAllControls();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerIncome.ascx:GetCustomerIncomeDetails()");
                object[] objects = new object[1];
                objects[0] = customerId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        private void BindDropDowns()
        {
            AdvisorVo advisorVo = new AdvisorVo();

            try
            {
                dtMaritalStatus                 = XMLBo.GetMaritalStatus(path);
                ddlMaritalStatus.DataSource     = dtMaritalStatus;
                ddlMaritalStatus.DataTextField  = "MaritalStatus";
                ddlMaritalStatus.DataValueField = "MaritalStatusCode";
                ddlMaritalStatus.DataBind();
                ddlMaritalStatus.Items.Insert(0, new ListItem("Select a Status", "Select a Status"));

                dtNationality                 = XMLBo.GetNationality(path);
                ddlNationality.DataSource     = dtNationality;
                ddlNationality.DataTextField  = "Nationality";
                ddlNationality.DataValueField = "NationalityCode";
                ddlNationality.DataBind();
                ddlNationality.Items.Insert(0, new ListItem("Select a Nationality", "Select a Nationality"));

                dtOccupation                 = XMLBo.GetOccupation(path);
                ddlOccupation.DataSource     = dtOccupation;
                ddlOccupation.DataTextField  = "Occupation";
                ddlOccupation.DataValueField = "OccupationCode";
                ddlOccupation.DataBind();
                ddlOccupation.Items.Insert(0, new ListItem("Select a Occupation", "Select a Occupation"));

                dtQualification                 = XMLBo.GetQualification(path);
                ddlQualification.DataSource     = dtQualification;
                ddlQualification.DataTextField  = "Qualification";
                ddlQualification.DataValueField = "QualificationCode";
                ddlQualification.DataBind();
                ddlQualification.Items.Insert(0, new ListItem("Select a Qualification", "Select a Qualification"));

                dtState = XMLBo.GetStates(path);

                ddlCorrAdrState.DataSource     = dtState;
                ddlCorrAdrState.DataTextField  = "StateName";
                ddlCorrAdrState.DataValueField = "StateCode";
                ddlCorrAdrState.DataBind();
                ddlCorrAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));

                ddlPermAdrState.DataSource     = dtState;
                ddlPermAdrState.DataTextField  = "StateName";
                ddlPermAdrState.DataValueField = "StateCode";
                ddlPermAdrState.DataBind();
                ddlPermAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));

                ddlOfcAdrState.DataSource     = dtState;
                ddlOfcAdrState.DataTextField  = "StateName";
                ddlOfcAdrState.DataValueField = "StateCode";
                ddlOfcAdrState.DataBind();
                ddlOfcAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State"));

                if (customerVo.Type.ToUpper().ToString() == "IND")
                {
                    dtCustomerSubType = XMLBo.GetCustomerSubType(path, "IND");
                }
                else
                {
                    dtCustomerSubType = XMLBo.GetCustomerSubType(path, "NIND");
                }
                ddlCustomerSubType.DataSource     = dtCustomerSubType;
                ddlCustomerSubType.DataTextField  = "CustomerTypeName";
                ddlCustomerSubType.DataValueField = "CustomerSubTypeCode";
                ddlCustomerSubType.DataBind();
                ddlCustomerSubType.SelectedValue = customerVo.SubType;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

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

                FunctionInfo.Add("Method", "EditCustomerIndividualProfile.ascx:BindDropDowns()");

                object[] objects = new object[0];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #20
0
        protected void BindGrid()
        {
            List <CustomerVo>           customerUserList  = null;
            DataTable                   dtRMCustomer      = new DataTable();
            Dictionary <string, string> genDictParent     = new Dictionary <string, string>();
            Dictionary <string, string> genDictRM         = new Dictionary <string, string>();
            Dictionary <string, string> genDicReassigntRM = new Dictionary <string, string>();


            try
            {
                // rmVo = (RMVo)Session["rmVo"];
                AdvisorVo advisorVo = new AdvisorVo();
                advisorVo = (AdvisorVo)Session["advisorVo"];

                int Count = 0;

                customerUserList  = advisorBo.GetAdviserCustomerList(advisorVo.advisorId, mypager.CurrentPage, out Count, "", "", hdnNameFilter.Value.Trim(), "", "", "", "", "", "0", out genDictParent, out genDictRM, out genDicReassigntRM);
                lblTotalRows.Text = hdnRecordCount.Value = Count.ToString();

                if (customerUserList != null)
                {
                    //lblMsg.Visible = false;
                    dtRMCustomer.Columns.Add("UserId");
                    dtRMCustomer.Columns.Add("CustomerName");
                    dtRMCustomer.Columns.Add("Login Id");
                    dtRMCustomer.Columns.Add("Email Id");
                    dtRMCustomer.Columns.Add("Password");

                    DataRow drRMCustomerUser;

                    for (int i = 0; i < customerUserList.Count; i++)
                    {
                        drRMCustomerUser = dtRMCustomer.NewRow();
                        customerVo       = new CustomerVo();
                        customerVo       = customerUserList[i];
                        userId           = customerVo.UserId;
                        userVo           = new UserVo();
                        userVo           = userBo.GetUserDetails(userId);

                        drRMCustomerUser[0] = userVo.UserId.ToString();
                        drRMCustomerUser[1] = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString();
                        drRMCustomerUser[2] = userVo.LoginId.ToString();
                        drRMCustomerUser[3] = userVo.Email.ToString();
                        drRMCustomerUser[4] = userVo.Password.ToString();
                        dtRMCustomer.Rows.Add(drRMCustomerUser);
                    }
                    gvCustomers.DataSource = dtRMCustomer;
                    gvCustomers.DataBind();

                    TextBox txtName = new TextBox();
                    if (gvCustomers.HeaderRow != null)
                    {
                        if ((TextBox)gvCustomers.HeaderRow.FindControl("txtCustNameSearch") != null)
                        {
                            txtName      = (TextBox)gvCustomers.HeaderRow.FindControl("txtCustNameSearch");
                            txtName.Text = hdnNameFilter.Value.Trim();
                        }
                    }
                    else
                    {
                        txtName = null;
                    }

                    if (trPagger.Visible == false)
                    {
                        trPagger.Visible = true;
                    }

                    this.GetPageCount();


                    if (btnGenerate.Visible == false)
                    {
                        btnGenerate.Visible = true;
                    }

                    if (mypager.Visible == false)
                    {
                        mypager.Visible = true;
                    }
                }
                else
                {
                    mypager.Visible = false;
                    //lblCurrentPage.Visible = false;
                    //lblTotalRows.Visible = false;
                    //tblPager.Visible = false;
                    // lblMsg.Visible = true;
                    tblMessage.Visible     = true;
                    ErrorMessage.Visible   = true;
                    SuccessMsg.Visible     = false;
                    trPagger.Visible       = false;
                    btnGenerate.Visible    = false;
                    ErrorMessage.InnerText = "No Records Found...!";
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "RMCustomerUserDetails.ascx:BindGrid()");
                object[] objects = new object[5];
                objects[0]   = customerId;
                objects[1]   = customerVo;
                objects[2]   = userVo;
                objects[3]   = userId;
                objects[4]   = rmVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Validation())
                {
                    customerVo.BranchId = int.Parse(ddlAdviserBranchList.SelectedValue.ToString());
                    //customerVo.Salutation = ddlSalutation.SelectedValue;
                    if (ddlSalutation.SelectedIndex == 0)
                    {
                        customerVo.Salutation = "";
                    }
                    else
                    {
                        customerVo.Salutation = ddlSalutation.SelectedValue.ToString();
                    }

                    customerVo.FirstName  = txtFirstName.Text;
                    customerVo.MiddleName = txtMiddleName.Text;
                    customerVo.LastName   = txtLastName.Text;
                    if (rbtnIndividual.Checked)
                    {
                        customerVo.Type = "IND";
                    }
                    else
                    {
                        customerVo.Type = "NIND";
                    }
                    customerVo.SubType = ddlCustomerSubType.SelectedItem.Value.ToString();

                    if (customerVo.SubType == "MNR")
                    {
                        customerVo.ContactMiddleName = txtGuardianMiddleName.Text;
                        customerVo.ContactLastName   = txtGuardianLastName.Text;
                        customerVo.ContactFirstName  = txtGuardianFirstName.Text;
                    }

                    if (txtDob.Text == "")
                    {
                        customerVo.Dob = DateTime.MinValue;
                    }
                    else
                    {
                        customerVo.Dob = DateTime.Parse(txtDob.Text);
                    }
                    if (txtProfilingDate.Text == "")
                    {
                        customerVo.ProfilingDate = DateTime.MinValue;
                    }
                    else
                    {
                        customerVo.ProfilingDate = DateTime.Parse(txtProfilingDate.Text);
                    }
                    customerVo.PANNum = txtPanNumber.Text;

                    customerVo.CustCode = txtCustomerCode.Text;



                    customerVo.Adr1Line1 = txtCorrAdrLine1.Text;
                    customerVo.Adr1Line2 = txtCorrAdrLine2.Text;
                    customerVo.Adr1Line3 = txtCorrAdrLine3.Text;
                    if (txtCorrAdrPinCode.Text == "")
                    {
                        customerVo.Adr1PinCode = 0;
                    }
                    else
                    {
                        customerVo.Adr1PinCode = int.Parse(txtCorrAdrPinCode.Text);
                    }
                    customerVo.Adr1City = txtCorrAdrCity.Text;
                    if (ddlCorrAdrState.SelectedIndex == 0)
                    {
                        customerVo.Adr1State = "";
                    }
                    else
                    {
                        customerVo.Adr1State = ddlCorrAdrState.SelectedValue.ToString();
                    }

                    customerVo.Adr1Country = txtCorrAdrCountry.Text.ToString();
                    customerVo.Adr2Line1   = txtPermAdrLine1.Text.ToString();
                    customerVo.Adr2Line2   = txtPermAdrLine2.Text.ToString();
                    customerVo.Adr2Line3   = txtPermAdrLine3.Text.ToString();
                    customerVo.Adr2City    = txtPermAdrCity.Text.ToString();
                    if (txtPermAdrPinCode.Text == "")
                    {
                        customerVo.Adr2PinCode = 0;
                    }
                    else
                    {
                        customerVo.Adr2PinCode = int.Parse(txtPermAdrPinCode.Text.ToString());
                    }
                    if (ddlPermAdrState.SelectedIndex == 0)
                    {
                        customerVo.Adr2State = "";
                    }
                    else
                    {
                        customerVo.Adr2State = ddlPermAdrState.SelectedValue.ToString();
                    }

                    customerVo.Adr2Country = txtPermAdrCountry.Text.ToString();
                    customerVo.OfcAdrLine1 = txtOfcAdrLine1.Text.ToString();
                    customerVo.OfcAdrLine2 = txtOfcAdrLine2.Text.ToString();
                    customerVo.OfcAdrLine3 = txtOfcAdrLine3.Text.ToString();
                    if (txtOfcAdrPinCode.Text == "")
                    {
                        customerVo.OfcAdrPinCode = 0;
                    }
                    else
                    {
                        customerVo.OfcAdrPinCode = int.Parse(txtOfcAdrPinCode.Text.ToString());
                    }

                    customerVo.OfcAdrCity = txtOfcAdrCity.Text.ToString();
                    if (ddlOfcAdrState.SelectedIndex == 0)
                    {
                        customerVo.OfcAdrState = "";
                    }
                    else
                    {
                        customerVo.OfcAdrState = ddlOfcAdrState.SelectedValue.ToString();
                    }

                    customerVo.OfcAdrCountry = txtOfcAdrCountry.Text.ToString();
                    customerVo.CompanyName   = txtOfcCompanyName.Text.ToString();
                    if (txtResPhoneNoIsd.Text == "")
                    {
                        customerVo.ResISDCode = 0;
                    }
                    else
                    {
                        customerVo.ResISDCode = int.Parse(txtResPhoneNoIsd.Text.ToString());
                    }

                    if (txtResPhoneNoStd.Text == "")
                    {
                        customerVo.ResSTDCode = 0;
                    }
                    else
                    {
                        customerVo.ResSTDCode = int.Parse(txtResPhoneNoStd.Text.ToString());
                    }

                    if (txtResPhoneNo.Text == "")
                    {
                        customerVo.ResPhoneNum = 0;
                    }
                    else
                    {
                        customerVo.ResPhoneNum = int.Parse(txtResPhoneNo.Text.ToString());
                    }

                    if (txtOfcPhoneNoIsd.Text == "")
                    {
                        customerVo.OfcISDCode = 0;
                    }
                    else
                    {
                        customerVo.OfcISDCode = int.Parse(txtOfcPhoneNoIsd.Text.ToString());
                    }

                    if (txtOfcPhoneNoStd.Text == "")
                    {
                        customerVo.OfcSTDCode = 0;
                    }
                    else
                    {
                        customerVo.OfcSTDCode = int.Parse(txtOfcPhoneNoStd.Text.ToString());
                    }

                    if (txtOfcPhoneNo.Text == "")
                    {
                        customerVo.OfcPhoneNum = 0;
                    }
                    else
                    {
                        customerVo.OfcPhoneNum = int.Parse(txtOfcPhoneNo.Text.ToString());
                    }

                    if (txtResFaxIsd.Text == "")
                    {
                        customerVo.ISDFax = 0;
                    }
                    else
                    {
                        customerVo.ISDFax = int.Parse(txtResFaxIsd.Text.ToString());
                    }

                    if (txtResFaxStd.Text == "")
                    {
                        customerVo.STDFax = 0;
                    }
                    else
                    {
                        customerVo.STDFax = int.Parse(txtResFaxStd.Text.ToString());
                    }

                    if (txtResFax.Text == "")
                    {
                        customerVo.Fax = 0;
                    }
                    else
                    {
                        customerVo.Fax = int.Parse(txtResFax.Text.ToString());
                    }

                    if (txtOfcFaxIsd.Text == "")
                    {
                        customerVo.OfcISDFax = 0;
                    }
                    else
                    {
                        customerVo.OfcISDFax = int.Parse(txtOfcFaxIsd.Text.ToString());
                    }

                    if (txtOfcFaxStd.Text == "")
                    {
                        customerVo.OfcSTDFax = 0;
                    }
                    else
                    {
                        customerVo.OfcSTDFax = int.Parse(txtOfcFaxStd.Text.ToString());
                    }

                    if (txtOfcFax.Text == "")
                    {
                        customerVo.OfcFax = 0;
                    }
                    else
                    {
                        customerVo.OfcFax = int.Parse(txtOfcFax.Text.ToString());
                    }

                    if (txtMobile1.Text == "")
                    {
                        customerVo.Mobile1 = 0;
                    }
                    else
                    {
                        customerVo.Mobile1 = long.Parse(txtMobile1.Text.ToString());
                    }

                    if (txtMobile2.Text == "")
                    {
                        customerVo.Mobile2 = 0;
                    }
                    else
                    {
                        customerVo.Mobile2 = long.Parse(txtMobile2.Text.ToString());
                    }

                    customerVo.Email    = txtEmail.Text.ToString();
                    customerVo.AltEmail = txtAltEmail.Text.ToString();

                    if (ddlOccupation.SelectedIndex == 0)
                    {
                        customerVo.Occupation = null;
                    }
                    else
                    {
                        customerVo.Occupation = ddlOccupation.SelectedItem.Value.ToString();
                    }

                    if (chkdummypan.Checked)
                    {
                        customerVo.DummyPAN = 1;
                    }
                    else
                    {
                        customerVo.DummyPAN = 0;
                    }
                    //if (chkprospect.Checked)
                    //{
                    //    customerVo.IsProspect = 1;
                    //}
                    //else
                    //{
                    //    customerVo.IsProspect = 0;
                    //}
                    if (chkmail.Checked)
                    {
                        customerVo.AlertViaEmail = 1;
                    }
                    else
                    {
                        customerVo.AlertViaEmail = 0;
                    }
                    if (chksms.Checked)
                    {
                        customerVo.ViaSMS = 1;
                    }
                    else
                    {
                        customerVo.ViaSMS = 0;
                    }


                    if (ddlQualification.SelectedIndex == 0)
                    {
                        customerVo.Qualification = null;
                    }
                    else
                    {
                        customerVo.Qualification = ddlQualification.SelectedItem.Value.ToString();
                    }

                    if (ddlNationality.SelectedIndex == 0)
                    {
                        customerVo.Nationality = null;
                    }
                    else
                    {
                        customerVo.Nationality = ddlNationality.SelectedItem.Value.ToString();
                    }


                    customerVo.RBIRefNum = txtRBIRefNo.Text.ToString();
                    if (txtRBIRefDate.Text == "")
                    {
                        //customerVo.RBIApprovalDate = DateTime.Parse("1/1/0001 12:00:00 AM");
                        customerVo.RBIApprovalDate = DateTime.MinValue;
                    }
                    else
                    {
                        customerVo.RBIApprovalDate = DateTime.Parse(txtRBIRefDate.Text.ToString());
                    }
                    if (ddlMaritalStatus.SelectedIndex == 0)
                    {
                        customerVo.MaritalStatus = null;
                    }
                    else
                    {
                        customerVo.MaritalStatus = ddlMaritalStatus.SelectedItem.Value.ToString();
                    }

                    if (txtMarriageDate.Text != string.Empty && txtMarriageDate.Text != "dd/mm/yyyy")
                    {
                        customerVo.MarriageDate = DateTime.Parse(txtMarriageDate.Text);
                    }
                    else
                    {
                        customerVo.MarriageDate = DateTime.MinValue;
                    }

                    if (txtLivingSince.Text == "")
                    {
                        customerVo.ResidenceLivingDate = DateTime.MinValue;
                    }
                    else
                    {
                        customerVo.ResidenceLivingDate = DateTime.Parse(txtLivingSince.Text.ToString());
                    }
                    if (txtJobStartDate.Text == "")
                    {
                        customerVo.JobStartDate = DateTime.MinValue;
                    }
                    else
                    {
                        customerVo.JobStartDate = DateTime.Parse(txtJobStartDate.Text.ToString());
                    }
                    customerVo.MothersMaidenName = txtMotherMaidenName.Text.ToString();

                    if (chkCorrPerm.Checked)
                    {
                        customerVo.Adr2City    = txtCorrAdrCity.Text;
                        customerVo.Adr2Country = txtCorrAdrCountry.Text;
                        customerVo.Adr2Line1   = txtCorrAdrLine1.Text;
                        customerVo.Adr2Line2   = txtCorrAdrLine2.Text;
                        customerVo.Adr2Line3   = txtCorrAdrLine3.Text;
                        customerVo.Adr2PinCode = int.Parse(txtCorrAdrPinCode.Text);
                        customerVo.Adr2State   = ddlCorrAdrState.SelectedItem.Value.ToString();
                    }


                    if (customerBo.UpdateCustomer(customerVo))
                    {
                        customerVo            = customerBo.GetCustomer(customerVo.CustomerId);
                        Session["CustomerVo"] = customerVo;
                        if (customerVo.Type.ToUpper().ToString() == "IND")
                        {
                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('ViewCustomerIndividualProfile','none');", true);
                        }
                        else
                        {
                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('ViewNonIndividualProfile','none');", true);
                        }
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "EditCustomerIndividualProfile.ascx:btnEdit_Click()");
                object[] objects = new object[1];
                objects[0]   = customerVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #22
0
        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            int  Count      = 0;
            bool loginReset = false;

            try
            {
                foreach (GridViewRow gvr in this.gvCustomers.Rows)
                {
                    if (((CheckBox)gvr.FindControl("chkId")).Checked == true)
                    {
                        Count = Count + 1;
                    }
                }
                if (Count == 0)
                {
                    //lblMailSent.Text = "Please select the Customer..!";
                    //********************* lblStatusMsg.Text = "Please select the Customer";
                    //lblMailSent.Visible = true;
                }
                else
                {
                    foreach (GridViewRow gvr in this.gvCustomers.Rows)
                    {
                        if (((CheckBox)gvr.FindControl("chkId")).Checked == true)
                        {
                            string password = r.Next(20000, 100000).ToString();
                            userId = int.Parse(gvCustomers.DataKeys[gvr.RowIndex].Value.ToString());
                            userVo = new UserVo();
                            userVo = userBo.GetUserDetails(userId);

                            if (string.IsNullOrEmpty(userVo.LoginId))
                            {
                                loginReset            = true;
                                userVo.LoginId        = r.Next(10000000, 99999999).ToString();
                                userVo.Password       = Encryption.Encrypt(password);
                                userVo.IsTempPassword = 1;
                                userBo.UpdateUser(userVo);
                            }
                            //Send email to customer
                            //
                            //string EmailPath = Server.MapPath(ConfigurationManager.AppSettings["EmailPath"].ToString());
                            //email.SendCustomerLoginPassMail(advisorUserVo.Email, userVo.Email, advisorUserVo.LastName, userVo.FirstName + " " + userVo.MiddleName + " " + userVo.LastName, userVo.LoginId, password, EmailPath);
                            SendMail(userVo);
                        }
                    }

                    //*********************** lblStatusMsg.Text = statusMessage;
                    //lblMailSent.Visible = true;
                    //tblMessage.Visible = true;
                    //SuccessMsg.Visible = true;
                    //SuccessMsg.InnerText = statusMessage;
                    if (loginReset == true)
                    {
                        mypager.CurrentPage = int.Parse(hdnCurrentPage.Value.ToString());
                        BindGrid();
                    }
                }

                //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('RMCustomer','none');", true);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "RMCustomerUserDetails.ascx:btnGenerate_Click()");
                object[] objects = new object[3];
                objects[0] = rmVo;
                objects[1] = customerVo;
                objects[2] = customerId;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #23
0
        private void BindCustomerFIAlertGrid()
        {
            DataTable dtCustomerFIAlerts = new DataTable();
            DataRow   drFIAlerts;

            //int count;
            try
            {
                dsCustomerFIAlerts = alertsBo.GetCustomerFIAlerts(customerVo.CustomerId);

                if (dsCustomerFIAlerts.Tables[0].Rows.Count > 0)
                {
                    lblMessage.Visible = false;

                    dtCustomerFIAlerts.Columns.Add("FINPId");
                    dtCustomerFIAlerts.Columns.Add("AccountId");
                    dtCustomerFIAlerts.Columns.Add("FIInvestment");
                    dtCustomerFIAlerts.Columns.Add("ReccurringDepositReminder");
                    dtCustomerFIAlerts.Columns.Add("FDMaturityReminder");

                    foreach (DataRow dr in dsCustomerFIAlerts.Tables[0].Rows)
                    {
                        drFIAlerts = dtCustomerFIAlerts.NewRow();

                        drFIAlerts[0] = dr["FIALT_FINPId"].ToString();
                        drFIAlerts[1] = dr["FIALT_AccountId"].ToString();
                        drFIAlerts[2] = dr["FIALT_FIInvestment"].ToString().Trim();
                        if (dr["FIALT_RDReminder"].ToString() != null)
                        {
                            drFIAlerts[3] = dr["FIALT_RDReminder"].ToString();
                        }
                        if (dr["FIALT_FDMaturityReminder"].ToString() != null)
                        {
                            drFIAlerts[4] = dr["FIALT_FDMaturityReminder"].ToString();
                        }

                        dtCustomerFIAlerts.Rows.Add(drFIAlerts);
                    }

                    gvFIAlerts.DataSource = dtCustomerFIAlerts;
                    gvFIAlerts.DataBind();
                    gvFIAlerts.Visible = true;
                    //this.GetPageCount();
                }
                else
                {
                    lblMessage.Visible    = true;
                    lblDisclaimer.Visible = false;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerFIAlert.ascx:BindCustomerFIAlertGrid()");

                object[] objects = new object[0];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        private void BindCustomerMFAlertGrid()
        {
            DataTable dtCustomerMFAlerts = new DataTable();
            DataRow   drMFAlerts;

            //int count;
            try
            {
                dsCustomerMFAlerts = alertsBo.GetCustomerMFAlerts(customerVo.CustomerId);
                //Session["SystemAlerts"] = dsSystemAlerts;
                //if (count > 0)
                //{
                //    lblTotalRows.Text = hdnRecordCount.Value = count.ToString();
                //    tblPager.Visible = true;
                //}
                if (dsCustomerMFAlerts.Tables[0].Rows.Count > 0)
                {
                    lblMessage.Visible = false;

                    dtCustomerMFAlerts.Columns.Add("SchemeId");
                    dtCustomerMFAlerts.Columns.Add("AccountId");
                    dtCustomerMFAlerts.Columns.Add("Scheme");
                    dtCustomerMFAlerts.Columns.Add("SIPReminder");
                    dtCustomerMFAlerts.Columns.Add("SIPConfirmation");
                    dtCustomerMFAlerts.Columns.Add("MFAbsoluteStopLoss");
                    dtCustomerMFAlerts.Columns.Add("MFAbsoluteProfitBooking");
                    dtCustomerMFAlerts.Columns.Add("SWPReminder");
                    dtCustomerMFAlerts.Columns.Add("SWPConfirmation");
                    dtCustomerMFAlerts.Columns.Add("ELSSMaturity");
                    dtCustomerMFAlerts.Columns.Add("DivTranxOccur");

                    foreach (DataRow dr in dsCustomerMFAlerts.Tables[0].Rows)
                    {
                        drMFAlerts = dtCustomerMFAlerts.NewRow();

                        drMFAlerts[0] = dr["MFALT_SchemeId"].ToString();
                        drMFAlerts[1] = dr["MFALT_AccountId"].ToString();
                        drMFAlerts[2] = dr["MFALT_SchemeName"].ToString().Trim();
                        if (dr["MFALT_SIPReminder"].ToString() != null)
                        {
                            drMFAlerts[3] = dr["MFALT_SIPReminder"].ToString();
                        }
                        if (dr["MFALT_SIPConfirmation"].ToString() != null)
                        {
                            drMFAlerts[4] = dr["MFALT_SIPConfirmation"].ToString();
                        }
                        if (dr["MFALT_MFAbsoluteStopLoss"].ToString() != null)
                        {
                            drMFAlerts[5] = dr["MFALT_MFAbsoluteStopLoss"].ToString();
                        }
                        if (dr["MFALT_MFAbsoluteProfitBooking"].ToString() != null)
                        {
                            drMFAlerts[6] = dr["MFALT_MFAbsoluteProfitBooking"].ToString();
                        }
                        if (dr["MFALT_SWPReminder"].ToString() != null)
                        {
                            drMFAlerts[7] = dr["MFALT_SWPReminder"].ToString().Trim();
                        }
                        if (dr["MFALT_SWPConfirmation"].ToString() != null)
                        {
                            drMFAlerts[8] = dr["MFALT_SWPConfirmation"].ToString();
                        }
                        if (dr["MFALT_ELSSMaturity"].ToString() != null)
                        {
                            drMFAlerts[9] = dr["MFALT_ELSSMaturity"].ToString();
                        }
                        if (dr["MFALT_DivTranx"].ToString() != null)
                        {
                            drMFAlerts[10] = dr["MFALT_DivTranx"].ToString().Trim();
                        }

                        dtCustomerMFAlerts.Rows.Add(drMFAlerts);
                    }

                    gvMFAlerts.DataSource = dtCustomerMFAlerts;
                    gvMFAlerts.DataBind();
                    gvMFAlerts.Visible = true;
                    //this.GetPageCount();
                }
                else
                {
                    lblMessage.Visible    = true;
                    lblDisclaimer.Visible = false;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerMFAlert.ascx:BindCustomerMFAlertGrid()");

                object[] objects = new object[0];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #25
0
        /// <summary>
        /// Load the Govt Savings values to the UI elements.
        /// </summary>
        private void SetValues()
        {
            try
            {
                lblInstrumentCategory.Text = customerAccountsVo.AssetCategoryName;
                txtAccountId.Text          = customerAccountsVo.AccountNum;
                txtAssetParticulars.Text   = govtSavingsVo.Name;
                if (txtAccOpenDate != null && customerAccountsVo.AccountOpeningDate != DateTime.MinValue)
                {
                    txtAccOpenDate.Text = customerAccountsVo.AccountOpeningDate.ToShortDateString();
                }
                txtAccountWith.Text = customerAccountsVo.AccountSource;

                if (txtDepositDate != null && govtSavingsVo.PurchaseDate != DateTime.MinValue)
                {
                    txtDepositDate.Text = govtSavingsVo.PurchaseDate.ToShortDateString();
                }
                if (txtMaturityDate != null && govtSavingsVo.MaturityDate != DateTime.MinValue)
                {
                    txtMaturityDate.Text = govtSavingsVo.MaturityDate.ToShortDateString();
                }
                if (txtDepositAmount != null)
                {
                    txtDepositAmount.Text = govtSavingsVo.DepositAmt.ToString();
                }
                if (txtSubsqntDepositAmount != null)
                {
                    txtSubsqntDepositAmount.Text = govtSavingsVo.SubsqntDepositAmount.ToString();
                }
                if (txtSubsqntDepositDate != null && govtSavingsVo.SubsqntDepositDate != DateTime.MinValue)
                {
                    txtSubsqntDepositDate.Text = govtSavingsVo.SubsqntDepositDate.ToShortDateString();
                }
                if (txtInterstRate != null)
                {
                    txtInterstRate.Text = govtSavingsVo.InterestRate.ToString();
                }
                if (txtInterestAmtCredited != null)
                {
                    txtInterestAmtCredited.Text = govtSavingsVo.InterestAmtPaidOut.ToString();
                }
                if (txtCurrentValue != null)
                {
                    txtCurrentValue.Text = govtSavingsVo.CurrentValue.ToString();
                }
                if (txtMaturityValue != null)
                {
                    txtMaturityValue.Text = govtSavingsVo.MaturityValue.ToString();
                }
                if (txtRemarks != null)
                {
                    txtRemarks.Text = govtSavingsVo.Remarks.ToString();
                }
                if (txtAmount != null)
                {
                    txtAmount.Text = govtSavingsVo.Amount.ToString();
                }
                if (txtPaymentNumber != null)
                {
                    txtPaymentNumber.Text = govtSavingsVo.PaymentInstrumentNumber.ToString();
                }
                if (txtBranchName != null)
                {
                    txtBranchName.Text = govtSavingsVo.BankBranch.ToString();
                }

                if (txtPaymentInstDate != null && govtSavingsVo.PaymentInstrumentDate != DateTime.MinValue)
                {
                    txtPaymentInstDate.SelectedDate = govtSavingsVo.PaymentInstrumentDate.Date;
                }



                //Assign dropdown selected values
                if (ddlModeOfHolding != null && ddlModeOfHolding.Items.Count > 0)
                {
                    ddlModeOfHolding.SelectedValue = customerAccountsVo.ModeOfHolding.Trim();
                }
                if (ddlBankName != null && ddlBankName.Items.Count > 0)
                {
                    ddlBankName.SelectedValue = govtSavingsVo.BankName;
                }
                if (ddlPaymentMode != null && ddlPaymentMode.Items.Count > 0)
                {
                    ddlPaymentMode.SelectedValue = govtSavingsVo.ModeOfPayment.Trim();
                }
                if (ddlPaymentMode.SelectedValue == "CQ")
                {
                    trPINo.Visible = true;
                }
                else
                {
                    trPINo.Visible = true;
                }

                if (ddlDebtIssuerCode != null && ddlDebtIssuerCode.Items.Count > 0)
                {
                    ddlDebtIssuerCode.SelectedValue = govtSavingsVo.DebtIssuerCode.Trim();
                }

                if (ddlInterestBasis != null && ddlInterestBasis.Items.Count > 0)
                {
                    ddlInterestBasis.SelectedValue = govtSavingsVo.InterestBasisCode.ToString().Trim();
                }
                if (govtSavingsVo.InterestBasisCode == "SI") //Simple interest
                {
                    trSimpleInterest.Visible = true;
                    if (ddlSimpleInterestFC != null && ddlSimpleInterestFC.Items.Count > 0)
                    {
                        ddlSimpleInterestFC.SelectedValue = govtSavingsVo.InterestPayableFrequencyCode.ToString().Trim();
                    }
                }
                else if (govtSavingsVo.InterestBasisCode == "CI") //Compound interest
                {
                    trCompoundInterest.Visible = true;
                    if (ddlCompoundInterestFC != null && ddlCompoundInterestFC.Items.Count > 0)
                    {
                        ddlCompoundInterestFC.SelectedValue = govtSavingsVo.CompoundInterestFrequencyCode;
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioGovtSavingsEntry.ascx:LoadViewDetails()");
                object[] objects = new object[2];
                objects[0]   = govtSavingsVo;
                objects[1]   = customerAccountsVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        private void BindFolioGridView()
        {
            try
            {
                customerVo = (CustomerVo)Session["CustomerVo"];

                FolioList = CustomerTransactionBo.GetCustomerEQAccount(portfolioId);

                // lblTotalRows.Text = hdnRecordCount.Value = count.ToString();
                if (FolioList == null)
                {
                    lblMessage.Visible     = true;
                    lblCurrentPage.Visible = false;
                    lblTotalRows.Visible   = false;
                    DivPager.Visible       = false;
                    gvEQAcc.DataSource     = null;
                    gvEQAcc.DataBind();
                }
                else
                {
                    lblMessage.Visible     = false;
                    lblTotalRows.Visible   = true;
                    lblCurrentPage.Visible = true;
                    DivPager.Visible       = true;
                    DataTable dtEQAcc = new DataTable();

                    dtEQAcc.Columns.Add("AccountId");
                    dtEQAcc.Columns.Add("Broker Name");
                    dtEQAcc.Columns.Add("Trade No");
                    dtEQAcc.Columns.Add("Broker Del Percent");
                    dtEQAcc.Columns.Add("Broker Spec Percent");
                    dtEQAcc.Columns.Add("Other Charges");
                    dtEQAcc.Columns.Add("A/C Opening Date");


                    DataRow drEQAcc;

                    for (int i = 0; i < FolioList.Count; i++)
                    {
                        drEQAcc = dtEQAcc.NewRow();
                        FolioVo = new CustomerAccountsVo();
                        FolioVo = FolioList[i];
                        drEQAcc["AccountId"]           = FolioVo.AccountId.ToString();
                        drEQAcc["Broker Name"]         = FolioVo.BrokerName.ToString();
                        drEQAcc["Trade No"]            = FolioVo.TradeNum.ToString();
                        drEQAcc["Broker Del Percent"]  = FolioVo.BrokerageDeliveryPercentage.ToString();
                        drEQAcc["Broker Spec Percent"] = FolioVo.BrokerageSpeculativePercentage.ToString();
                        drEQAcc["Other Charges"]       = FolioVo.OtherCharges.ToString();
                        if (FolioVo.AccountOpeningDate != DateTime.MinValue)
                        {
                            drEQAcc["A/C Opening Date"] = FolioVo.AccountOpeningDate.ToShortDateString();
                        }
                        else
                        {
                            drEQAcc["A/C Opening Date"] = string.Empty;
                        }
                        dtEQAcc.Rows.Add(drEQAcc);
                    }
                    gvEQAcc.DataSource = dtEQAcc;
                    gvEQAcc.DataBind();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerMFFolioView.ascx:BindFolioGridView()");
                object[] objects = new object[2];
                objects[0]   = customerVo;
                objects[1]   = portfolioId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #27
0
        public void SetNode()
        {
            string strNodeValue = "";

            try
            {
                if (TreeView1.SelectedNode.Value == "Home")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('RMDashBoard','none');", true);
                }
                else if (TreeView1.SelectedNode.Value == "Group Dashboard")
                {
                    Session["IsDashboard"] = "true";
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('AdvisorRMCustGroupDashboard','none');", true);
                }
                else if (TreeView1.SelectedNode.Value == "Profile Dashboard")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('RMCustomerIndividualDashboard', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Customer Dashboard")
                {
                    if (customerVo.Type == "IND")
                    {
                        Session["IsDashboard"] = "CustDashboard";
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('AdvisorRMCustIndiDashboard','none');", true);
                    }
                    else if (customerVo.Type == "NIND")
                    {
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('AdvisorRMCustIndiDashboard','none');", true);
                    }
                }
                else if (TreeView1.SelectedNode.Value == "Liabilities Dashboard")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('LiabilityView','none');", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Liability")
                {
                    Session["menu"] = null;
                    Session.Remove("personalVo");
                    Session.Remove("propertyVo");
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('LiabilitiesMaintenanceForm','none');", true);
                }
                else if (TreeView1.SelectedNode.Value == "Portfolio Dashboard")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioDashboard', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Alerts")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('RMAlertNotifications','none');", true);
                }
                else if (TreeView1.SelectedNode.Value == "Equity")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('ViewEquityPortfolios', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "View Equity Transaction")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('EquityTransactionsView','none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Equity Transaction")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('EquityManualSingleTransaction','none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Equity Account")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountAdd', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "View Equity Account")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerEQAccountView', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "MF")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('ViewMutualFundPortfolio', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "View MF Folio")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerMFFolioView', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "View MF Transaction")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('TransactionsView', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add MF Transaction")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('MFManualSingleTran', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add MF Folio")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerMFAccountAdd','action=');", true);
                    // ScriptManager.RegisterClientScriptBlock(this.Page,this.GetType(), "leftpane", "loadcontrol('CustomerMFAccountAdd', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Insurance")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('ViewInsuranceDetails', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Insurance")
                {
                    Session.Remove("table");
                    Session.Remove("insuranceVo");
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerAccountAdd', 'action=IN')", true);
                }
                //else if (TreeView1.SelectedNode.Value == "General Insurance")
                //{
                //    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('ViewGeneralInsuranceDetails', 'none')", true);
                //}
                //else if (TreeView1.SelectedNode.Value == "Add General Insurance")
                //{
                //    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioGeneralInsuranceEntry', 'action=IN')", true);
                //}
                else if (TreeView1.SelectedNode.Value == "Fixed Income")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioFixedIncomeView', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Fixed Income")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerAccountAdd', 'action=FI')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Govt Savings")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('ViewGovtSavings', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Govt Savings")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerAccountAdd', 'action=GS')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Property")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioProperty', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Property")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerAccountAdd', 'action=PR')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Pension And Gratuities")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PensionPortfolio', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Pension and Gratuities")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerAccountAdd', 'action=PG')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Personal Assets")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioPersonal', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Personal Assets")
                {
                    Session.Remove("personalVo");
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioPersonalEntry', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Gold Assets")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('ViewGoldPortfolio', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Gold Assets")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioGoldEntry', 'action=GoldEntry')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Collectibles")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('ViewCollectiblesPortfolio', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Collectibles")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioCollectiblesEntry', 'action=Col')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Cash And Savings")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioCashSavingsView', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Add Cash and Savings")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerAccountAdd', 'action=CS')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Register Systematic Schemes")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioSystematicEntry', 'action=entry')", true);
                }
                else if (TreeView1.SelectedNode.Value == "View Systematic Schemes")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('PortfolioSystematicView', 'none')", true);
                }
                else if (TreeView1.SelectedNode.Value == "Reports")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('FinancialPlanningReports','login')", true);
                }

                // Code to Expand/Collapse the Tree View Nodes based on selections
                if (TreeView1.SelectedNode.Parent == null)
                {
                    foreach (TreeNode node in TreeView1.Nodes)
                    {
                        if (node.Value != TreeView1.SelectedNode.Value)
                        {
                            node.Collapse();
                        }
                        else
                        {
                            node.Expand();
                        }
                    }
                }
                else
                {
                    if (TreeView1.SelectedNode.Parent.Parent != null)
                    {
                        string parentNode = TreeView1.SelectedNode.Parent.Parent.Value;
                        foreach (TreeNode node in TreeView1.Nodes)
                        {
                            if (node.Value != parentNode)
                            {
                                node.Collapse();
                            }
                        }
                    }
                    else
                    {
                        if (TreeView1.SelectedNode.Parent == null)
                        {
                            foreach (TreeNode node in TreeView1.Nodes)
                            {
                                if (node.Value != TreeView1.SelectedNode.Value)
                                {
                                    node.Collapse();
                                }
                                else
                                {
                                    node.Expand();
                                }
                            }
                        }
                        else
                        {
                            strNodeValue = TreeView1.SelectedNode.Parent.Value;
                            string val = TreeView1.SelectedNode.Value;
                            foreach (TreeNode node in TreeView1.Nodes)
                            {
                                if (node.Value != strNodeValue)
                                {
                                    node.Collapse();
                                }
                                else
                                {
                                    foreach (TreeNode child in node.ChildNodes)
                                    {
                                        if (child.Value != val)
                                        {
                                            child.Collapse();
                                        }
                                        else
                                        {
                                            child.Expand();
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioLeftPane.ascx:TreeView1_SelectedNodeChanged()");
                object[] objects = new object[1];
                objects[0] = strNodeValue;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #28
0
        protected void BindData()
        {
            try
            {
                int count;
                customerVo = (CustomerVo)Session["CustomerVo"];

                collectiblesList = collectiblesBo.GetCollectiblesPortfolio(portfolioId, mypager.CurrentPage, hdnSort.Value, out count);
                if (count > 0)
                {
                    DivPager.Style.Add("display", "visible");
                }
                lblTotalRows.Text = hdnRecordCount.Value = count.ToString();
                if (collectiblesList == null)
                {
                    lblMessage.Visible                 = true;
                    lblCurrentPage.Visible             = false;
                    lblTotalRows.Visible               = false;
                    DivPager.Visible                   = false;
                    gvCollectiblesPortfolio.DataSource = null;
                    gvCollectiblesPortfolio.DataBind();
                }
                else
                {
                    lblMessage.Visible     = false;
                    lblTotalRows.Visible   = true;
                    lblCurrentPage.Visible = true;
                    DivPager.Visible       = true;
                    DataTable dtCollectiblesPortfolio = new DataTable();

                    dtCollectiblesPortfolio.Columns.Add("CollectibleId");
                    dtCollectiblesPortfolio.Columns.Add("Instrument Category");
                    dtCollectiblesPortfolio.Columns.Add("Particulars");
                    dtCollectiblesPortfolio.Columns.Add("Purchase Date");
                    dtCollectiblesPortfolio.Columns.Add("Purchase Value");
                    dtCollectiblesPortfolio.Columns.Add("Current Value");
                    dtCollectiblesPortfolio.Columns.Add("Remarks");

                    DataRow drCollectiblesPortfolio;

                    for (int i = 0; i < collectiblesList.Count; i++)
                    {
                        drCollectiblesPortfolio    = dtCollectiblesPortfolio.NewRow();
                        collectiblesVo             = new CollectiblesVo();
                        collectiblesVo             = collectiblesList[i];
                        drCollectiblesPortfolio[0] = collectiblesVo.CollectibleId.ToString();
                        drCollectiblesPortfolio[1] = collectiblesVo.AssetCategoryName.ToString();
                        drCollectiblesPortfolio[2] = collectiblesVo.Name.ToString();

                        if (collectiblesVo.PurchaseDate != DateTime.MinValue)
                        {
                            drCollectiblesPortfolio[3] = collectiblesVo.PurchaseDate.ToShortDateString().ToString();
                        }
                        else
                        {
                            drCollectiblesPortfolio[3] = " ";
                        }


                        if (collectiblesVo.PurchaseValue.ToString() != "")
                        {
                            drCollectiblesPortfolio[4] = String.Format("{0:n2}", decimal.Parse(collectiblesVo.PurchaseValue.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")));
                        }
                        else
                        {
                            drCollectiblesPortfolio[4] = "0";
                        }
                        drCollectiblesPortfolio[5] = String.Format("{0:n2}", decimal.Parse(collectiblesVo.CurrentValue.ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")));
                        drCollectiblesPortfolio[6] = collectiblesVo.Remark.ToString();

                        dtCollectiblesPortfolio.Rows.Add(drCollectiblesPortfolio);
                    }
                    gvCollectiblesPortfolio.DataSource = dtCollectiblesPortfolio;
                    gvCollectiblesPortfolio.DataBind();
                    this.GetPageCount();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "ViewCollectiblesPortfolio.ascx:Page_Load()");

                object[] objects = new object[3];
                objects[0]   = customerVo;
                objects[1]   = collectiblesVo;
                objects[2]   = collectiblesList;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        public List <StandardProfileUploadVo> GetProfileNewCustomers(int processId)
        {
            List <StandardProfileUploadVo> uploadsCustomerList = new List <StandardProfileUploadVo>();
            StandardProfileUploadVo        StandardProfileUploadVo;
            Database  db;
            DbCommand getNewCustomersCmd;
            DataSet   getNewCustomersDs;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getNewCustomersCmd = db.GetStoredProcCommand("SP_UploadGetNewCustomersStd");
                db.AddInParameter(getNewCustomersCmd, "@processId", DbType.Int32, processId);
                getNewCustomersDs = db.ExecuteDataSet(getNewCustomersCmd);

                foreach (DataRow dr in getNewCustomersDs.Tables[0].Rows)
                {
                    StandardProfileUploadVo            = new StandardProfileUploadVo();
                    StandardProfileUploadVo.PANNum     = dr["CPS_PANNum"].ToString();
                    StandardProfileUploadVo.FirstName  = dr["CPS_FirstName"].ToString();
                    StandardProfileUploadVo.MiddleName = dr["CPS_MiddleName"].ToString();
                    StandardProfileUploadVo.LastName   = dr["CPS_LastName"].ToString();
                    if (dr["AR_RMId"] == null || dr["AR_RMId"].ToString() == "")
                    {
                        StandardProfileUploadVo.RMId = 0;
                    }
                    else
                    {
                        StandardProfileUploadVo.RMId = int.Parse(dr["AR_RMId"].ToString());
                    }
                    StandardProfileUploadVo.Adr1Line1                 = dr["CPS_Adr1Line1"].ToString();
                    StandardProfileUploadVo.Adr1Line2                 = dr["CPS_Adr1Line2"].ToString();
                    StandardProfileUploadVo.Adr1Line3                 = dr["CPS_Adr1Line3"].ToString();
                    StandardProfileUploadVo.Adr1PinCode               = dr["CPS_Adr1PinCode"].ToString();
                    StandardProfileUploadVo.Type                      = dr["CPS_Type"].ToString();
                    StandardProfileUploadVo.SubType                   = dr["CPS_SubType"].ToString();
                    StandardProfileUploadVo.Adr1City                  = dr["CPS_Adr1City"].ToString();
                    StandardProfileUploadVo.Adr1State                 = dr["CPS_Adr1State"].ToString();
                    StandardProfileUploadVo.Adr2Country               = dr["CPS_Adr1Country"].ToString();
                    StandardProfileUploadVo.Adr2Line1                 = dr["CPS_Adr2Line1"].ToString();
                    StandardProfileUploadVo.Adr2Line2                 = dr["CPS_Adr2Line2"].ToString();
                    StandardProfileUploadVo.Adr2Line3                 = dr["CPS_Adr2Line3"].ToString();
                    StandardProfileUploadVo.Adr2PinCode               = dr["CPS_Adr2PinCode"].ToString();
                    StandardProfileUploadVo.Adr2City                  = dr["CPS_Adr2City"].ToString();
                    StandardProfileUploadVo.Adr2State                 = dr["CPS_Adr2State"].ToString();
                    StandardProfileUploadVo.Adr2Country               = dr["CPS_Adr2Country"].ToString();
                    StandardProfileUploadVo.ResISDCode                = dr["CPS_ResISDCode"].ToString();
                    StandardProfileUploadVo.ResSTDCode                = dr["CPS_ResSTDCode"].ToString();
                    StandardProfileUploadVo.ResPhoneNum               = dr["CPS_ResPhoneNum"].ToString();
                    StandardProfileUploadVo.OfcISDCode                = dr["CPS_OfcISDCode"].ToString();
                    StandardProfileUploadVo.OfcSTDCode                = dr["CPS_OfcSTDCode"].ToString();
                    StandardProfileUploadVo.OfcPhoneNum               = dr["CPS_OfcPhoneNum"].ToString();
                    StandardProfileUploadVo.Email                     = dr["CPS_Email"].ToString();
                    StandardProfileUploadVo.AltEmail                  = dr["CPS_AltEmail"].ToString();
                    StandardProfileUploadVo.Mobile1                   = dr["CPS_Mobile1"].ToString();
                    StandardProfileUploadVo.Mobile2                   = dr["CPS_Mobile2"].ToString();
                    StandardProfileUploadVo.ISDFax                    = dr["CPS_ISDFax"].ToString();
                    StandardProfileUploadVo.STDFax                    = dr["CPS_STDFax"].ToString();
                    StandardProfileUploadVo.Fax                       = dr["CPS_Fax"].ToString();
                    StandardProfileUploadVo.OfcFax                    = dr["CPS_OfcFax"].ToString();
                    StandardProfileUploadVo.OfcFaxISD                 = dr["CPS_OfcFaxISD"].ToString();
                    StandardProfileUploadVo.OfcFaxSTD                 = dr["CPS_OfcFaxSTD"].ToString();
                    StandardProfileUploadVo.Occupation                = dr["CPS_Occupation"].ToString();
                    StandardProfileUploadVo.Qualification             = dr["CPS_Qualification"].ToString();
                    StandardProfileUploadVo.MarriageDate              = dr["CPS_MarriageDate"].ToString();
                    StandardProfileUploadVo.MaritalStatus             = dr["CPS_MaritalStatus"].ToString();
                    StandardProfileUploadVo.Nationality               = dr["CPS_Nationality"].ToString();
                    StandardProfileUploadVo.RBIRefNum                 = dr["CPS_RBIRefNum"].ToString();
                    StandardProfileUploadVo.RBIApprovalDate           = dr["CPS_RBIApprovalDate"].ToString();
                    StandardProfileUploadVo.CompanyName               = dr["CPS_CompanyName"].ToString();
                    StandardProfileUploadVo.DOB                       = dr["CPS_DOB"].ToString();
                    StandardProfileUploadVo.OfcAdrLine1               = dr["CPS_OfcAdrLine1"].ToString();
                    StandardProfileUploadVo.OfcAdrLine2               = dr["CPS_OfcAdrLine2"].ToString();
                    StandardProfileUploadVo.OfcAdrLine3               = dr["CPS_OfcAdrLine3"].ToString();
                    StandardProfileUploadVo.OfcAdrPinCode             = dr["CPS_OfcAdrPinCode"].ToString();
                    StandardProfileUploadVo.OfcAdrCity                = dr["CPS_OfcAdrCity"].ToString();
                    StandardProfileUploadVo.OfcAdrState               = dr["CPS_OfcAdrState"].ToString();
                    StandardProfileUploadVo.OfcAdrCountry             = dr["CPS_OfcAdrCountry"].ToString();
                    StandardProfileUploadVo.RegistrationDate          = dr["CPS_RegistrationDate"].ToString();
                    StandardProfileUploadVo.CommencementDate          = dr["CPS_CommencementDate"].ToString();
                    StandardProfileUploadVo.RegistrationNum           = dr["CPS_RegistrationNum"].ToString();
                    StandardProfileUploadVo.CompanyWebsite            = dr["CPS_CompanyWebsite"].ToString();
                    StandardProfileUploadVo.BankName                  = dr["CPS_BankName"].ToString();
                    StandardProfileUploadVo.BankAccountType           = dr["CPS_BankAccountType"].ToString();
                    StandardProfileUploadVo.BankAccountNum            = dr["CPS_BankAccountNum"].ToString();
                    StandardProfileUploadVo.BankModeOfOperation       = dr["CPS_BankModeOfOperation"].ToString();
                    StandardProfileUploadVo.BranchName                = dr["CPS_BranchName"].ToString();
                    StandardProfileUploadVo.BranchAdrLine1            = dr["CPS_BranchAdrLine1"].ToString();
                    StandardProfileUploadVo.BranchAdrLine2            = dr["CPS_BranchAdrLine2"].ToString();
                    StandardProfileUploadVo.BranchAdrLine3            = dr["CPS_BranchAdrLine3"].ToString();
                    StandardProfileUploadVo.BranchAdrPinCode          = dr["CPS_BranchAdrPinCode"].ToString();
                    StandardProfileUploadVo.BranchAdrCity             = dr["CPS_BranchAdrCity"].ToString();
                    StandardProfileUploadVo.BranchAdrState            = dr["CPS_BranchAdrState"].ToString();
                    StandardProfileUploadVo.BranchAdrCountry          = dr["CPS_BranchAdrCountry"].ToString();
                    StandardProfileUploadVo.MICR                      = dr["CPS_MICR"].ToString();
                    StandardProfileUploadVo.IFSC                      = dr["CPS_IFSC"].ToString();
                    StandardProfileUploadVo.ContactGuardianFirstName  = dr["CPS_ContactGuardianFirstName"].ToString();
                    StandardProfileUploadVo.ContactGuardianMiddleName = dr["CPS_ContactGuardianMiddleName"].ToString();
                    StandardProfileUploadVo.ContactGuardianLastName   = dr["CPS_ContactGuardianLastName"].ToString();
                    StandardProfileUploadVo.IsProspect                = int.Parse(dr["C_IsProspect"].ToString());
                    uploadsCustomerList.Add(StandardProfileUploadVo);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CamsUploadsDao.cs:GetCamsNewCustomers()");

                object[] objects = new object[0];

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(uploadsCustomerList);
        }
        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);
                //db.AddInParameter(getCustomerBankCmd, "@CB_CustBankAccId", DbType.Int32, customerBankAccId);
                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.WERPBMBankName  = dr["WCMV_BankName"].ToString();
                        customerBankAccountVo.AccountType     = dr["WCMV_BankAccountType"].ToString();
                        customerBankAccountVo.BankAccountNum  = dr["CB_AccountNum"].ToString();
                        customerBankAccountVo.ModeOfOperation = dr["XMOH_ModeOfHolding"].ToString().Trim();
                        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.RTGSCode        = dr["CB_RTGS"].ToString();
                        customerBankAccountVo.NeftCode        = dr["CB_NEFT"].ToString();
                        customerBankAccountVo.MICR            = dr["CB_MICR"].ToString();
                        if (!string.IsNullOrEmpty(dr["CB_BranchAdrPinCode"].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.ModeOfOperationCode = dr["XMOH_ModeOfHoldingCode"].ToString().Trim();
                        //customerBankAccountVo.AccountTypeCode = dr["PAIC_AssetInstrumentCategoryCode"].ToString();
                        //customerBankAccountVo.BankName = dr["WERPBM_BankCode"].ToString();

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

                        if (!string.IsNullOrEmpty(dr["WCMV_LookupId_AccType"].ToString()))
                        {
                            customerBankAccountVo.BankAccTypeId = int.Parse(dr["WCMV_LookupId_AccType"].ToString());
                        }
                        if (!string.IsNullOrEmpty(dr["WCMV_LookupId_BankId"].ToString()))
                        {
                            customerBankAccountVo.BankId = int.Parse(dr["WCMV_LookupId_BankId"].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());
                        }
                        customerBankAccountVo.BankBranchCode = dr["CB_BankBranchCode"].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);
        }