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; } }
/// <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]); }
/// <summary> /// Used to Create child customers for AddProspect Screen /// </summary> /// <param name="userVo"></param> /// <param name="rmVo"></param> /// <param name="createdById"></param> /// <param name="drChildCustomer"></param> /// <param name="ParentCustomerId"></param> protected void CreateCustomerForAddProspect(UserVo userVo, RMVo rmVo, int createdById, DataRow drChildCustomer, int ParentCustomerId) { customerVo = new CustomerVo(); customerVo.RmId = rmVo.RMId; customerVo.Type = "IND"; customerVo.FirstName = drChildCustomer["FirstName"].ToString(); customerVo.MiddleName = drChildCustomer["MiddleName"].ToString(); customerVo.LastName = drChildCustomer["LastName"].ToString(); userVo.FirstName = drChildCustomer["FirstName"].ToString(); customerVo.BranchId = int.Parse(ddlPickBranch.SelectedValue); if (dpDOB.SelectedDate != null && drChildCustomer["DOB"].ToString() != null && drChildCustomer["DOB"].ToString() != string.Empty) { customerVo.Dob = DateTime.Parse(drChildCustomer["DOB"].ToString()); } customerVo.Email = drChildCustomer["EmailId"].ToString(); customerVo.IsProspect = 1; customerVo.IsFPClient = 1; userVo.Email = drChildCustomer["EmailId"].ToString(); customerPortfolioVo.IsMainPortfolio = 1; customerPortfolioVo.PortfolioTypeCode = "RGL"; customerPortfolioVo.PortfolioName = "MyPortfolioUnmanaged"; //Session[SessionContents.CustomerVo] = customerVo; //Session["customerVo"] = customerVo; //Session["CustomerVo"] = customerVo; List <int> customerIds = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, createdById); if (customerIds != null) { CustomerFamilyVo familyVo = new CustomerFamilyVo(); CustomerFamilyBo familyBo = new CustomerFamilyBo(); familyVo.AssociateCustomerId = customerIds[1]; familyVo.CustomerId = ParentCustomerId; familyVo.Relationship = drChildCustomer["CustomerRelationship"].ToString(); familyBo.CreateCustomerFamily(familyVo, ParentCustomerId, userVo.UserId); } }
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; } }
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; } }
protected void btnCustomerProfile_Click(object sender, EventArgs e) { List <int> customerIds = null; try { if (chkdummypan.Checked) { customerVo.DummyPAN = 1; } else { customerVo.DummyPAN = 0; } if (Validation()) { customerIds = new List <int>(); if (rbtnIndividual.Checked) { customerVo.Type = "IND"; customerVo.FirstName = txtFirstName.Text.ToString(); customerVo.MiddleName = txtMiddleName.Text.ToString(); customerVo.LastName = txtLastName.Text.ToString(); if (ddlSalutation.SelectedIndex == 0) { customerVo.Salutation = ""; } else { customerVo.Salutation = ddlSalutation.SelectedValue.ToString(); } userVo.FirstName = txtFirstName.Text.ToString(); userVo.MiddleName = txtMiddleName.Text.ToString(); userVo.LastName = txtLastName.Text.ToString(); } else if (rbtnNonIndividual.Checked) { customerVo.Type = "NIND"; customerVo.FirstName = txtCompanyName.Text.ToString(); customerVo.LastName = txtFirstName.Text.ToString(); customerVo.MiddleName = txtMiddleName.Text.ToString(); //customerVo.FirstName = txtLastName.Text.ToString(); userVo.LastName = txtCompanyName.Text.ToString(); } //customerVo.CustomerId = customerBo.GenerateId(); customerVo.BranchId = int.Parse(ddlAdviserBranchList.SelectedValue); customerVo.SubType = ddlCustomerSubType.SelectedItem.Value; customerVo.Email = txtEmail.Text.ToString(); customerVo.PANNum = txtPanNumber.Text.ToString(); userVo.Email = txtEmail.Text.ToString(); userVo.UserType = "Customer"; customerVo.Dob = DateTime.MinValue; if (chkdummypan.Checked) { customerVo.DummyPAN = 1; } else { customerVo.DummyPAN = 0; } customerVo.ProfilingDate = DateTime.Today; customerVo.RBIApprovalDate = DateTime.MinValue; customerVo.CommencementDate = DateTime.MinValue; customerVo.RegistrationDate = DateTime.MinValue; customerVo.RmId = int.Parse(ddlAdviseRMList.SelectedValue.ToString()); customerPortfolioVo.IsMainPortfolio = 1; customerPortfolioVo.PortfolioTypeCode = "RGL"; customerPortfolioVo.PortfolioName = "MyPortfolio"; customerIds = customerBo.CreateCompleteCustomer(customerVo, userVo, customerPortfolioVo, tempUserVo.UserId); Session["customerIds"] = customerIds; if (customerIds != null) { CustomerFamilyVo familyVo = new CustomerFamilyVo(); CustomerFamilyBo familyBo = new CustomerFamilyBo(); familyVo.AssociateCustomerId = customerIds[1]; familyVo.CustomerId = customerIds[1]; familyVo.Relationship = "SELF"; familyBo.CreateCustomerFamily(familyVo, customerIds[1], userVo.UserId); } Session["CustomerVo"] = customerBo.GetCustomer(customerIds[1]); if (rbtnNonIndividual.Checked) { // ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerNonIndividualAdd','none');", true); Response.Redirect("ControlHost.aspx?pageid=CustomerNonIndividualAdd&RmId=" + customerVo.RmId + "", false); } else if (rbtnIndividual.Checked) { //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerIndividualAdd','none');", true); Response.Redirect("ControlHost.aspx?pageid=CustomerIndividualAdd&RmId=" + customerVo.RmId + "", false); } } else { } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "CustomerType.ascx:btnCustomerProfile_Click()"); object[] objects = new object[5]; objects[0] = customerPortfolioVo; objects[1] = customerVo; objects[2] = rmVo; objects[3] = userVo; objects[4] = customerIds; objects[5] = assetInterest; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
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; } }
//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; } }