Beispiel #1
0
        public CustomerFamilyVo GetCustomerFamilyAssociateDetails(int AssociationId)
        {
            CustomerFamilyVo  customerFamilyVo  = new CustomerFamilyVo();
            CustomerFamilyDao customerFamilyDao = new CustomerFamilyDao();

            try
            {
                customerFamilyVo = customerFamilyDao.GetCustomerFamilyAssociateDetails(AssociationId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerFamilyBo.cs:GetCustomerFamilyAssociateDetails()");


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

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(customerFamilyVo);
        }
Beispiel #2
0
        public bool UpdateCustomerAssociate(CustomerFamilyVo customerFamilyVo, int customerId, int userId)
        {
            bool bResult = false;
            CustomerFamilyDao customerFamilyDao = new CustomerFamilyDao();

            try
            {
                bResult = customerFamilyDao.UpdateCustomerAssociate(customerFamilyVo, customerId, userId);
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerFamilyBo.cs:UpdateCustomerAssociate()");


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

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

            return(bResult);
        }
        private void Save()
        {
            CustomerVo          customerVo          = new CustomerVo();
            UserVo              userVo              = new UserVo();
            CustomerBo          customerBo          = new CustomerBo();
            CustomerPortfolioVo customerPortfolioVo = new CustomerPortfolioVo();
            List <int>          customerIds         = new List <int>();

            if (Page.IsValid)
            {
                if (fpuserVo.C_CustomerId == null || fpuserVo.C_CustomerId == 0)
                {
                    customerVo.RmId            = 4682;
                    customerVo.BranchId        = 1339;
                    customerVo.Type            = "IND";
                    customerVo.FirstName       = fpuserVo.UserName;
                    userVo.FirstName           = fpuserVo.UserName;
                    customerVo.Email           = fpuserVo.EMail;
                    customerVo.IsProspect      = 1;
                    customerVo.IsFPClient      = 1;
                    customerVo.IsActive        = 1;
                    customerVo.IsRealInvestor  = true;
                    customerVo.PANNum          = fpuserVo.Pan;
                    customerVo.Mobile1         = fpuserVo.MobileNo;
                    customerVo.ProspectAddDate = DateTime.Now;
                    customerVo.Dob             = fpuserVo.DOB;
                    userVo.Email = fpuserVo.EMail;
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolioProspect";
                    customerIds = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, fpuserVo.UserId);
                    if (customerIds != null)
                    {
                        CustomerFamilyVo familyVo = new CustomerFamilyVo();
                        CustomerFamilyBo familyBo = new CustomerFamilyBo();
                        familyVo.AssociateCustomerId = customerIds[1];
                        familyVo.CustomerId          = customerIds[1];
                        familyVo.Relationship        = "SELF";
                        familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId);
                    }
                    if (UpdateCustomerIdInFPUserTable(fpuserVo.UserId, customerIds[1]))
                    {
                        divTncSuccess.Visible = true;
                    }
                }
                else
                {
                    if (UpdateCustomerIdInFPUserTable(fpuserVo.UserId, fpuserVo.C_CustomerId))
                    {
                        divTncSuccess.Visible = true;
                    }
                }
                divtnc1.Visible       = false;
                divtnc2.Visible       = false;
                divTncSuccess.Visible = true;
            }
        }
        public CustomerFamilyVo GetCustomerFamilyAssociateDetails(int AssociationId)
        {
            CustomerFamilyVo customerFamilyVo = new CustomerFamilyVo();
            Database         db;
            DbCommand        getCustomerFamilyAssocciateDetailsCmd;
            DataSet          getCustomerFamilyAssocciateDetailsDs;
            DataRow          dr;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getCustomerFamilyAssocciateDetailsCmd = db.GetStoredProcCommand("SP_GetCustomerFamilyAssociateDetails");
                db.AddInParameter(getCustomerFamilyAssocciateDetailsCmd, "@CA_Associationid", DbType.Int32, AssociationId);
                getCustomerFamilyAssocciateDetailsDs = db.ExecuteDataSet(getCustomerFamilyAssocciateDetailsCmd);

                if (getCustomerFamilyAssocciateDetailsDs.Tables[0].Rows.Count > 0)
                {
                    dr = getCustomerFamilyAssocciateDetailsDs.Tables[0].Rows[0];
                    customerFamilyVo = new CustomerFamilyVo();
                    customerFamilyVo.AssociationId       = Int32.Parse(dr["CA_AssociationId"].ToString());
                    customerFamilyVo.AssociateCustomerId = Int32.Parse(dr["C_AssociateCustomerId"].ToString());
                    customerFamilyVo.Relationship        = dr["XR_RelationshipCode"].ToString();
                    customerFamilyVo.CustomerId          = int.Parse(dr["C_CustomerId"].ToString());
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerFamilyDao.cs:GetCustomerFamilyAssociateDetails()");


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

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(customerFamilyVo);
        }
        public bool CreateCustomerFamily(CustomerFamilyVo customerFamilyVo, int customerId, int userId)
        {
            bool      bResult = false;
            Database  db;
            DbCommand createCustomerFamilyCmd;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                createCustomerFamilyCmd = db.GetStoredProcCommand("SP_CreateCustomerAssociates");
                //db.AddInParameter(createCustomerFamilyCmd, "@CA_AssociationId", DbType.String, customerFamilyVo.AssociationId);
                db.AddInParameter(createCustomerFamilyCmd, "@C_AssociateCustomerId", DbType.Int32, customerFamilyVo.AssociateCustomerId);
                db.AddInParameter(createCustomerFamilyCmd, "@XR_RelationshipCode", DbType.String, customerFamilyVo.Relationship);
                db.AddInParameter(createCustomerFamilyCmd, "@C_CustomerId", DbType.Int32, customerId);
                db.AddInParameter(createCustomerFamilyCmd, "@CA_CreatedBy", DbType.Int32, userId);
                db.AddInParameter(createCustomerFamilyCmd, "@CA_ModifiedBy", DbType.Int32, userId);
                if (db.ExecuteNonQuery(createCustomerFamilyCmd) != 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", "CustomerFamilyDao.cs:CreateCustomerFamily()");

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

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(bResult);
        }
Beispiel #6
0
        /// <summary>
        /// Used to create Parent Customer
        /// </summary>
        /// <param name="userVo"></param>
        /// <param name="rmVo"></param>
        /// <param name="createdById"></param>
        /// <returns></returns>
        protected int CreateCustomerForAddProspect(UserVo userVo, RMVo rmVo, int createdById)
        {
            customerVo = new CustomerVo();
            List <int> customerIds = new List <int>();

            customerVo.RmId       = rmVo.RMId;
            customerVo.Type       = "IND";
            customerVo.FirstName  = txtFirstName.Text.ToString();
            customerVo.MiddleName = txtMiddleName.Text.ToString();
            customerVo.LastName   = txtLastName.Text.ToString();
            userVo.FirstName      = txtFirstName.Text.ToString();
            userVo.MiddleName     = txtMiddleName.Text.ToString();
            userVo.LastName       = txtLastName.Text.ToString();
            customerVo.BranchId   = int.Parse(ddlPickBranch.SelectedValue);
            if (dpDOB.SelectedDate != null)
            {
                customerVo.Dob = dpDOB.SelectedDate.Value;
            }
            customerVo.Email      = txtEmail.Text;
            customerVo.IsProspect = 1;
            customerVo.IsFPClient = 1;
            Session[SessionContents.FPS_CustomerProspect_CustomerVo] = customerVo;
            userVo.Email = txtEmail.Text.ToString();
            customerPortfolioVo.IsMainPortfolio   = 1;
            customerPortfolioVo.PortfolioTypeCode = "RGL";
            customerPortfolioVo.PortfolioName     = "MyPortfolioUnmanaged";
            customerIds         = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, createdById);
            Session["Customer"] = "Customer";
            Session[SessionContents.CustomerVo] = customerVo;
            Session["customerVo"] = customerVo;
            Session["CustomerVo"] = customerVo;
            if (customerIds != null)
            {
                CustomerFamilyVo familyVo = new CustomerFamilyVo();
                CustomerFamilyBo familyBo = new CustomerFamilyBo();
                familyVo.AssociateCustomerId = customerIds[1];
                familyVo.CustomerId          = customerIds[1];
                familyVo.Relationship        = "SELF";
                familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId);
            }
            return(customerIds[1]);
        }
Beispiel #7
0
 /// <summary>
 /// Used to update Child Customers
 /// </summary>
 /// <param name="customerId"></param>
 /// <param name="drChildCustomer"></param>
 protected void UpdateCustomerForAddProspect(int customerId, DataRow drChildCustomer)
 {
     customerVo            = new CustomerVo();
     customerVo.CustomerId = int.Parse(drChildCustomer["C_CustomerId"].ToString());
     customerVo.RmId       = rmVo.RMId;
     customerVo.Type       = "IND";
     customerVo.FirstName  = drChildCustomer["FirstName"].ToString();
     customerVo.MiddleName = drChildCustomer["MiddleName"].ToString();
     customerVo.LastName   = drChildCustomer["LastName"].ToString();
     customerVo.BranchId   = int.Parse(ddlPickBranch.SelectedValue);
     if (dpDOB.SelectedDate != null && drChildCustomer["DOB"].ToString() != null && drChildCustomer["DOB"].ToString() != string.Empty)
     {
         customerVo.Dob = DateTime.Parse(drChildCustomer["DOB"].ToString());
     }
     customerVo.IsProspect = 1;
     customerVo.IsFPClient = 1;
     customerVo.Email      = drChildCustomer["EmailId"].ToString();
     customerPortfolioVo.IsMainPortfolio   = 1;
     customerPortfolioVo.PortfolioTypeCode = "RGL";
     customerPortfolioVo.PortfolioName     = "MyPortfolioUnmanaged";
     customerBo.UpdateCustomer(customerVo);
     Session["Customer"] = "Customer";
     if (drChildCustomer["C_CustomerId"] != null)
     {
         if (int.Parse(drChildCustomer["C_CustomerId"].ToString()) != 0)
         {
             CustomerFamilyVo familyVo = new CustomerFamilyVo();
             CustomerFamilyBo familyBo = new CustomerFamilyBo();
             familyVo.AssociationId       = int.Parse(drChildCustomer["CA_AssociationId"].ToString());
             familyVo.AssociateCustomerId = int.Parse(drChildCustomer["C_CustomerId"].ToString());
             familyVo.CustomerId          = customerId;
             familyVo.Relationship        = drChildCustomer["CustomerRelationship"].ToString();
             familyBo.UpdateCustomerAssociate(familyVo, customerId, 0);
         }
     }
     //Session[SessionContents.CustomerVo] = customerVo;
     //Session["customerVo"] = customerVo;
     //Session["CustomerVo"] = customerVo;
 }
Beispiel #8
0
        /// <summary>
        /// Used to Create child customers for AddProspect Screen
        /// </summary>
        /// <param name="userVo"></param>
        /// <param name="rmVo"></param>
        /// <param name="createdById"></param>
        /// <param name="drChildCustomer"></param>
        /// <param name="ParentCustomerId"></param>
        protected void CreateCustomerForAddProspect(UserVo userVo, RMVo rmVo, int createdById, DataRow drChildCustomer, int ParentCustomerId)
        {
            customerVo            = new CustomerVo();
            customerVo.RmId       = rmVo.RMId;
            customerVo.Type       = "IND";
            customerVo.FirstName  = drChildCustomer["FirstName"].ToString();
            customerVo.MiddleName = drChildCustomer["MiddleName"].ToString();
            customerVo.LastName   = drChildCustomer["LastName"].ToString();
            userVo.FirstName      = drChildCustomer["FirstName"].ToString();
            customerVo.BranchId   = int.Parse(ddlPickBranch.SelectedValue);
            if (dpDOB.SelectedDate != null && drChildCustomer["DOB"].ToString() != null && drChildCustomer["DOB"].ToString() != string.Empty)
            {
                customerVo.Dob = DateTime.Parse(drChildCustomer["DOB"].ToString());
            }
            customerVo.Email      = drChildCustomer["EmailId"].ToString();
            customerVo.IsProspect = 1;
            customerVo.IsFPClient = 1;
            userVo.Email          = drChildCustomer["EmailId"].ToString();
            customerPortfolioVo.IsMainPortfolio   = 1;
            customerPortfolioVo.PortfolioTypeCode = "RGL";
            customerPortfolioVo.PortfolioName     = "MyPortfolioUnmanaged";
            //Session[SessionContents.CustomerVo] = customerVo;
            //Session["customerVo"] = customerVo;
            //Session["CustomerVo"] = customerVo;
            List <int> customerIds = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, createdById);

            if (customerIds != null)
            {
                CustomerFamilyVo familyVo = new CustomerFamilyVo();
                CustomerFamilyBo familyBo = new CustomerFamilyBo();
                familyVo.AssociateCustomerId = customerIds[1];
                familyVo.CustomerId          = ParentCustomerId;
                familyVo.Relationship        = drChildCustomer["CustomerRelationship"].ToString();
                familyBo.CreateCustomerFamily(familyVo, ParentCustomerId, userVo.UserId);
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userVo = (UserVo)Session[SessionContents.UserVo];
            path   = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
            try
            {
                //  customerFamilyList = new List<CustomerFamilyVo>();

                customerVo = (CustomerVo)Session["CustomerVo"];
                rmVo       = (RMVo)Session["RmVo"];
                customerId = customerVo.CustomerId;
                StringBuilder sbAddress = new StringBuilder();

                lblName.Text  = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString();
                lblPhone.Text = customerVo.ResISDCode.ToString() + " - " + customerVo.ResSTDCode.ToString() + " - " + customerVo.ResPhoneNum.ToString();
                lblEmail.Text = customerVo.Email.ToString();

                sbAddress.Append(customerVo.Adr1Line1.ToString());
                sbAddress.Append("<br />");
                sbAddress.Append(customerVo.Adr1Line2.ToString());
                sbAddress.Append("<br />");
                sbAddress.Append(customerVo.Adr1Line3.ToString());
                sbAddress.Append("<br />");
                sbAddress.Append(customerVo.Adr1PinCode.ToString());
                sbAddress.Append("<br />");

                if (customerVo.Adr1State.ToString() != "")
                {
                    sbAddress.Append(XMLBo.GetStateName(path, customerVo.Adr1State.ToString()));
                    sbAddress.Append("<br />");
                }

                sbAddress.Append(customerVo.Adr1City.ToString());
                sbAddress.Append("<br />");
                sbAddress.Append(customerVo.Adr1Country.ToString());

                lblAddress.Text = sbAddress.ToString();

                Session["RmVo"] = rmVo;
                // Session["CustomerVo"] = customerVo;
                Session["Check"] = "Dashboard";

                //Binding the Customer Family Grid
                customerFamilyList = customerFamilyBo.GetCustomerFamily(customerVo.CustomerId);
                if (customerFamilyList == null)
                {
                    tdFamilyDetailsHeader.Visible = false;
                    tdFamilyDetailsGrid.Visible   = false;
                }
                else
                {
                    DataTable dtCustomerFamilyList = new DataTable();
                    dtCustomerFamilyList.Columns.Add("CustomerId");
                    dtCustomerFamilyList.Columns.Add("Name");
                    dtCustomerFamilyList.Columns.Add("Relationship");

                    DataRow drCustomerFamily;
                    for (int i = 0; i < customerFamilyList.Count; i++)
                    {
                        drCustomerFamily = dtCustomerFamilyList.NewRow();
                        CustomerFamilyVo customerFamilyVo = new CustomerFamilyVo();
                        customerFamilyVo    = customerFamilyList[i];
                        drCustomerFamily[0] = customerFamilyVo.AssociateCustomerId.ToString();
                        drCustomerFamily[1] = customerFamilyVo.AssociateCustomerName.ToString();
                        drCustomerFamily[2] = customerFamilyVo.Relationship;
                        dtCustomerFamilyList.Rows.Add(drCustomerFamily);
                    }
                    if (dtCustomerFamilyList.Rows.Count > 0)
                    {
                        gvFamilyMembers.DataSource = dtCustomerFamilyList;
                        gvFamilyMembers.DataBind();
                        gvFamilyMembers.Visible = true;
                    }
                    else
                    {
                        gvFamilyMembers.DataSource = null;
                        gvFamilyMembers.DataBind();
                    }
                }

                //Call the function to bind the Bank Details
                lblBankDetailsMsg.Visible = false;
                BindBankDetails();
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "RMCustomerDashboard.ascx:Page_Load()");
                object[] objects = new object[4];
                objects[0]   = customerFamilyList;
                objects[1]   = rmVo;
                objects[2]   = customerVo;
                objects[3]   = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #10
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            List <int> customerIds = null;

            try
            {
                Nullable <DateTime> dt = new DateTime();
                customerIds             = new List <int>();
                lblPanDuplicate.Visible = false;
                if (Validation())
                {
                    userVo = new UserVo();
                    if (rbtnIndividual.Checked)
                    {
                        rmVo                  = (RMVo)Session["rmVo"];
                        tempUserVo            = (UserVo)Session["userVo"];
                        customerVo.RmId       = rmVo.RMId;
                        customerVo.Type       = "IND";
                        customerVo.FirstName  = txtFirstNameCreation.Text.ToString();
                        customerVo.MiddleName = txtMiddleName.Text.ToString();
                        customerVo.LastName   = txtLastNameCreation.Text.ToString();

                        userVo.FirstName  = txtFirstNameCreation.Text.ToString();
                        userVo.MiddleName = txtMiddleName.Text.ToString();
                        userVo.LastName   = txtLastNameCreation.Text.ToString();
                    }
                    else if (rbtnNonIndividual.Checked)
                    {
                        rmVo                   = (RMVo)Session["rmVo"];
                        tempUserVo             = (UserVo)Session["userVo"];
                        customerVo.RmId        = rmVo.RMId;
                        customerVo.Type        = "NIND";
                        customerVo.CompanyName = txtCompanyName.Text.ToString();
                        customerVo.LastName    = txtCompanyName.Text.ToString();
                        userVo.LastName        = txtCompanyName.Text.ToString();
                    }
                    customerVo.BranchId         = int.Parse(ddlAdviserBranchList.SelectedValue);
                    customerVo.SubType          = ddlCustomerSubType.SelectedItem.Value;
                    customerVo.Email            = txtEmail.Text.ToString();
                    customerVo.PANNum           = txtPanNumber.Text.ToString();
                    customerVo.Dob              = DateTime.MinValue;
                    customerVo.RBIApprovalDate  = DateTime.MinValue;
                    customerVo.CommencementDate = DateTime.MinValue;
                    customerVo.RegistrationDate = DateTime.MinValue;
                    customerVo.Adr1State        = null;
                    customerVo.Adr2State        = null;
                    customerVo.ProfilingDate    = DateTime.Today;
                    customerVo.UserId           = userVo.UserId;
                    userVo.Email = txtEmail.Text.ToString();
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";
                    customerIds         = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, tempUserVo.UserId);
                    Session["Customer"] = "Customer";
                    if (customerIds != null)
                    {
                        CustomerFamilyVo familyVo = new CustomerFamilyVo();
                        CustomerFamilyBo familyBo = new CustomerFamilyBo();
                        familyVo.AssociateCustomerId = customerIds[1];
                        familyVo.CustomerId          = customerIds[1];
                        familyVo.Relationship        = "SELF";
                        familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId);

                        //Map folios to the new customer created
                        bool Mapfolio = MapfoliotoCustomer(customerIds[1]);

                        if (Mapfolio)
                        {
                            divCreateNewCustomer.Visible = false;
                            lblMessage.Visible           = true;
                            lblMessage.Text     = "Customer is mapped";
                            lblMessage.CssClass = "SuccessMsg";
                            tblSearch.Visible   = false;
                            reprocess();
                        }
                        else
                        {
                            lblMessage.Visible = true;
                            lblMessage.Text    = "An error occurred while mapping.";
                        }
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerType.ascx:btnSubmit_Click()");
                object[] objects = new object[5];
                objects[0]   = customerIds;
                objects[1]   = customerVo;
                objects[2]   = rmVo;
                objects[3]   = userVo;
                objects[4]   = customerPortfolioVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        public List <CustomerFamilyVo> GetCustomerFamily(int customerId)
        {
            List <CustomerFamilyVo> familyList = null;

            CustomerFamilyVo customerFamilyVo;
            Database         db;
            DbCommand        getCustomerFamilyCmd;
            DataSet          getCustomerFamilyDs;

            //DataRow dr;

            try
            {
                //  string query = "getCustomerFamily" + customerId.ToString();
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getCustomerFamilyCmd = db.GetStoredProcCommand("SP_GetCustomerAssociatesRel");
                db.AddInParameter(getCustomerFamilyCmd, "@C_CustomerId", DbType.Int32, customerId);
                getCustomerFamilyDs = db.ExecuteDataSet(getCustomerFamilyCmd);

                if (getCustomerFamilyDs.Tables[0].Rows.Count > 0)
                {
                    familyList = new List <CustomerFamilyVo>();
                    //dr = getCustomerFamilyDs.Tables[0].Rows[0];
                    foreach (DataRow dr in getCustomerFamilyDs.Tables[0].Rows)
                    {
                        customerFamilyVo = new CustomerFamilyVo();
                        customerFamilyVo.AssociationId         = Int32.Parse(dr["CA_AssociationId"].ToString());
                        customerFamilyVo.CustomerId            = Int32.Parse(dr["C_CustomerId"].ToString());
                        customerFamilyVo.RelationshipCode      = dr["XR_RelationshipCode"].ToString();
                        customerFamilyVo.AssociateCustomerId   = Int32.Parse(dr["C_AssociateCustomerId"].ToString());
                        customerFamilyVo.AssociateCustomerName = dr["C_FirstName"].ToString() + " " + dr["C_LastName"].ToString();
                        if (!string.IsNullOrEmpty(dr["C_DOB"].ToString()))
                        {
                            customerFamilyVo.DOB = DateTime.Parse(dr["C_DOB"].ToString());
                        }
                        if (!string.IsNullOrEmpty(dr["C_Email"].ToString()))
                        {
                            customerFamilyVo.EmailId = dr["C_Email"].ToString();
                        }
                        customerFamilyVo.FirstName    = dr["C_FirstName"].ToString();
                        customerFamilyVo.MiddleName   = dr["C_MiddleName"].ToString();
                        customerFamilyVo.LastName     = dr["C_LastName"].ToString();
                        customerFamilyVo.Relationship = dr["XR_Relationship"].ToString();
                        familyList.Add(customerFamilyVo);
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "CustomerFamilyDao.cs:GetCustomerFamily()");


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

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(familyList);
        }
Beispiel #12
0
        protected void btnCustomerProfile_Click(object sender, EventArgs e)
        {
            List <int> customerIds = null;

            try
            {
                if (chkdummypan.Checked)
                {
                    customerVo.DummyPAN = 1;
                }
                else
                {
                    customerVo.DummyPAN = 0;
                }
                if (Validation())
                {
                    customerIds = new List <int>();
                    if (rbtnIndividual.Checked)
                    {
                        customerVo.Type       = "IND";
                        customerVo.FirstName  = txtFirstName.Text.ToString();
                        customerVo.MiddleName = txtMiddleName.Text.ToString();
                        customerVo.LastName   = txtLastName.Text.ToString();
                        if (ddlSalutation.SelectedIndex == 0)
                        {
                            customerVo.Salutation = "";
                        }
                        else
                        {
                            customerVo.Salutation = ddlSalutation.SelectedValue.ToString();
                        }
                        userVo.FirstName  = txtFirstName.Text.ToString();
                        userVo.MiddleName = txtMiddleName.Text.ToString();
                        userVo.LastName   = txtLastName.Text.ToString();
                    }
                    else if (rbtnNonIndividual.Checked)
                    {
                        customerVo.Type       = "NIND";
                        customerVo.FirstName  = txtCompanyName.Text.ToString();
                        customerVo.LastName   = txtFirstName.Text.ToString();
                        customerVo.MiddleName = txtMiddleName.Text.ToString();
                        //customerVo.FirstName = txtLastName.Text.ToString();
                        userVo.LastName = txtCompanyName.Text.ToString();
                    }
                    //customerVo.CustomerId = customerBo.GenerateId();
                    customerVo.BranchId = int.Parse(ddlAdviserBranchList.SelectedValue);
                    customerVo.SubType  = ddlCustomerSubType.SelectedItem.Value;
                    customerVo.Email    = txtEmail.Text.ToString();
                    customerVo.PANNum   = txtPanNumber.Text.ToString();
                    userVo.Email        = txtEmail.Text.ToString();
                    userVo.UserType     = "Customer";
                    customerVo.Dob      = DateTime.MinValue;
                    if (chkdummypan.Checked)
                    {
                        customerVo.DummyPAN = 1;
                    }
                    else
                    {
                        customerVo.DummyPAN = 0;
                    }
                    customerVo.ProfilingDate              = DateTime.Today;
                    customerVo.RBIApprovalDate            = DateTime.MinValue;
                    customerVo.CommencementDate           = DateTime.MinValue;
                    customerVo.RegistrationDate           = DateTime.MinValue;
                    customerVo.RmId                       = int.Parse(ddlAdviseRMList.SelectedValue.ToString());
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";
                    customerIds            = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, tempUserVo.UserId);
                    Session["customerIds"] = customerIds;
                    if (customerIds != null)
                    {
                        CustomerFamilyVo familyVo = new CustomerFamilyVo();
                        CustomerFamilyBo familyBo = new CustomerFamilyBo();
                        familyVo.AssociateCustomerId = customerIds[1];
                        familyVo.CustomerId          = customerIds[1];
                        familyVo.Relationship        = "SELF";
                        familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId);
                    }
                    Session["CustomerVo"] = customerBo.GetCustomer(customerIds[1]);
                    if (rbtnNonIndividual.Checked)
                    {
                        // ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerNonIndividualAdd','none');", true);
                        Response.Redirect("ControlHost.aspx?pageid=CustomerNonIndividualAdd&RmId=" + customerVo.RmId + "", false);
                    }
                    else if (rbtnIndividual.Checked)
                    {
                        //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerIndividualAdd','none');", true);
                        Response.Redirect("ControlHost.aspx?pageid=CustomerIndividualAdd&RmId=" + customerVo.RmId + "", false);
                    }
                }
                else
                {
                }
            }

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

                FunctionInfo.Add("Method", "CustomerType.ascx:btnCustomerProfile_Click()");

                object[] objects = new object[5];
                objects[0] = customerPortfolioVo;
                objects[1] = customerVo;
                objects[2] = rmVo;
                objects[3] = userVo;
                objects[4] = customerIds;
                objects[5] = assetInterest;


                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #13
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            List <int> customerIds = null;

            try
            {
                if (chkdummypan.Checked)
                {
                    customerVo.DummyPAN = 1;
                }
                else
                {
                    customerVo.DummyPAN = 0;
                }
                Nullable <DateTime> dt = new DateTime();
                customerIds             = new List <int>();
                lblPanDuplicate.Visible = false;
                if (Validation())
                {
                    userVo = new UserVo();
                    if (rbtnIndividual.Checked)
                    {
                        rmVo       = (RMVo)Session["rmVo"];
                        tempUserVo = (UserVo)Session["userVo"];
                        //customerVo.RmId = rmVo.RMId;
                        customerVo.RmId       = int.Parse(ddlAdviseRMList.SelectedValue.ToString());
                        customerVo.Type       = "IND";
                        customerVo.FirstName  = txtFirstName.Text.ToString();
                        customerVo.MiddleName = txtMiddleName.Text.ToString();
                        customerVo.LastName   = txtLastName.Text.ToString();
                        if (ddlSalutation.SelectedIndex == 0)
                        {
                            customerVo.Salutation = "";
                        }
                        else
                        {
                            customerVo.Salutation = ddlSalutation.SelectedValue.ToString();
                        }
                        userVo.FirstName  = txtFirstName.Text.ToString();
                        userVo.MiddleName = txtMiddleName.Text.ToString();
                        userVo.LastName   = txtLastName.Text.ToString();
                    }
                    else if (rbtnNonIndividual.Checked)
                    {
                        rmVo       = (RMVo)Session["rmVo"];
                        tempUserVo = (UserVo)Session["userVo"];
                        //customerVo.RmId = rmVo.RMId;
                        customerVo.RmId        = int.Parse(ddlAdviseRMList.SelectedValue.ToString());
                        customerVo.Type        = "NIND";
                        customerVo.CompanyName = txtCompanyName.Text.ToString();
                        customerVo.FirstName   = txtCompanyName.Text.ToString();
                        userVo.FirstName       = txtCompanyName.Text.ToString();
                    }
                    customerVo.BranchId = int.Parse(ddlAdviserBranchList.SelectedValue);

                    //if (chkprospect.Checked)
                    //{
                    //    customerVo.IsProspect = 1;
                    //}
                    //else
                    //{
                    //    customerVo.IsProspect = 0;
                    //}

                    customerVo.SubType          = ddlCustomerSubType.SelectedItem.Value;
                    customerVo.Email            = txtEmail.Text.ToString();
                    customerVo.PANNum           = txtPanNumber.Text.ToString();
                    customerVo.Dob              = DateTime.MinValue;
                    customerVo.RBIApprovalDate  = DateTime.MinValue;
                    customerVo.CommencementDate = DateTime.MinValue;
                    customerVo.RegistrationDate = DateTime.MinValue;
                    customerVo.Adr1State        = null;
                    customerVo.Adr2State        = null;
                    customerVo.ProfilingDate    = DateTime.Today;
                    customerVo.UserId           = userVo.UserId;
                    userVo.Email = txtEmail.Text.ToString();
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";
                    customerIds         = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, tempUserVo.UserId);
                    Session["Customer"] = "Customer";
                    if (customerIds != null)
                    {
                        CustomerFamilyVo familyVo = new CustomerFamilyVo();
                        CustomerFamilyBo familyBo = new CustomerFamilyBo();
                        familyVo.AssociateCustomerId = customerIds[1];
                        familyVo.CustomerId          = customerIds[1];
                        familyVo.Relationship        = "SELF";
                        familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId);
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('AdviserCustomer','none');", true);
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerType.ascx:btnSubmit_Click()");
                object[] objects = new object[5];
                objects[0]   = customerIds;
                objects[1]   = customerVo;
                objects[2]   = rmVo;
                objects[3]   = userVo;
                objects[4]   = customerPortfolioVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            List <int> customerIds = null;

            try
            {
                if (chkdummypan.Checked)
                {
                    customerVo.DummyPAN = 1;
                }
                else
                {
                    customerVo.DummyPAN = 0;
                }
                Nullable <DateTime> dt = new DateTime();
                customerIds             = new List <int>();
                lblPanDuplicate.Visible = false;
                if (Validation())
                {
                    lblPanDuplicate.Visible = false;
                    userVo = new UserVo();
                    if (rbtnIndividual.Checked)
                    {
                        rmVo            = (RMVo)Session["rmVo"];
                        tempUserVo      = (UserVo)Session["userVo"];
                        customerVo.RmId = rmVo.RMId;
                        if (customerVo.RmId == rmVo.RMId)
                        {
                            customerVo.RmId = int.Parse(ddlAdviseRMList.SelectedValue.ToString());
                        }
                        else
                        {
                            customerVo.RmId = int.Parse(ddlAdviseRMList.SelectedValue);
                        }
                        customerVo.Type = "IND";

                        customerVo.TaxStatusCustomerSubTypeId = Int16.Parse(ddlCustomerSubType.SelectedValue.ToString());
                        customerVo.CustCode       = txtClientCode.Text.Trim();
                        customerVo.IsRealInvestor = chkRealInvestor.Checked;
                        customerVo.FirstName      = txtFirstName.Text.ToString();
                        customerVo.MiddleName     = txtMiddleName.Text.ToString();
                        customerVo.LastName       = txtLastName.Text.ToString();
                        if (ddlSalutation.SelectedIndex == 0)
                        {
                            customerVo.Salutation = "";
                        }
                        else
                        {
                            customerVo.Salutation = ddlSalutation.SelectedValue.ToString();
                        }

                        userVo.FirstName  = txtFirstName.Text.ToString();
                        userVo.MiddleName = txtMiddleName.Text.ToString();
                        userVo.LastName   = txtLastName.Text.ToString();
                    }
                    else if (rbtnNonIndividual.Checked)
                    {
                        rmVo       = (RMVo)Session["rmVo"];
                        tempUserVo = (UserVo)Session["userVo"];
                        //customerVo.RmId = rmVo.RMId;
                        //customerVo.RmId = int.Parse(ddlAdviseRMList.SelectedValue.ToString());
                        if (customerVo.RmId == rmVo.RMId)
                        {
                            customerVo.RmId = int.Parse(ddlAdviseRMList.SelectedValue.ToString());
                        }
                        else
                        {
                            customerVo.RmId = int.Parse(ddlAdviseRMList.SelectedValue);
                        }
                        customerVo.Type = "NIND";

                        customerVo.TaxStatusCustomerSubTypeId = Int16.Parse(ddlCustomerSubType.SelectedValue.ToString());
                        customerVo.CustCode       = txtClientCode.Text.Trim();
                        customerVo.IsRealInvestor = chkRealInvestor.Checked;
                        customerVo.CompanyName    = txtCompanyName.Text.ToString();
                        customerVo.FirstName      = txtCompanyName.Text.ToString();
                        userVo.FirstName          = txtCompanyName.Text.ToString();
                    }
                    if (customerVo.BranchId == rmVo.BranchId)
                    {
                        customerVo.BranchId = int.Parse(ddlAdviserBranchList.SelectedValue);
                    }
                    else
                    {
                        customerVo.BranchId = int.Parse(ddlAdviserBranchList.SelectedValue);
                    }

                    //if (chkprospect.Checked)
                    //{
                    //    customerVo.IsProspect = 1;
                    //}
                    //else
                    //{
                    //    customerVo.IsProspect = 0;
                    //}

                    //customerVo.SubType = ddlCustomerSubType.SelectedItem.Value;
                    customerVo.Email  = txtEmail.Text.ToString();
                    customerVo.PANNum = txtPanNumber.Text.ToString();
                    if (!string.IsNullOrEmpty(txtMobileNumber.Text.ToString()))
                    {
                        customerVo.Mobile1 = Convert.ToInt64(txtMobileNumber.Text.ToString());
                    }
                    else
                    {
                        customerVo.Mobile1 = 0;
                    }
                    customerVo.Dob              = DateTime.MinValue;
                    customerVo.RBIApprovalDate  = DateTime.MinValue;
                    customerVo.CommencementDate = DateTime.MinValue;
                    customerVo.RegistrationDate = DateTime.MinValue;
                    customerVo.Adr1State        = null;
                    customerVo.Adr2State        = null;
                    customerVo.ProfilingDate    = DateTime.Today;
                    customerVo.UserId           = userVo.UserId;
                    userVo.Email = txtEmail.Text.ToString();
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";
                    customerVo.ViaSMS   = 1;
                    customerIds         = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, tempUserVo.UserId);
                    Session["Customer"] = "Customer";

                    if (customerIds != null)
                    {
                        CustomerFamilyVo familyVo = new CustomerFamilyVo();
                        CustomerFamilyBo familyBo = new CustomerFamilyBo();
                        familyVo.AssociateCustomerId = customerIds[1];
                        familyVo.CustomerId          = customerIds[1];
                        familyVo.Relationship        = "SELF";
                        familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId);

                        if (page == "Entry")
                        {
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('OrderEntry','?CustomerId=" + familyVo.CustomerId + " ');", true);
                        }
                        else
                        {
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Customer Added Successfully!!');", true);
                        }
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('AdviserCustomer','none');", true);
                        //trSumbitSuccess.Visible = true;
                        MakeReadonlyControls();
                        if (Request.QueryString["AddMFCustLinkId"] != null)
                        {
                            lblPanDuplicate.Visible = false;
                            MakeReadonlyControls();
                            Response.Write("<script>alert('Customer has been successfully added');</script>");
                            Response.Write("<script>window.close();</" + "script>");
                        }
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "CustomerType.ascx:btnSubmit_Click()");
                object[] objects = new object[5];
                objects[0]   = customerIds;
                objects[1]   = customerVo;
                objects[2]   = rmVo;
                objects[3]   = userVo;
                objects[4]   = customerPortfolioVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #15
0
        //Seventh phase: Profile creation
        public bool StdInsertCustomerDetails(int adviserId, int processId, int rmId, int branchId, string xmlPath, out int countCustCreated)
        {
            bool IsProcessComplete = false;
            List <StandardProfileUploadVo> stdNewCustomerList = new List <StandardProfileUploadVo>();
            Nullable <DateTime>            dt = new DateTime();
            StandardProfileUploadVo        StandardProfileUploadVo = new StandardProfileUploadVo();

            countCustCreated = 0;
            DataSet   getNewFoliosDs = new DataSet();
            DataTable getNewFoliosDt = new DataTable();

            userId = advisorStaffBo.GetUserId(rmId);
            int    lenPhoneNum = 0, lenFaxNum = 0;
            string resIsdCode = "", resStdCode = "", resPhoneNum = "", offIsdCode = "", offStdCode = "", offPhoneNum = "";
            string resFaxIsdCode = "", resFaxStdCode = "", resFaxNum = "", offFaxIsdCode = "", offFaxStdCode = "", offFaxNum = "";

            try
            {
                stdNewCustomerList = GetProfileNewCustomers(processId);
                for (int i = 0; i < stdNewCustomerList.Count; i++)
                {
                    customerVo = new CustomerVo();
                    userVo     = new UserVo();
                    StandardProfileUploadVo = new StandardProfileUploadVo();
                    StandardProfileUploadVo = stdNewCustomerList[i];

                    userVo.FirstName  = StandardProfileUploadVo.FirstName;
                    userVo.MiddleName = StandardProfileUploadVo.MiddleName;
                    userVo.LastName   = StandardProfileUploadVo.LastName;

                    userVo.Email    = StandardProfileUploadVo.Email;
                    userVo.UserType = "Customer";

                    customerVo.UserId    = userId;
                    customerVo.RmId      = StandardProfileUploadsDao.GetBranchHeadId(branchId);
                    customerVo.BranchId  = branchId;
                    customerVo.ProcessId = processId;
                    customerVo.Adr1City  = StandardProfileUploadVo.Adr1City;
                    customerVo.Adr1Line1 = StandardProfileUploadVo.Adr1Line1;
                    customerVo.Adr1Line2 = StandardProfileUploadVo.Adr1Line2;
                    customerVo.Adr1Line3 = StandardProfileUploadVo.Adr1Line3;
                    if (StandardProfileUploadVo.Adr1PinCode != "")
                    {
                        customerVo.Adr1PinCode = Int32.Parse(StandardProfileUploadVo.Adr1PinCode);
                    }
                    customerVo.Email       = StandardProfileUploadVo.Email;
                    customerVo.FirstName   = StandardProfileUploadVo.FirstName;
                    customerVo.MiddleName  = StandardProfileUploadVo.MiddleName;
                    customerVo.LastName    = StandardProfileUploadVo.LastName;
                    customerVo.Gender      = StandardProfileUploadVo.Gender;
                    customerVo.Salutation  = StandardProfileUploadVo.Salutation;
                    customerVo.Adr1City    = StandardProfileUploadVo.Adr1City;
                    customerVo.Adr1Country = StandardProfileUploadVo.Adr1Country;
                    customerVo.Adr1State   = XMLBo.GetStateCode(xmlPath, StandardProfileUploadVo.Adr1State);
                    customerVo.Adr2City    = StandardProfileUploadVo.Adr2City;
                    customerVo.Adr2Country = StandardProfileUploadVo.Adr2Country;
                    customerVo.Adr2Line1   = StandardProfileUploadVo.Adr2Line1;
                    customerVo.Adr2Line2   = StandardProfileUploadVo.Adr2Line2;
                    customerVo.Adr2Line3   = StandardProfileUploadVo.Adr2Line3;
                    if (StandardProfileUploadVo.Adr2PinCode != "")
                    {
                        customerVo.Adr2PinCode = Int32.Parse(StandardProfileUploadVo.Adr2PinCode);
                    }
                    customerVo.Adr2State         = StandardProfileUploadVo.Adr2State;
                    customerVo.AltEmail          = StandardProfileUploadVo.AltEmail;
                    customerVo.AssignedRM        = (customerVo.RmId).ToString();
                    customerVo.CompanyName       = StandardProfileUploadVo.CompanyName;
                    customerVo.CompanyWebsite    = StandardProfileUploadVo.CompanyWebsite;
                    customerVo.ContactFirstName  = StandardProfileUploadVo.ContactGuardianFirstName;
                    customerVo.ContactMiddleName = StandardProfileUploadVo.ContactGuardianMiddleName;
                    customerVo.ContactLastName   = StandardProfileUploadVo.ContactGuardianLastName;
                    if (StandardProfileUploadVo.Mobile1 != "")
                    {
                        customerVo.Mobile1 = Int64.Parse(StandardProfileUploadVo.Mobile1);
                    }
                    if (StandardProfileUploadVo.Mobile2 != "")
                    {
                        customerVo.Mobile2 = Int64.Parse(StandardProfileUploadVo.Mobile2);
                    }
                    if (StandardProfileUploadVo.Nationality != "")
                    {
                        customerVo.Nationality = StandardProfileUploadVo.Nationality;
                    }
                    if (StandardProfileUploadVo.Occupation != "")
                    {
                        customerVo.Occupation = StandardProfileUploadVo.Occupation;
                    }
                    if (StandardProfileUploadVo.MaritalStatus != "")
                    {
                        customerVo.MaritalStatus = StandardProfileUploadVo.MaritalStatus;
                    }
                    if (StandardProfileUploadVo.Qualification != "")
                    {
                        customerVo.Qualification = StandardProfileUploadVo.Qualification;
                    }


                    customerVo.IsProspect    = StandardProfileUploadVo.IsProspect;
                    customerVo.OfcAdrCity    = StandardProfileUploadVo.OfcAdrCity;
                    customerVo.OfcAdrCountry = StandardProfileUploadVo.OfcAdrCountry;
                    customerVo.OfcAdrLine1   = StandardProfileUploadVo.OfcAdrLine1;
                    customerVo.OfcAdrLine2   = StandardProfileUploadVo.OfcAdrLine2;
                    customerVo.OfcAdrLine3   = StandardProfileUploadVo.OfcAdrLine3;
                    if (StandardProfileUploadVo.OfcAdrPinCode != "")
                    {
                        customerVo.OfcAdrPinCode = Int32.Parse(StandardProfileUploadVo.OfcAdrPinCode);
                    }
                    customerVo.OfcAdrState = StandardProfileUploadVo.OfcAdrState;
                    if (StandardProfileUploadVo.RBIApprovalDate != "")
                    {
                        customerVo.RBIApprovalDate = DateTime.Parse(StandardProfileUploadVo.RBIApprovalDate);
                    }

                    customerVo.RBIRefNum       = StandardProfileUploadVo.RBIRefNum;
                    customerVo.RegistrationNum = StandardProfileUploadVo.RegistrationNum;
                    //customerVo.LoginId = StandardProfileUploadVo.Email;

                    if (StandardProfileUploadVo.Type != "")
                    {
                        customerVo.Type = StandardProfileUploadVo.Type;
                    }
                    if (StandardProfileUploadVo.SubType != "")
                    {
                        customerVo.SubType = StandardProfileUploadVo.SubType;
                    }


                    lenPhoneNum = StandardProfileUploadVo.OfcPhoneNum.Length;
                    if (lenPhoneNum > 9)
                    {
                        if (lenPhoneNum >= 8)
                        {
                            offPhoneNum = StandardProfileUploadVo.OfcPhoneNum.Substring(lenPhoneNum - 8, 8);
                            if (lenPhoneNum >= 11)
                            {
                                offStdCode = StandardProfileUploadVo.OfcPhoneNum.Substring(lenPhoneNum - 11, 3);
                                if (lenPhoneNum >= 12)
                                {
                                    offIsdCode = StandardProfileUploadVo.OfcPhoneNum.Substring(0, lenPhoneNum - 11);
                                }
                            }
                            else
                            {
                                offStdCode = StandardProfileUploadVo.OfcPhoneNum.Substring(0, lenPhoneNum - 8);
                            }
                        }
                        else
                        {
                            offPhoneNum = StandardProfileUploadVo.OfcPhoneNum;
                        }
                        if (offIsdCode != "")
                        {
                            customerVo.OfcISDCode = Int32.Parse(offIsdCode);
                        }
                        else
                        {
                            customerVo.OfcISDCode = 0;
                        }
                        if (offStdCode != "")
                        {
                            customerVo.OfcSTDCode = Int32.Parse(offStdCode);
                        }
                        else
                        {
                            customerVo.OfcSTDCode = 0;
                        }
                        if (offPhoneNum != "")
                        {
                            customerVo.OfcPhoneNum = Int32.Parse(offPhoneNum);
                        }
                        else
                        {
                            customerVo.OfcPhoneNum = 0;
                        }
                    }
                    else
                    {
                        if (StandardProfileUploadVo.OfcISDCode != "")
                        {
                            customerVo.OfcISDCode = Int32.Parse(StandardProfileUploadVo.OfcISDCode);
                        }
                        if (StandardProfileUploadVo.OfcSTDCode != "")
                        {
                            customerVo.OfcSTDCode = Int32.Parse(StandardProfileUploadVo.OfcSTDCode);
                        }
                        if (StandardProfileUploadVo.OfcPhoneNum != "")
                        {
                            customerVo.OfcPhoneNum = Int32.Parse(StandardProfileUploadVo.OfcPhoneNum);
                        }
                    }



                    lenPhoneNum = StandardProfileUploadVo.ResPhoneNum.Length;
                    if (lenPhoneNum > 9)
                    {
                        if (lenPhoneNum >= 8)
                        {
                            resPhoneNum = StandardProfileUploadVo.ResPhoneNum.Substring(lenPhoneNum - 8, 8);
                            if (lenPhoneNum >= 11)
                            {
                                resStdCode = StandardProfileUploadVo.ResPhoneNum.Substring(lenPhoneNum - 11, 3);
                                if (lenPhoneNum >= 12)
                                {
                                    resIsdCode = StandardProfileUploadVo.ResPhoneNum.Substring(0, lenPhoneNum - 11);
                                }
                            }
                            else
                            {
                                resStdCode = StandardProfileUploadVo.ResPhoneNum.Substring(0, lenPhoneNum - 8);
                            }
                        }
                        else
                        {
                            resPhoneNum = StandardProfileUploadVo.ResPhoneNum;
                        }


                        if (resIsdCode != "")
                        {
                            customerVo.ResISDCode = Int32.Parse(resIsdCode);
                        }
                        else
                        {
                            customerVo.ResISDCode = 0;
                        }
                        if (resStdCode != "")
                        {
                            customerVo.ResSTDCode = Int32.Parse(resStdCode);
                        }
                        else
                        {
                            customerVo.ResSTDCode = 0;
                        }
                        if (resPhoneNum != "")
                        {
                            customerVo.ResPhoneNum = Int32.Parse(resPhoneNum);
                        }
                        else
                        {
                            customerVo.ResPhoneNum = 0;
                        }
                    }
                    else
                    {
                        if (StandardProfileUploadVo.ResISDCode != "")
                        {
                            customerVo.ResISDCode = Int32.Parse(StandardProfileUploadVo.ResISDCode);
                        }
                        if (StandardProfileUploadVo.ResSTDCode != "")
                        {
                            customerVo.ResSTDCode = Int32.Parse(StandardProfileUploadVo.ResSTDCode);
                        }
                        if (StandardProfileUploadVo.ResPhoneNum != "")
                        {
                            customerVo.ResPhoneNum = Int32.Parse(StandardProfileUploadVo.ResPhoneNum);
                        }
                    }

                    lenFaxNum = StandardProfileUploadVo.OfcFax.Length;
                    if (lenFaxNum > 9)
                    {
                        if (lenFaxNum >= 8)
                        {
                            offFaxNum = StandardProfileUploadVo.OfcFax.Substring(lenFaxNum - 8, 8);
                            if (lenFaxNum >= 11)
                            {
                                offFaxStdCode = StandardProfileUploadVo.OfcFax.Substring(lenFaxNum - 11, 3);
                                if (lenFaxNum >= 12)
                                {
                                    offFaxIsdCode = StandardProfileUploadVo.OfcFax.Substring(0, lenFaxNum - 11);
                                }
                            }
                            else
                            {
                                offFaxStdCode = StandardProfileUploadVo.OfcFax.Substring(0, lenFaxNum - 8);
                            }
                        }
                        else
                        {
                            offFaxNum = StandardProfileUploadVo.OfcFax;
                        }
                        if (offFaxIsdCode != "")
                        {
                            customerVo.ISDFax = Int32.Parse(offFaxIsdCode);
                        }
                        else
                        {
                            customerVo.ISDFax = 0;
                        }
                        if (offFaxStdCode != "")
                        {
                            customerVo.STDFax = Int32.Parse(offFaxStdCode);
                        }
                        else
                        {
                            customerVo.STDFax = 0;
                        }
                        if (offFaxNum != "")
                        {
                            customerVo.Fax = Int32.Parse(offFaxNum);
                        }
                        else
                        {
                            customerVo.Fax = 0;
                        }
                    }
                    else
                    {
                        if (StandardProfileUploadVo.OfcFaxISD != "")
                        {
                            customerVo.OfcISDFax = Int32.Parse(StandardProfileUploadVo.OfcFaxISD);
                        }
                        if (StandardProfileUploadVo.OfcFaxSTD != "")
                        {
                            customerVo.OfcSTDFax = Int32.Parse(StandardProfileUploadVo.OfcFaxSTD);
                        }
                        if (StandardProfileUploadVo.OfcFax != "")
                        {
                            customerVo.OfcFax = Int32.Parse(StandardProfileUploadVo.OfcFax);
                        }
                    }


                    lenFaxNum = StandardProfileUploadVo.Fax.Length;
                    if (lenFaxNum > 9)
                    {
                        if (lenFaxNum >= 8)
                        {
                            resFaxNum = StandardProfileUploadVo.Fax.Substring(lenFaxNum - 8, 8);
                            if (lenFaxNum >= 11)
                            {
                                resFaxStdCode = StandardProfileUploadVo.Fax.Substring(lenFaxNum - 11, 3);
                                if (lenFaxNum >= 12)
                                {
                                    resFaxIsdCode = StandardProfileUploadVo.Fax.Substring(0, lenFaxNum - 11);
                                }
                            }
                            else
                            {
                                resFaxStdCode = StandardProfileUploadVo.Fax.Substring(0, lenFaxNum - 8);
                            }
                        }
                        else
                        {
                            resFaxNum = StandardProfileUploadVo.Fax;
                        }
                        if (resFaxIsdCode != "")
                        {
                            customerVo.ISDFax = Int32.Parse(resFaxIsdCode);
                        }
                        else
                        {
                            customerVo.ISDFax = 0;
                        }
                        if (offFaxStdCode != "")
                        {
                            customerVo.STDFax = Int32.Parse(resFaxStdCode);
                        }
                        else
                        {
                            customerVo.STDFax = 0;
                        }
                        if (offFaxNum != "")
                        {
                            customerVo.Fax = Int32.Parse(resFaxNum);
                        }
                        else
                        {
                            customerVo.Fax = 0;
                        }
                    }
                    else
                    {
                        if (StandardProfileUploadVo.ISDFax != "")
                        {
                            customerVo.OfcISDFax = Int32.Parse(StandardProfileUploadVo.ISDFax);
                        }
                        if (StandardProfileUploadVo.STDFax != "")
                        {
                            customerVo.OfcSTDFax = Int32.Parse(StandardProfileUploadVo.STDFax);
                        }
                        if (StandardProfileUploadVo.Fax != "")
                        {
                            customerVo.OfcFax = Int32.Parse(StandardProfileUploadVo.Fax);
                        }
                    }



                    customerVo.PANNum   = StandardProfileUploadVo.PANNum;
                    customerVo.Password = id.Next(10000, 99999).ToString();
                    if (StandardProfileUploadVo.DOB != "")
                    {
                        customerVo.Dob = DateTime.Parse(StandardProfileUploadVo.DOB);
                    }
                    customerVo.ProfilingDate = DateTime.Today;
                    if (StandardProfileUploadVo.RegistrationDate != "")
                    {
                        customerVo.RegistrationDate = DateTime.Parse(StandardProfileUploadVo.RegistrationDate);
                    }
                    if (StandardProfileUploadVo.CommencementDate != "")
                    {
                        customerVo.CommencementDate = DateTime.Parse(StandardProfileUploadVo.CommencementDate);
                    }

                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";
                    customerIds = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, userId);

                    //Creating Customer Association
                    if (customerIds != null)
                    {
                        CustomerFamilyVo familyVo = new CustomerFamilyVo();
                        CustomerFamilyBo familyBo = new CustomerFamilyBo();
                        familyVo.AssociateCustomerId = customerIds[1];
                        familyVo.CustomerId          = customerIds[1];
                        familyVo.Relationship        = "SELF";
                        familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId);
                    }

                    countCustCreated++;
                }

                UpdateProfileStagingIsCustomerNew(adviserId, processId, branchId);
                IsProcessComplete = true;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "StandardProfileUploadBo.cs:StdInsertCustomerDetails()");

                object[] objects = new object[3];
                objects[0] = adviserId;
                objects[1] = processId;
                objects[2] = rmId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(IsProcessComplete);
        }
Beispiel #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SessionBo.CheckSession();
                userVo                = (UserVo)Session["userVo"];
                customerVo            = customerBo.GetCustomerInfo(userVo.UserId);
                Session["CustomerVo"] = customerVo;
                lblName.Text          = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString();
                lblPhone.Text         = customerVo.ResISDCode.ToString() + " - " + customerVo.ResSTDCode.ToString() + " - " + customerVo.ResPhoneNum.ToString();
                lblAddress.Text       = customerVo.Adr1Line1.ToString() + "<br />" + customerVo.Adr1Line1.ToString() + "<br />" + customerVo.Adr1Line2.ToString() + "<br />" + customerVo.Adr1Line3.ToString() + "<br />" + customerVo.Adr1PinCode.ToString() + "<br />" + customerVo.Adr1State.ToString() + "<br />" + customerVo.Adr1City.ToString() + "<br />" + customerVo.Adr1Country.ToString();
                customerFamilyList    = customerFamilyBo.GetCustomerFamily(customerVo.CustomerId);
                if (customerFamilyList != null)
                {
                    trFamilyMembers.Visible = true;
                    DataTable dtCustomerFamilyList = new DataTable();
                    dtCustomerFamilyList.Columns.Add("AssociationId");
                    dtCustomerFamilyList.Columns.Add("Name");
                    dtCustomerFamilyList.Columns.Add("Relationship");

                    DataRow drCustomerFamily;
                    for (int i = 0; i < customerFamilyList.Count; i++)
                    {
                        drCustomerFamily = dtCustomerFamilyList.NewRow();
                        CustomerFamilyVo customerFamilyVo = new CustomerFamilyVo();
                        customerFamilyVo    = customerFamilyList[i];
                        drCustomerFamily[0] = customerFamilyVo.AssociationId.ToString();
                        drCustomerFamily[1] = customerFamilyVo.AssociateCustomerName.ToString();
                        drCustomerFamily[2] = customerFamilyVo.Relationship;
                        dtCustomerFamilyList.Rows.Add(drCustomerFamily);
                    }
                    if (dtCustomerFamilyList.Rows.Count > 0)
                    {
                        gvFamilyMembers.DataSource = dtCustomerFamilyList;
                        gvFamilyMembers.DataBind();
                        gvFamilyMembers.Visible = true;
                        trFamilyMembers.Visible = true;
                    }
                    else
                    {
                        gvFamilyMembers.DataSource = null;
                        gvFamilyMembers.DataBind();
                        trFamilyMembers.Visible = false;
                    }
                }
                else
                {
                    gvFamilyMembers.DataSource = null;
                    gvFamilyMembers.DataBind();
                    trFamilyMembers.Visible = false;
                }
            }

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

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

                object[] objects = new object[2];

                objects[1] = customerVo;
                objects[2] = userVo;

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