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;
            }
        }
Esempio n. 2
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]);
        }
Esempio n. 3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            List <int> customerIds = null;


            try
            {
                if (Validation())
                {
                    userVo = new UserVo();
                    if (rbtnIndividual.Checked)
                    {
                        customerVo.RmId       = 100;
                        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();
                    }
                    if (rbtnNonIndividual.Checked)
                    {
                        customerVo.RmId        = 100;
                        customerVo.Type        = "NIND";
                        customerVo.CompanyName = txtCompanyName.Text.ToString();
                        customerVo.LastName    = txtCompanyName.Text.ToString();
                        userVo.LastName        = txtCompanyName.Text.ToString();
                    }

                    userVo.LoginId  = txtEmail.Text.ToString();
                    userVo.Email    = txtEmail.Text.ToString();
                    userVo.Password = r.Next(20000, 100000).ToString();


                    customerVo.SubType          = ddlCustomerSubType.SelectedItem.Value;
                    customerVo.Email            = txtEmail.Text.ToString();
                    customerVo.Dob              = DateTime.MinValue;
                    customerVo.RBIApprovalDate  = DateTime.MinValue;
                    customerVo.CommencementDate = DateTime.MinValue;
                    customerVo.RegistrationDate = DateTime.MinValue;
                    if (ddlState.SelectedIndex != 0)
                    {
                        customerVo.Adr1State = ddlState.SelectedItem.Value.ToString();
                    }
                    else
                    {
                        customerVo.Adr1State = null;
                    }
                    customerVo.Adr2State = null;

                    customerVo.Adr1City    = txtCity.Text.ToString();
                    customerVo.Adr1Country = ddlCountry.SelectedItem.Value.ToString();
                    customerVo.Adr1Line1   = txtAddressLine1.Text.ToString();
                    customerVo.Adr1Line2   = txtAddressLine2.Text.ToString();
                    customerVo.Adr1Line3   = txtAddressLine3.Text.ToString();
                    if (txtPinCode.Text != "")
                    {
                        customerVo.Adr1PinCode = int.Parse(txtPinCode.Text.ToString());
                    }
                    else
                    {
                        customerVo.Adr1PinCode = 0;
                    }
                    customerVo.PANNum = txtPanNumber.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.ProfilingDate = DateTime.MinValue;
                    customerVo.Email         = txtEmail.Text.ToString();
                    customerVo.AltEmail      = txtAltEmail.Text.ToString();
                    //userVo.UserId = customerBo.GenerateId();
                    customerVo.UserId = userVo.UserId;

                    userVo.Email = txtEmail.Text.ToString();
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";
                    customerIds = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, customerVo.RmId);
                    UserVo newUser = userBo.GetUserDetails(customerIds[0]);
                    Session["userVo"] = newUser;

                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('UserLoginMessage','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", "DirectInvestorRegistration.ascx:btnSubmit_Click()");
                object[] objects = new object[4];
                objects[0]   = customerIds;
                objects[1]   = customerVo;
                objects[2]   = userVo;
                objects[3]   = customerPortfolioVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        //Fifth Phase: Move WerpMF customer details to customer table
        public bool WerpMFInsertCustomerDetails(int adviserId, int processId, int rmId, out int countCustCreated, out int countFolioCreated)
        {
            bool IsProcessComplete = false;
            List <WerpMFUploadsVo> werpMFNewCustomerList = new List <WerpMFUploadsVo>();
            Nullable <DateTime>    dt = new DateTime();
            WerpMFUploadsVo        werpMFUploadsVo = new WerpMFUploadsVo();
            string resIsdCode = "", resStdCode = "", resPhoneNum = "", offIsdCode = "", offStdCode = "", offPhoneNum = "";
            string resFaxIsdCode = "", resFaxStdCode = "", resFaxNum = "", offFaxIsdCode = "", offFaxStdCode = "", offFaxNum = "";
            int    lenPhoneNum;
            int    lenFaxNum;

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

            userId = advisorstaffBo.GetUserId(rmId);

            try
            {
                werpMFNewCustomerList = GetWerpMFProfNewCustomers(processId);
                for (int i = 0; i < werpMFNewCustomerList.Count; i++)
                {
                    customerVo      = new CustomerVo();
                    userVo          = new UserVo();
                    werpMFUploadsVo = new WerpMFUploadsVo();

                    werpMFUploadsVo   = werpMFNewCustomerList[i];
                    userVo.FirstName  = werpMFUploadsVo.FirstName;
                    userVo.MiddleName = werpMFUploadsVo.MiddleName;
                    userVo.LastName   = werpMFUploadsVo.LastName;
                    userVo.Password   = id.Next(10000, 99999).ToString();
                    userVo.Email      = werpMFUploadsVo.Email;
                    userVo.LoginId    = werpMFUploadsVo.Email;
                    userVo.UserType   = "Customer";

                    //userId = userBo.CreateUser(userVo);

                    customerVo.UserId = userId;
                    customerVo.RmId   = rmId;

                    customerVo.FirstName  = werpMFUploadsVo.FirstName;
                    customerVo.MiddleName = werpMFUploadsVo.MiddleName;
                    customerVo.LastName   = werpMFUploadsVo.LastName;
                    customerVo.Gender     = werpMFUploadsVo.Gender;
                    if (werpMFUploadsVo.DOB == "")
                    {
                        customerVo.Dob = DateTime.Parse(dt.ToString());
                    }
                    else
                    {
                        customerVo.Dob = DateTime.Parse(werpMFUploadsVo.DOB);
                    }
                    if (werpMFUploadsVo.Type != "")
                    {
                        customerVo.Type = werpMFUploadsVo.Type;
                    }
                    if (werpMFUploadsVo.SubType != "")
                    {
                        customerVo.SubType = werpMFUploadsVo.SubType;
                    }
                    customerVo.Salutation = werpMFUploadsVo.Salutation;
                    customerVo.PANNum     = werpMFUploadsVo.PanNumber;
                    customerVo.Adr1Line1  = werpMFUploadsVo.Address1;
                    customerVo.Adr1Line2  = werpMFUploadsVo.Address2;
                    customerVo.Adr1Line3  = werpMFUploadsVo.Address3;
                    if (werpMFUploadsVo.Pincode == "")
                    {
                        customerVo.Adr1PinCode = 0;
                    }
                    else
                    {
                        customerVo.Adr1PinCode = Int32.Parse(werpMFUploadsVo.Pincode);
                    }
                    customerVo.Adr1City    = werpMFUploadsVo.City;
                    customerVo.Adr1State   = werpMFUploadsVo.State;
                    customerVo.Adr1Country = werpMFUploadsVo.Country;
                    customerVo.Adr2Line1   = werpMFUploadsVo.Address2Line1;
                    customerVo.Adr2Line2   = werpMFUploadsVo.Address2Line2;
                    customerVo.Adr2Line3   = werpMFUploadsVo.Address2Line3;
                    if (werpMFUploadsVo.Address2Pincode == "")
                    {
                        customerVo.Adr2PinCode = 0;
                    }
                    else
                    {
                        customerVo.Adr2PinCode = Int32.Parse(werpMFUploadsVo.Address2Pincode);
                    }
                    customerVo.Adr2City    = werpMFUploadsVo.Address2City;
                    customerVo.Adr2Country = werpMFUploadsVo.Address2Country;
                    customerVo.Adr2State   = werpMFUploadsVo.Address2State;
                    customerVo.Email       = werpMFUploadsVo.Email;
                    customerVo.AltEmail    = werpMFUploadsVo.AltEmail;
                    if (werpMFUploadsVo.Mobile1 == "")
                    {
                        customerVo.Mobile1 = 0;
                    }
                    else
                    {
                        customerVo.Mobile1 = Int32.Parse(werpMFUploadsVo.Mobile1);
                    }
                    if (werpMFUploadsVo.Mobile2 == "")
                    {
                        customerVo.Mobile2 = 0;
                    }
                    else
                    {
                        customerVo.Mobile2 = Int32.Parse(werpMFUploadsVo.Mobile2);
                    }
                    if (werpMFUploadsVo.Occupation != "")
                    {
                        customerVo.Occupation = werpMFUploadsVo.Occupation;
                    }
                    if (werpMFUploadsVo.Qualification != "")
                    {
                        customerVo.Qualification = werpMFUploadsVo.Qualification;
                    }
                    //customerVo.MarriageDate
                    if (werpMFUploadsVo.MaritalStatus != "")
                    {
                        customerVo.MaritalStatus = werpMFUploadsVo.MaritalStatus;
                    }
                    if (werpMFUploadsVo.Nationality != "")
                    {
                        customerVo.Nationality = werpMFUploadsVo.Nationality;
                    }
                    customerVo.RBIRefNum = werpMFUploadsVo.RBIRefNum;
                    if (werpMFUploadsVo.RBIApprovalDate == "")
                    {
                        customerVo.RBIApprovalDate = DateTime.Parse(dt.ToString());
                    }
                    else
                    {
                        customerVo.RBIApprovalDate = DateTime.Parse(werpMFUploadsVo.RBIApprovalDate.ToString());
                    }
                    customerVo.CompanyName = werpMFUploadsVo.CompanyName;
                    customerVo.OfcAdrLine1 = werpMFUploadsVo.OfcAddress1;
                    customerVo.OfcAdrLine2 = werpMFUploadsVo.OfcAddress2;
                    customerVo.OfcAdrLine3 = werpMFUploadsVo.OfcAddress3;
                    if (werpMFUploadsVo.OfcAddressPincode == "")
                    {
                        customerVo.OfcAdrPinCode = 0;
                    }
                    else
                    {
                        customerVo.OfcAdrPinCode = Int32.Parse(werpMFUploadsVo.OfcAddressPincode);
                    }
                    customerVo.OfcAdrState   = werpMFUploadsVo.State;
                    customerVo.OfcAdrCity    = werpMFUploadsVo.OfcAddressCity;
                    customerVo.OfcAdrCountry = werpMFUploadsVo.OfcAddressCountry;
                    if (werpMFUploadsVo.RegistrationDate == "")
                    {
                        customerVo.RegistrationDate = DateTime.Parse(dt.ToString());
                    }
                    else
                    {
                        customerVo.RegistrationDate = DateTime.Parse(werpMFUploadsVo.RegistrationDate.ToString());
                    }
                    if (werpMFUploadsVo.CommencementDate == "")
                    {
                        customerVo.CommencementDate = DateTime.Parse(dt.ToString());
                    }
                    else
                    {
                        customerVo.CommencementDate = DateTime.Parse(werpMFUploadsVo.CommencementDate.ToString());
                    }
                    customerVo.RegistrationPlace = werpMFUploadsVo.RegistrationPlace;
                    customerVo.RegistrationNum   = werpMFUploadsVo.ResPhoneNum;
                    customerVo.CompanyWebsite    = werpMFUploadsVo.CompanyWebsite;
                    customerVo.LoginId           = werpMFUploadsVo.Email;
                    customerVo.Password          = id.Next(10000, 99999).ToString();
                    //**************************************************************************
                    //Office phone number
                    lenPhoneNum = werpMFUploadsVo.OfcPhoneNum.Length;
                    if (lenPhoneNum >= 8)
                    {
                        offPhoneNum = werpMFUploadsVo.OfcPhoneNum.Substring(lenPhoneNum - 8, 8);
                        if (lenPhoneNum >= 11)
                        {
                            offStdCode = werpMFUploadsVo.OfcPhoneNum.Substring(lenPhoneNum - 11, 3);
                            if (lenPhoneNum >= 12)
                            {
                                offIsdCode = werpMFUploadsVo.OfcPhoneNum.Substring(0, lenPhoneNum - 11);
                            }
                        }
                        else
                        {
                            offStdCode = werpMFUploadsVo.OfcPhoneNum.Substring(0, lenPhoneNum - 8);
                        }
                    }
                    else
                    {
                        offPhoneNum = werpMFUploadsVo.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;
                    }

                    //**************************************************************************
                    //residence phone number

                    lenPhoneNum = werpMFUploadsVo.ResPhoneNum.Length;
                    if (lenPhoneNum >= 8)
                    {
                        resPhoneNum = werpMFUploadsVo.ResPhoneNum.Substring(lenPhoneNum - 8, 8);
                        if (lenPhoneNum >= 11)
                        {
                            resStdCode = werpMFUploadsVo.ResPhoneNum.Substring(lenPhoneNum - 11, 3);
                            if (lenPhoneNum >= 12)
                            {
                                resIsdCode = werpMFUploadsVo.ResPhoneNum.Substring(0, lenPhoneNum - 11);
                            }
                        }
                        else
                        {
                            resStdCode = werpMFUploadsVo.ResPhoneNum.Substring(0, lenPhoneNum - 8);
                        }
                    }
                    else
                    {
                        resPhoneNum = werpMFUploadsVo.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;
                    }

                    //**************************************************************************

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


                    //customerId2 = customerBo.CreateCustomer(customerVo, rmId, userId);

                    //customerPortfolioVo.CustomerId = customerId2;
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";
                    //PortfolioBo.CreateCustomerPortfolio(customerPortfolioVo, userId);

                    customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, userId);

                    countCustCreated++;
                }
                UpdateWerpMFProfileStagingIsCustomerNew(adviserId, processId);

                //*****New Folios Upload from CAMS*****
                getNewFoliosDs = GetWerpMFProfileNewFolios(processId);
                getNewFoliosDt = getNewFoliosDs.Tables[0];
                foreach (DataRow dr in getNewFoliosDt.Rows)
                {
                    customerAccountsVo.AccountNum  = dr["CMFXPS_FolioNum"].ToString();
                    customerAccountsVo.PortfolioId = Int32.Parse(dr["CP_PortfolioId"].ToString());
                    customerAccountsVo.AssetClass  = "MF";
                    customerAccountsVo.AMCCode     = Int32.Parse(dr["PA_AMCCode"].ToString());
                    customerAccountBo.CreateCustomerMFAccount(customerAccountsVo, userId);

                    countFolioCreated++;
                }
                UpdateWerpMFProfileStagingIsFolioNew(processId);
                IsProcessComplete = true;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "WerpMFUploadsBo.cs:WerpMFInsertCustomerDetails()");

                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);
        }
Esempio n. 5
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;
            }
        }
Esempio n. 6
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Validation())
                {
                    rmId = rmVo.RMId;
                    if (Session["Current_Link"].ToString() == "AdvisorLeftPane")
                    {
                        userVo = (UserVo)Session["UserVo"];


                        txtDateofProfiling.Text = DateTime.Today.Date.ToString();
                        if (chkdummypan.Checked)
                        {
                            customerVo.DummyPAN = 1;
                        }
                        else
                        {
                            customerVo.DummyPAN = 0;
                        }
                        if (chksmsn.Checked)
                        {
                            customerVo.ViaSMS = 1;
                        }
                        else
                        {
                            customerVo.ViaSMS = 0;
                        }
                        if (chkmailn.Checked)
                        {
                            customerVo.AlertViaEmail = 1;
                        }
                        else
                        {
                            customerVo.AlertViaEmail = 0;
                        }

                        customerVo.ContactFirstName  = txtFirstName.Text.ToString();
                        customerVo.ContactMiddleName = txtMiddleName.Text.ToString();
                        customerVo.ContactLastName   = txtLastName.Text.ToString();
                        customerVo.CompanyName       = txtCompanyName.Text.ToString();
                        customerVo.FirstName         = txtCompanyName.Text.ToString();
                        customerVo.CustCode          = txtCustomerCode.Text.ToString();
                        //customerVo.Salutation = ddlSalutation.SelectedItem.Value.ToString();
                        if (txtDateofRegistration.Text != "")
                        {
                            customerVo.RegistrationDate = DateTime.Parse(txtDateofRegistration.Text.ToString());
                        }
                        else
                        {
                            customerVo.RegistrationDate = DateTime.MinValue;
                        }
                        if (txtDateofCommencement.Text != "")
                        {
                            customerVo.CommencementDate = DateTime.Parse(txtDateofCommencement.Text.ToString());
                        }
                        else
                        {
                            customerVo.CommencementDate = DateTime.MinValue;
                        }
                        if (txtDateofProfiling.Text != "")
                        {
                            customerVo.ProfilingDate = DateTime.Parse(txtDateofProfiling.Text.ToString());
                        }
                        else
                        {
                            customerVo.ProfilingDate = DateTime.MinValue;
                        }
                        customerVo.RegistrationPlace = txtRegistrationPlace.Text.ToString();
                        customerVo.CompanyWebsite    = txtCompanyWebsite.Text.ToString();
                        customerVo.RmId            = rmId;
                        customerVo.PANNum          = txtPanNumber.Text.ToString();
                        customerVo.RegistrationNum = txtRocRegistration.Text.ToString();
                        customerVo.Adr1Line1       = txtCorrAdrLine1.Text.ToString();
                        customerVo.Adr1Line2       = txtCorrAdrLine2.Text.ToString();
                        customerVo.Adr1Line3       = txtCorrAdrLine3.Text.ToString();
                        customerVo.Adr1PinCode     = int.Parse(txtCorrAdrPinCode.Text.ToString());
                        customerVo.Adr1City        = txtCorrAdrCity.Text.ToString();
                        customerVo.Adr1State       = ddlCorrAdrState.SelectedItem.Text.ToString();
                        customerVo.Adr1Country     = ddlCorrAdrCountry.SelectedItem.Value.ToString();
                        if (chkCorrPerm.Checked)
                        {
                            customerVo.Adr2Line1   = txtCorrAdrLine1.Text.ToString();
                            customerVo.Adr2Line2   = txtCorrAdrLine2.Text.ToString();
                            customerVo.Adr2Line3   = txtCorrAdrLine3.Text.ToString();
                            customerVo.Adr2PinCode = int.Parse(txtCorrAdrPinCode.Text.ToString());
                            customerVo.Adr2City    = txtCorrAdrCity.Text.ToString();
                            customerVo.Adr2State   = ddlCorrAdrState.Text.ToString();
                            customerVo.Adr2Country = ddlCorrAdrCountry.Text.ToString();
                        }
                        else
                        {
                            customerVo.Adr2Line1   = txtPermAdrLine1.Text.ToString();
                            customerVo.Adr2Line2   = txtPermAdrLine2.Text.ToString();
                            customerVo.Adr2Line3   = txtPermAdrLine3.Text.ToString();
                            customerVo.Adr2PinCode = int.Parse(txtPermAdrPinCode.Text.ToString());
                            customerVo.Adr2City    = txtPermAdrCity.Text.ToString();
                            customerVo.Adr2State   = ddlPermAdrState.Text.ToString();
                            customerVo.Adr2Country = ddlPermAdrCountry.Text.ToString();
                        }
                        customerVo.ResISDCode    = int.Parse(txtPhoneNo1Isd.Text.ToString());
                        customerVo.ResSTDCode    = int.Parse(txtPhoneNo1Std.Text.ToString());
                        customerVo.ResPhoneNum   = int.Parse(txtPhoneNo1.Text.ToString());
                        customerVo.OfcISDCode    = int.Parse(txtPhoneNo2Isd.Text.ToString());
                        customerVo.OfcSTDCode    = int.Parse(txtPhoneNo2Std.Text.ToString());
                        customerVo.OfcPhoneNum   = int.Parse(txtPhoneNo2.Text.ToString());
                        customerVo.Fax           = int.Parse(txtFax.Text.ToString());
                        customerVo.ISDFax        = int.Parse(txtFaxIsd.Text.ToString());
                        customerVo.STDFax        = int.Parse(txtFaxStd.Text.ToString());
                        customerVo.Email         = txtEmail.Text.ToString();
                        customerVo.AltEmail      = txtAltEmail.Text;
                        customerVo.MaritalStatus = null;
                        Session["Customer"]      = "Customer";
                        //  customerBo.CreateCustomer(customerVo, customerVo.RmId,userVo.UserId);
                        if (Session["customerIds"] != null)
                        {
                            List <int> customerIds = new List <int>();
                            //int customerId = customerIds[1];
                            customerIds           = (List <int>)Session["CustomerIds"];
                            customerVo.CustomerId = customerIds[1];
                            customerBo.UpdateCustomer(customerVo, userVo.UserId);
                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('AdviserCustomer','none');", true);
                            // Session.Remove("CustomerIds");
                        }



                        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('AdviserCustomer','none');", true);
                    }

                    else if (Session["Current_Link"].ToString() == "RMCustomerNonIndividualLeftPane")
                    {
                        CustomerVo newCustomerVo = new CustomerVo();
                        UserVo     newUserVo     = new UserVo();

                        newUserVo.FirstName  = txtFirstName.Text.ToString();
                        newUserVo.MiddleName = txtMiddleName.Text.ToString();
                        newUserVo.LastName   = txtLastName.Text.ToString();
                        newUserVo.Email      = txtEmail.Text.ToString();
                        newUserVo.UserType   = "Customer";

                        customerVo.FirstName  = txtFirstName.Text.ToString();
                        customerVo.MiddleName = txtMiddleName.Text.ToString();
                        customerVo.LastName   = txtLastName.Text.ToString();

                        if (txtEmail.Text == "")
                        {
                            customerVo.Email = txtFirstName.Text.ToString() + "@mail.com";
                        }
                        else
                        {
                            customerVo.Email = txtEmail.Text.ToString();
                        }
                        newCustomerVo.Type = "NIND";

                        txtDateofProfiling.Text = DateTime.Today.Date.ToString();

                        if (txtDateofRegistration.Text != "")
                        {
                            customerVo.RegistrationDate = DateTime.Parse(txtDateofRegistration.Text.ToString());
                        }
                        else
                        {
                            customerVo.RegistrationDate = DateTime.MinValue;
                        }
                        if (txtDateofCommencement.Text != "")
                        {
                            customerVo.CommencementDate = DateTime.Parse(txtDateofCommencement.Text.ToString());
                        }
                        else
                        {
                            customerVo.CommencementDate = DateTime.MinValue;
                        }
                        if (txtDateofProfiling.Text != "")
                        {
                            customerVo.ProfilingDate = DateTime.Parse(txtDateofProfiling.Text.ToString());
                        }
                        else
                        {
                            customerVo.ProfilingDate = DateTime.MinValue;
                        }

                        newCustomerVo.FirstName   = txtFirstName.Text.ToString();
                        newCustomerVo.MiddleName  = txtMiddleName.Text.ToString();
                        newCustomerVo.LastName    = txtLastName.Text.ToString();
                        newCustomerVo.CompanyName = txtCompanyName.Text.ToString();
                        newCustomerVo.CustCode    = txtCustomerCode.Text.ToString();
                        newCustomerVo.Salutation  = ddlSalutation.SelectedItem.Value.ToString();

                        newCustomerVo.RegistrationPlace = txtRegistrationPlace.Text.ToString();
                        newCustomerVo.CompanyWebsite    = txtCompanyWebsite.Text.ToString();
                        newCustomerVo.RmId            = rmId;
                        newCustomerVo.PANNum          = txtPanNumber.Text.ToString();
                        newCustomerVo.RegistrationNum = txtRocRegistration.Text.ToString();
                        newCustomerVo.Adr1Line1       = txtCorrAdrLine1.Text.ToString();
                        newCustomerVo.Adr1Line2       = txtCorrAdrLine2.Text.ToString();
                        newCustomerVo.Adr1Line3       = txtCorrAdrLine3.Text.ToString();
                        newCustomerVo.Adr1PinCode     = int.Parse(txtCorrAdrPinCode.Text.ToString());
                        newCustomerVo.Adr1City        = txtCorrAdrCity.Text.ToString();
                        if (ddlCorrAdrState.SelectedIndex != 0)
                        {
                            newCustomerVo.Adr1State = ddlCorrAdrState.SelectedItem.Value.ToString();
                        }
                        else
                        {
                            newCustomerVo.Adr1State = null;
                        }
                        newCustomerVo.Adr1Country = ddlCorrAdrCountry.SelectedItem.Value.ToString();
                        if (chkCorrPerm.Checked)
                        {
                            newCustomerVo.Adr2Line1   = txtCorrAdrLine1.Text.ToString();
                            newCustomerVo.Adr2Line2   = txtCorrAdrLine2.Text.ToString();
                            newCustomerVo.Adr2Line3   = txtCorrAdrLine3.Text.ToString();
                            newCustomerVo.Adr2PinCode = int.Parse(txtCorrAdrPinCode.Text.ToString());
                            newCustomerVo.Adr2City    = txtCorrAdrCity.Text.ToString();
                            if (ddlCorrAdrState.SelectedIndex != 0)
                            {
                                newCustomerVo.Adr2State = ddlCorrAdrState.Text.ToString();
                            }
                            else
                            {
                                newCustomerVo.Adr2State = null;
                            }
                            newCustomerVo.Adr2Country = ddlCorrAdrCountry.Text.ToString();
                        }
                        else
                        {
                            newCustomerVo.Adr2Line1   = txtPermAdrLine1.Text.ToString();
                            newCustomerVo.Adr2Line2   = txtPermAdrLine2.Text.ToString();
                            newCustomerVo.Adr2Line3   = txtPermAdrLine3.Text.ToString();
                            newCustomerVo.Adr2PinCode = int.Parse(txtPermAdrPinCode.Text.ToString());
                            newCustomerVo.Adr2City    = txtPermAdrCity.Text.ToString();
                            if (ddlPermAdrState.SelectedIndex != 0)
                            {
                                newCustomerVo.Adr2State = ddlPermAdrState.Text.ToString();
                            }
                            else
                            {
                                newCustomerVo.Adr2State = null;
                            }
                            newCustomerVo.Adr2Country = ddlPermAdrCountry.Text.ToString();
                        }
                        newCustomerVo.ResISDCode    = int.Parse(txtPhoneNo1Isd.Text.ToString());
                        newCustomerVo.ResSTDCode    = int.Parse(txtPhoneNo1Std.Text.ToString());
                        newCustomerVo.ResPhoneNum   = int.Parse(txtPhoneNo1.Text.ToString());
                        newCustomerVo.OfcISDCode    = int.Parse(txtPhoneNo2Isd.Text.ToString());
                        newCustomerVo.OfcSTDCode    = int.Parse(txtPhoneNo2Std.Text.ToString());
                        newCustomerVo.OfcPhoneNum   = int.Parse(txtPhoneNo2.Text.ToString());
                        newCustomerVo.Fax           = int.Parse(txtFax.Text.ToString());
                        newCustomerVo.ISDFax        = int.Parse(txtFaxIsd.Text.ToString());
                        newCustomerVo.STDFax        = int.Parse(txtFaxStd.Text.ToString());
                        newCustomerVo.Email         = txtEmail.Text.ToString();
                        newCustomerVo.AltEmail      = txtAltEmail.Text;
                        newCustomerVo.MaritalStatus = null;


                        customerPortfolioVo.CustomerId        = customerFamilyVo.AssociateCustomerId;
                        customerPortfolioVo.IsMainPortfolio   = 1;
                        customerPortfolioVo.PortfolioTypeCode = "RGL";
                        customerPortfolioVo.PMSIdentifier     = "";
                        customerPortfolioVo.PortfolioName     = "Default";



                        List <int> CustomerIds = new List <int>();
                        CustomerIds = customerBo.CreateCompleteCustomer(newCustomerVo, newUserVo, customerPortfolioVo, userVo.UserId);
                        customerFamilyVo.AssociateCustomerId = CustomerIds[1];
                        customerFamilyVo.Relationship        = Session["relationship"].ToString();


                        customerFamilyBo.CreateCustomerFamily(customerFamilyVo, customerVo.CustomerId, userVo.UserId);
                        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", "CustomerNonIndividualAdd.ascx:btnSubmit_Click()");
                object[] objects = new object[4];
                objects[0] = rmVo;
                objects[1] = rmId;
                objects[2] = customerVo;
                objects[3] = userVo;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (Validation())
                {
                    rmVo             = (RMVo)Session["rmVo"];
                    userVo           = (UserVo)Session["userVo"];
                    parentCustomerVo = (CustomerVo)Session["CustomerVo"];
                    customerVo.RmId  = rmVo.RMId;
                    //customerVo.CustomerId = int.Parse(Session["CustomerId2"].ToString());
                    //customerVo.UserId = customerBo.GenerateId();
                    customerVo.FirstName  = txtFirstName.Text.ToString();
                    customerVo.MiddleName = txtMiddleName.Text.ToString();
                    customerVo.LastName   = txtLastName.Text.ToString();
                    customerVo.BranchId   = parentCustomerVo.BranchId;
                    if (txtDob.Text.ToString() != "")
                    {
                        customerVo.Dob = DateTime.Parse(txtDob.Text.ToString());
                    }
                    customerVo.PANNum        = txtPanNum.Text.ToString();
                    customerVo.OfcAdrLine1   = txtOfcAdrLine1.Text.ToString();
                    customerVo.OfcAdrLine2   = txtOfcAdrLine2.Text.ToString();
                    customerVo.OfcAdrLine3   = txtOfcAdrLine3.Text.ToString();
                    customerVo.OfcAdrPinCode = int.Parse(txtOfcAdrPinCode.Text.ToString());
                    customerVo.OfcAdrCity    = txtOfcAdrCity.Text.ToString();
                    customerVo.OfcAdrState   = ddlOfcAdrState.Text.ToString();
                    customerVo.OfcAdrCountry = ddlOfcAdrCountry.Text.ToString();
                    customerVo.CompanyName   = txtOfcCompanyName.Text.ToString();
                    customerVo.ResISDCode    = int.Parse(txtResPhoneNoIsd.Text.ToString());
                    customerVo.ResSTDCode    = int.Parse(txtResPhoneNoStd.Text.ToString());
                    customerVo.ResPhoneNum   = int.Parse(txtResPhoneNo.Text.ToString());
                    customerVo.OfcISDCode    = int.Parse(txtOfcPhoneNoIsd.Text.ToString());
                    customerVo.OfcSTDCode    = int.Parse(txtOfcPhoneNoStd.Text.ToString());
                    customerVo.OfcPhoneNum   = int.Parse(txtOfcPhoneNo.Text.ToString());
                    customerVo.ISDFax        = int.Parse(txtResFaxIsd.Text.ToString());
                    customerVo.STDFax        = int.Parse(txtResFaxStd.Text.ToString());
                    customerVo.Fax           = int.Parse(txtResFax.Text.ToString());
                    customerVo.OfcISDFax     = int.Parse(txtOfcFaxIsd.Text.ToString());
                    customerVo.OfcSTDFax     = int.Parse(txtOfcFaxStd.Text.ToString());
                    customerVo.OfcFax        = int.Parse(txtOfcFax.Text.ToString());
                    customerVo.Mobile1       = long.Parse(txtMobile1.Text.ToString());
                    customerVo.Mobile2       = long.Parse(txtMobile2.Text.ToString());
                    customerVo.Email         = txtEmail.Text.ToString();
                    customerVo.AltEmail      = txtAltEmail.Text.ToString();
                    customerVo.ProfilingDate = DateTime.Today;
                    if (rbtnIndividual.Checked)
                    {
                        customerVo.Type = "IND";
                    }
                    else
                    {
                        customerVo.Type = "NIND";
                    }
                    customerVo.SubType = ddlCustomerSubType.SelectedItem.Value.ToString();
                    // customerPortfolioVo.CustomerId = customerFamilyVo.AssociateCustomerId;
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PMSIdentifier     = "";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";


                    newUserVo.FirstName  = txtFirstName.Text.ToString();
                    newUserVo.MiddleName = txtMiddleName.Text.ToString();
                    newUserVo.LastName   = txtLastName.Text.ToString();
                    newUserVo.UserType   = "Customer";
                    newUserVo.Email      = txtEmail.Text;


                    List <int> CustomerIds = new List <int>();
                    CustomerIds = customerBo.CreateCompleteCustomer(customerVo, newUserVo, customerPortfolioVo, userVo.UserId);
                    customerFamilyVo.AssociateCustomerId = CustomerIds[1];
                    //customerVo.UserId = customerBo.CreateCustomerUser(customerVo, userVo.UserId);
                    //tempUserVo = userBo.GetUser(customerVo.Email);
                    //customerVo.UserId = tempUserVo.UserId;
                    //customerFamilyVo.AssociateCustomerId = customerBo.CreateCustomer(customerVo, customerVo.RmId, userVo.UserId);
                    customerFamilyVo.Relationship = Session["relationship"].ToString();
                    customerFamilyBo.CreateCustomerFamily(customerFamilyVo, parentCustomerVo.CustomerId, userVo.UserId);



                    //portfolioBo.CreateCustomerPortfolio(customerPortfolioVo, userVo.UserId);


                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewCustomerFamily','none');", true);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

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

                FunctionInfo.Add("Method", "FamilyDetailsSpouse.ascx:btnSubmit_Click()");


                object[] objects = new object[5];

                objects[0] = customerVo;
                objects[1] = parentCustomerVo;
                objects[2] = userVo;
                objects[3] = customerFamilyVo;
                objects[4] = rmVo;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Esempio n. 8
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;
            }
        }
Esempio n. 10
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);
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            UserVo newUserVo = new UserVo();

            try
            {
                //  if (Validation())
                {
                    this.Page.Culture = "en-GB";
                    userVo            = (UserVo)Session["userVo"];
                    rmVo             = (RMVo)Session["rmVo"];
                    parentCustomerVo = (CustomerVo)Session["CustomerVo"];
                    customerVo.RmId  = rmVo.RMId;

                    //customerVo.CustomerId = int.Parse(Session["CustomerId2"].ToString());
                    if (txtEmail.Text == "")
                    {
                        customerVo.Email = txtFirstName.Text.ToString() + "@mail.com";
                    }
                    else
                    {
                        customerVo.Email = txtEmail.Text.ToString();
                    }
                    //customerVo.UserId = customerBo.GenerateId();
                    customerVo.FirstName  = txtFirstName.Text.ToString();
                    customerVo.MiddleName = txtMiddleName.Text.ToString();
                    customerVo.LastName   = txtLastName.Text.ToString();
                    customerVo.BranchId   = parentCustomerVo.BranchId;
                    newUserVo.FirstName   = txtFirstName.Text.ToString();
                    newUserVo.MiddleName  = txtMiddleName.Text.ToString();
                    newUserVo.LastName    = txtLastName.Text.ToString();
                    newUserVo.Email       = txtEmail.Text.ToString();
                    newUserVo.UserType    = "Customer";
                    if (txtDob.Text.ToString() != "")
                    {
                        customerVo.Dob = DateTime.Parse(txtDob.Text.ToString());
                    }



                    customerVo.ProfilingDate = DateTime.Today;


                    if (rbtnIndividual.Checked)
                    {
                        customerVo.Type = "IND";
                    }
                    else
                    {
                        customerVo.Type = "NIND";
                    }
                    customerVo.SubType = ddlCustomerSubType.SelectedItem.Value.ToString();

                    //userVo.UserId = customerVo.UserId;

                    customerPortfolioVo.CustomerId        = customerFamilyVo.AssociateCustomerId;
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    customerPortfolioVo.PMSIdentifier     = "";
                    customerPortfolioVo.PortfolioName     = "MyPortfolio";
                    List <int> CustomerIds = new List <int>();
                    CustomerIds = customerBo.CreateCompleteCustomer(customerVo, newUserVo, customerPortfolioVo, userVo.UserId);

                    customerFamilyVo.AssociateCustomerId = CustomerIds[1];
                    customerFamilyVo.Relationship        = Session["relationship"].ToString();


                    customerFamilyBo.CreateCustomerFamily(customerFamilyVo, parentCustomerVo.CustomerId, userVo.UserId);


                    txtDob_CompareValidator.ValueToCompare = DateTime.Now.ToString("dd/MM/yyyy");
                    //portfolioBo.CreateCustomerPortfolio(customerPortfolioVo, userVo.UserId);


                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('ViewCustomerFamily','none');", true);
                }
            }

            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }

            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "FamilyDetailsChild.ascx:btnSubmit_Click()");
                object[] objects = new object[5];
                objects[0]   = customerVo;
                objects[1]   = customerFamilyVo;
                objects[2]   = userVo;
                objects[3]   = rmVo;
                objects[4]   = parentCustomerVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        //Fifth Phase: Move KARVY customer details to customer table
        public bool KARVYInsertCustomerDetails(int adviserId, int processId, int rmId, out int countCustCreated, out int countFolioCreated)
        {
            bool IsProcessComplete = false;
            List <KarvyUploadsVo> karvyNewCustomerList = new List <KarvyUploadsVo>();
            Nullable <DateTime>   dt = new DateTime();
            KarvyUploadsVo        karvyUploadsVo = new KarvyUploadsVo();
            string resIsdCode = "", resStdCode = "", resPhoneNum = "";
            string offIsdCode = "", offStdCode = "", offPhoneNum = "";
            string resFaxIsdCode = "", resFaxStdCode = "", resFaxNum = "";
            string offFaxIsdCode = "", offFaxStdCode = "", offFaxNum = "";
            int    lenPhoneNum, lenFaxNum;

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

            userId = advisorStaffBo.GetUserId(rmId);

            try
            {
                karvyNewCustomerList = GetKarvyProfNewCustomers(processId);
                for (int i = 0; i < karvyNewCustomerList.Count; i++)
                {
                    customerVo     = new CustomerVo();
                    userVo         = new UserVo();
                    karvyUploadsVo = new KarvyUploadsVo();

                    karvyUploadsVo    = karvyNewCustomerList[i];
                    userVo.FirstName  = "";
                    userVo.MiddleName = "";
                    userVo.LastName   = karvyUploadsVo.InvestorName;
                    //userVo.Password = id.Next(10000, 99999).ToString();
                    userVo.Email = karvyUploadsVo.Email;
                    //userVo.LoginId = karvyUploadsVo.Email;
                    userVo.UserType = "Customer";

                    //userId = userBo.CreateUser(userVo);

                    customerVo.ProcessId        = processId;
                    customerVo.UserId           = userId;
                    customerVo.RmId             = rmId;
                    customerVo.Adr1City         = karvyUploadsVo.City;
                    customerVo.Adr1Country      = karvyUploadsVo.Country;
                    customerVo.Adr1Line1        = karvyUploadsVo.Address1;
                    customerVo.Adr1Line2        = karvyUploadsVo.Address2;
                    customerVo.Adr1Line3        = karvyUploadsVo.Address3;
                    customerVo.Adr1PinCode      = Int32.Parse(karvyUploadsVo.Pincode);
                    customerVo.Adr2PinCode      = 0;
                    customerVo.OfcAdrPinCode    = 0;
                    customerVo.Adr1State        = karvyUploadsVo.State;
                    customerVo.CommencementDate = DateTime.Parse(dt.ToString());
                    if (karvyUploadsVo.DateofBirth == "")
                    {
                        customerVo.Dob = DateTime.Parse(dt.ToString());
                    }
                    else
                    {
                        customerVo.Dob = DateTime.Parse(karvyUploadsVo.DateofBirth);
                    }
                    customerVo.Email      = karvyUploadsVo.Email;
                    customerVo.FirstName  = karvyUploadsVo.FirstName;
                    customerVo.MiddleName = karvyUploadsVo.MiddleName;
                    customerVo.LastName   = karvyUploadsVo.InvestorName;
                    customerVo.LoginId    = karvyUploadsVo.Email;
                    if (karvyUploadsVo.Mobile == "")
                    {
                        customerVo.Mobile1 = 0;
                    }
                    else
                    {
                        customerVo.Mobile1 = Int64.Parse(karvyUploadsVo.Mobile);
                    }


                    lenFaxNum = karvyUploadsVo.FaxResidence.Length;
                    if (lenFaxNum >= 8)
                    {
                        resFaxNum = karvyUploadsVo.FaxResidence.Substring(lenFaxNum - 8, 8);
                        if (lenFaxNum >= 11)
                        {
                            resFaxStdCode = karvyUploadsVo.FaxResidence.Substring(lenFaxNum - 11, 3);
                            if (lenFaxNum >= 12)
                            {
                                resFaxIsdCode = karvyUploadsVo.FaxResidence.Substring(0, lenFaxNum - 11);
                            }
                        }
                        else
                        {
                            resFaxStdCode = karvyUploadsVo.FaxResidence.Substring(0, lenFaxNum - 8);
                        }
                    }
                    else
                    {
                        resFaxNum = karvyUploadsVo.FaxResidence;
                    }
                    if (resFaxIsdCode != "")
                    {
                        customerVo.ISDFax = Int32.Parse(resFaxIsdCode);
                    }
                    else
                    {
                        customerVo.ISDFax = 0;
                    }
                    if (resFaxStdCode != "")
                    {
                        customerVo.STDFax = Int32.Parse(resFaxStdCode);
                    }
                    else
                    {
                        customerVo.STDFax = 0;
                    }
                    if (resFaxNum != "")
                    {
                        customerVo.Fax = Int32.Parse(resFaxNum);
                    }
                    else
                    {
                        customerVo.Fax = 0;
                    }



                    lenFaxNum = karvyUploadsVo.FaxOffice.Length;
                    if (lenFaxNum >= 8)
                    {
                        offFaxNum = karvyUploadsVo.FaxOffice.Substring(lenFaxNum - 8, 8);
                        if (lenFaxNum >= 11)
                        {
                            offFaxStdCode = karvyUploadsVo.FaxOffice.Substring(lenFaxNum - 11, 3);
                            if (lenFaxNum >= 12)
                            {
                                offFaxIsdCode = karvyUploadsVo.FaxOffice.Substring(0, lenFaxNum - 11);
                            }
                        }
                        else
                        {
                            offFaxStdCode = karvyUploadsVo.FaxOffice.Substring(0, lenFaxNum - 8);
                        }
                    }
                    else
                    {
                        offFaxNum = karvyUploadsVo.FaxOffice;
                    }
                    if (offFaxIsdCode != "")
                    {
                        customerVo.OfcISDFax = Int32.Parse(offFaxIsdCode);
                    }
                    else
                    {
                        customerVo.OfcISDFax = 0;
                    }
                    if (offFaxStdCode != "")
                    {
                        customerVo.OfcSTDFax = Int32.Parse(offFaxStdCode);
                    }
                    else
                    {
                        customerVo.OfcSTDFax = 0;
                    }
                    if (offFaxNum != "")
                    {
                        customerVo.OfcFax = Int32.Parse(offFaxNum);
                    }
                    else
                    {
                        customerVo.OfcFax = 0;
                    }



                    lenPhoneNum = karvyUploadsVo.PhoneOffice.Length;
                    if (lenPhoneNum >= 8)
                    {
                        offPhoneNum = karvyUploadsVo.PhoneOffice.Substring(lenPhoneNum - 8, 8);
                        if (lenPhoneNum >= 11)
                        {
                            offStdCode = karvyUploadsVo.PhoneOffice.Substring(lenPhoneNum - 11, 3);
                            if (lenPhoneNum >= 12)
                            {
                                offIsdCode = karvyUploadsVo.PhoneOffice.Substring(0, lenPhoneNum - 11);
                            }
                        }
                        else
                        {
                            offStdCode = karvyUploadsVo.PhoneOffice.Substring(0, lenPhoneNum - 8);
                        }
                    }
                    else
                    {
                        offPhoneNum = karvyUploadsVo.PhoneOffice;
                    }
                    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;
                    }



                    lenPhoneNum = karvyUploadsVo.PhoneResidence.Length;
                    if (lenPhoneNum >= 8)
                    {
                        resPhoneNum = karvyUploadsVo.PhoneResidence.Substring(lenPhoneNum - 8, 8);
                        if (lenPhoneNum >= 11)
                        {
                            resStdCode = karvyUploadsVo.PhoneResidence.Substring(lenPhoneNum - 11, 3);
                            if (lenPhoneNum >= 12)
                            {
                                resIsdCode = karvyUploadsVo.PhoneResidence.Substring(0, lenPhoneNum - 11);
                            }
                        }
                        else
                        {
                            resStdCode = karvyUploadsVo.PhoneResidence.Substring(0, lenPhoneNum - 8);
                        }
                    }
                    else
                    {
                        resPhoneNum = karvyUploadsVo.PhoneResidence;
                    }
                    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;
                    }



                    customerVo.Type             = karvyUploadsVo.TypeCode;
                    customerVo.SubType          = karvyUploadsVo.SubTypeCode;
                    customerVo.Occupation       = karvyUploadsVo.OccCode;
                    customerVo.PANNum           = karvyUploadsVo.PANNumber;
                    customerVo.Password         = id.Next(10000, 99999).ToString();
                    customerVo.ProfilingDate    = DateTime.Today;
                    customerVo.RBIApprovalDate  = DateTime.Parse(dt.ToString());
                    customerVo.RegistrationDate = DateTime.Parse(dt.ToString());
                    customerVo.CommencementDate = DateTime.Parse(dt.ToString());
                    //customerId2 = customerBo.CreateCustomer(customerVo, rmId, userId);

                    //customerPortfolioVo.CustomerId = customerId2;
                    customerPortfolioVo.IsMainPortfolio   = 1;
                    customerPortfolioVo.PortfolioTypeCode = "RGL";
                    //PortfolioBo.CreateCustomerPortfolio(customerPortfolioVo, userId);

                    customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, userId);

                    countCustCreated++;
                }
                UpdateKarvyProfileStagingIsCustomerNew(adviserId, processId);

                //*****New Folios Upload from CAMS*****
                getNewFoliosDs = GetKarvyProfileNewFolios(processId);
                getNewFoliosDt = getNewFoliosDs.Tables[0];
                foreach (DataRow dr in getNewFoliosDt.Rows)
                {
                    customerAccountsVo.AccountNum  = dr["CMFKXPS_Folio"].ToString();
                    customerAccountsVo.PortfolioId = Int32.Parse(dr["CP_PortfolioId"].ToString());
                    customerAccountsVo.AssetClass  = "MF";
                    customerAccountsVo.AMCCode     = Int32.Parse(dr["PA_AMCCode"].ToString());
                    customerAccountBo.CreateCustomerMFAccount(customerAccountsVo, userId);
                    countFolioCreated++;
                }
                UpdateKarvyProfileStagingIsFolioNew(processId);
                IsProcessComplete = true;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "KarvyUploadsBo.cs:KARVYInsertCustomerDetails()");

                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);
        }