protected void btnEdit_Click(object sender, EventArgs e) { try { if (Validation()) { customerVo.BranchId = int.Parse(ddlAdviserBranchList.SelectedValue.ToString()); customerVo.Salutation = ddlSalutation.SelectedValue; customerVo.FirstName = txtFirstName.Text.ToString(); customerVo.MiddleName = txtMiddleName.Text.ToString(); customerVo.LastName = txtLastName.Text.ToString(); if (rbtnIndividual.Checked) { customerVo.Type = "IND"; } else { customerVo.Type = "NIND"; } customerVo.SubType = ddlCustomerSubType.SelectedItem.Value.ToString(); if (customerVo.SubType == "MNR") { customerVo.ContactMiddleName = txtGuardianMiddleName.Text; customerVo.ContactLastName = txtGuardianLastName.Text; customerVo.ContactFirstName = txtGuardianFirstName.Text; } if (txtDob.Text == "") { customerVo.Dob = DateTime.MinValue; } else { customerVo.Dob = DateTime.Parse(txtDob.Text); } if (txtProfilingDate.Text == "") { customerVo.ProfilingDate = DateTime.MinValue; } else { customerVo.ProfilingDate = DateTime.Parse(txtProfilingDate.Text); } customerVo.PANNum = txtPanNumber.Text; customerVo.CustCode = txtCustomerCode.Text; customerVo.Adr1Line1 = txtCorrAdrLine1.Text.ToString(); customerVo.Adr1Line2 = txtCorrAdrLine2.Text.ToString(); customerVo.Adr1Line3 = txtCorrAdrLine3.Text.ToString(); if (txtCorrAdrPinCode.Text == "") { customerVo.Adr1PinCode = 0; } else { customerVo.Adr1PinCode = int.Parse(txtCorrAdrPinCode.Text.ToString()); } customerVo.Adr1City = txtCorrAdrCity.Text.ToString(); if (ddlCorrAdrState.SelectedIndex == 0) { customerVo.Adr1State = ""; } else { customerVo.Adr1State = ddlCorrAdrState.SelectedValue.ToString(); } customerVo.Adr1Country = txtCorrAdrCountry.Text.ToString(); customerVo.Adr2Line1 = txtPermAdrLine1.Text.ToString(); customerVo.Adr2Line2 = txtPermAdrLine2.Text.ToString(); customerVo.Adr2Line3 = txtPermAdrLine3.Text.ToString(); customerVo.Adr2City = txtPermAdrCity.Text.ToString(); if (txtPermAdrPinCode.Text == "") { customerVo.Adr2PinCode = 0; } else { customerVo.Adr2PinCode = int.Parse(txtPermAdrPinCode.Text.ToString()); } if (ddlPermAdrState.SelectedIndex == 0) { customerVo.Adr2State = ""; } else { customerVo.Adr2State = ddlPermAdrState.SelectedValue.ToString(); } customerVo.Adr2Country = txtPermAdrCountry.Text.ToString(); customerVo.OfcAdrLine1 = txtOfcAdrLine1.Text.ToString(); customerVo.OfcAdrLine2 = txtOfcAdrLine2.Text.ToString(); customerVo.OfcAdrLine3 = txtOfcAdrLine3.Text.ToString(); if (txtOfcAdrPinCode.Text == "") { customerVo.OfcAdrPinCode = 0; } else { customerVo.OfcAdrPinCode = int.Parse(txtOfcAdrPinCode.Text.ToString()); } customerVo.OfcAdrCity = txtOfcAdrCity.Text.ToString(); if (ddlOfcAdrState.SelectedIndex == 0) { customerVo.OfcAdrState = ""; } else { customerVo.OfcAdrState = ddlOfcAdrState.SelectedValue.ToString(); } customerVo.OfcAdrCountry = txtOfcAdrCountry.Text.ToString(); customerVo.CompanyName = txtOfcCompanyName.Text.ToString(); if (txtResPhoneNoIsd.Text == "") { customerVo.ResISDCode = 0; } else { customerVo.ResISDCode = int.Parse(txtResPhoneNoIsd.Text.ToString()); } if (txtResPhoneNoStd.Text == "") { customerVo.ResSTDCode = 0; } else { customerVo.ResSTDCode = int.Parse(txtResPhoneNoStd.Text.ToString()); } if (txtResPhoneNo.Text == "") { customerVo.ResPhoneNum = 0; } else { customerVo.ResPhoneNum = int.Parse(txtResPhoneNo.Text.ToString()); } if (txtOfcPhoneNoIsd.Text == "") { customerVo.OfcISDCode = 0; } else { customerVo.OfcISDCode = int.Parse(txtOfcPhoneNoIsd.Text.ToString()); } if (txtOfcPhoneNoStd.Text == "") { customerVo.OfcSTDCode = 0; } else { customerVo.OfcSTDCode = int.Parse(txtOfcPhoneNoStd.Text.ToString()); } if (txtOfcPhoneNo.Text == "") { customerVo.OfcPhoneNum = 0; } else { customerVo.OfcPhoneNum = int.Parse(txtOfcPhoneNo.Text.ToString()); } if (txtResFaxIsd.Text == "") { customerVo.ISDFax = 0; } else { customerVo.ISDFax = int.Parse(txtResFaxIsd.Text.ToString()); } if (txtResFaxStd.Text == "") { customerVo.STDFax = 0; } else { customerVo.STDFax = int.Parse(txtResFaxStd.Text.ToString()); } if (txtResFax.Text == "") { customerVo.Fax = 0; } else { customerVo.Fax = int.Parse(txtResFax.Text.ToString()); } if (txtOfcFaxIsd.Text == "") { customerVo.OfcISDFax = 0; } else { customerVo.OfcISDFax = int.Parse(txtOfcFaxIsd.Text.ToString()); } if (txtOfcFaxStd.Text == "") { customerVo.OfcSTDFax = 0; } else { customerVo.OfcSTDFax = int.Parse(txtOfcFaxStd.Text.ToString()); } if (txtOfcFax.Text == "") { customerVo.OfcFax = 0; } else { customerVo.OfcFax = int.Parse(txtOfcFax.Text.ToString()); } if (txtMobile1.Text == "") { customerVo.Mobile1 = 0; } else { customerVo.Mobile1 = long.Parse(txtMobile1.Text.ToString()); } if (txtMobile2.Text == "") { customerVo.Mobile2 = 0; } else { customerVo.Mobile2 = long.Parse(txtMobile2.Text.ToString()); } customerVo.Email = txtEmail.Text.ToString(); customerVo.AltEmail = txtAltEmail.Text.ToString(); if (ddlOccupation.SelectedIndex == 0) { customerVo.Occupation = null; } else { customerVo.Occupation = ddlOccupation.SelectedItem.Value.ToString(); } if (chkdummypan.Checked) { customerVo.DummyPAN = 1; } else { customerVo.DummyPAN = 0; } if (chkprospect.Checked) { customerVo.IsProspect = 1; } else { customerVo.IsProspect = 0; } if (chkmail.Checked) { customerVo.AlertViaEmail = 1; } else { customerVo.AlertViaEmail = 0; } if (chksms.Checked) { customerVo.ViaSMS = 1; } else { customerVo.ViaSMS = 0; } if (ddlQualification.SelectedIndex == 0) { customerVo.Qualification = null; } else { customerVo.Qualification = ddlQualification.SelectedItem.Value.ToString(); } if (ddlNationality.SelectedIndex == 0) { customerVo.Nationality = null; } else { customerVo.Nationality = ddlNationality.SelectedItem.Value.ToString(); } customerVo.RBIRefNum = txtRBIRefNo.Text.ToString(); if (txtRBIRefDate.Text == "") { //customerVo.RBIApprovalDate = DateTime.Parse("1/1/0001 12:00:00 AM"); customerVo.RBIApprovalDate = DateTime.MinValue; } else { customerVo.RBIApprovalDate = DateTime.Parse(txtRBIRefDate.Text.ToString()); } if (ddlMaritalStatus.SelectedIndex == 0) { customerVo.MaritalStatus = null; } else { customerVo.MaritalStatus = ddlMaritalStatus.SelectedItem.Value.ToString(); } if (txtMarriageDate.Text != string.Empty && txtMarriageDate.Text != "dd/mm/yyyy") { customerVo.MarriageDate = DateTime.Parse(txtMarriageDate.Text); } else { customerVo.MarriageDate = DateTime.MinValue; } if (txtLivingSince.Text == "") { customerVo.ResidenceLivingDate = DateTime.MinValue; } else { customerVo.ResidenceLivingDate = DateTime.Parse(txtLivingSince.Text.ToString()); } if (txtJobStartDate.Text == "") { customerVo.JobStartDate = DateTime.MinValue; } else { customerVo.JobStartDate = DateTime.Parse(txtJobStartDate.Text.ToString()); } customerVo.MothersMaidenName = txtMotherMaidenName.Text.ToString(); if (chkCorrPerm.Checked) { customerVo.Adr2City = txtCorrAdrCity.Text; customerVo.Adr2Country = txtCorrAdrCountry.Text; customerVo.Adr2Line1 = txtCorrAdrLine1.Text; customerVo.Adr2Line2 = txtCorrAdrLine2.Text; customerVo.Adr2Line3 = txtCorrAdrLine3.Text; customerVo.Adr2PinCode = int.Parse(txtCorrAdrPinCode.Text); customerVo.Adr2State = ddlCorrAdrState.SelectedItem.Value.ToString(); } if (customerBo.UpdateCustomer(customerVo)) { customerVo = customerBo.GetCustomer(customerVo.CustomerId); Session["CustomerVo"] = customerVo; if (customerVo.Type.ToUpper().ToString() == "IND") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('ViewCustomerIndividualProfile','none');", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('ViewNonIndividualProfile','none');", true); } } } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "EditCustomerIndividualProfile.ascx:btnEdit_Click()"); object[] objects = new object[1]; objects[0] = customerVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void btnCustomerProfile_Click(object sender, EventArgs e) { List <int> customerIds = null; try { 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; customerVo.ProfilingDate = DateTime.Today; customerVo.RBIApprovalDate = DateTime.MinValue; customerVo.CommencementDate = DateTime.MinValue; customerVo.RegistrationDate = DateTime.MinValue; customerVo.RmId = rmVo.RMId; 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); } else if (rbtnIndividual.Checked) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "leftpane", "loadcontrol('CustomerIndividualAdd','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", "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 btnEdit_Click(object sender, EventArgs e) { try { if (rbtnIndividual.Checked) { customerVo.Type = "IND"; } else { customerVo.Type = "NIND"; } customerVo.BranchId = int.Parse(ddlAdviserBranchList.SelectedValue.ToString()); customerVo.SubType = ddlCustomerSubType.SelectedItem.Value.ToString(); customerVo.ContactFirstName = txtFirstName.Text.ToString(); customerVo.ContactMiddleName = txtMiddleName.Text.ToString(); customerVo.ContactLastName = txtLastName.Text.ToString(); customerVo.CompanyName = txtCompanyName.Text.ToString(); customerVo.CustCode = txtCustomerCode.Text.ToString(); //customerVo.Salutation = ddlSalutation.SelectedItem.Value.ToString(); //if (customerVo.Salutation == "Mr.") //{ // customerVo.Gender = "M"; //} //else //{ // customerVo.Gender = "F"; //} if (txtDateofRegistration.Text == "") { customerVo.RegistrationDate = DateTime.MinValue; } else { customerVo.RegistrationDate = DateTime.Parse(txtDateofRegistration.Text.ToString()); } if (txtDateofCommencement.Text == "") { customerVo.CommencementDate = DateTime.MinValue; } else { customerVo.CommencementDate = DateTime.Parse(txtDateofCommencement.Text.ToString()); } if (txtDateofProfiling.Text != "") { customerVo.ProfilingDate = DateTime.Parse(txtDateofProfiling.Text.ToString()); } else { customerVo.ProfilingDate = DateTime.Today; } customerVo.RegistrationPlace = txtRegistrationPlace.Text.ToString(); customerVo.CompanyWebsite = txtCompanyWebsite.Text.ToString(); 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(); if (txtCorrAdrPinCode.Text != "") { customerVo.Adr1PinCode = int.Parse(txtCorrAdrPinCode.Text.ToString()); } else { customerVo.Adr1PinCode = 0; } customerVo.Adr1City = txtCorrAdrCity.Text.ToString(); if (ddlCorrAdrState.SelectedIndex != 0) { customerVo.Adr1State = ddlCorrAdrState.SelectedItem.Value.ToString(); } customerVo.Adr1Country = ddlCorrAdrCountry.SelectedItem.Value.ToString(); customerVo.Adr2Line1 = txtPermAdrLine1.Text.ToString(); customerVo.Adr2Line2 = txtPermAdrLine2.Text.ToString(); customerVo.Adr2Line3 = txtPermAdrLine3.Text.ToString(); if (chkdummypan.Checked) { customerVo.DummyPAN = 1; } else { customerVo.DummyPAN = 0; } if (chkprospectn.Checked) { customerVo.IsProspect = 1; } else { customerVo.IsProspect = 0; } if (chkmailn.Checked) { customerVo.AlertViaEmail = 1; } else { customerVo.AlertViaEmail = 0; } if (chksmsn.Checked) { customerVo.ViaSMS = 1; } else { customerVo.ViaSMS = 0; } if (txtPermAdrPinCode.Text != "") { customerVo.Adr2PinCode = int.Parse(txtPermAdrPinCode.Text.ToString()); } else { customerVo.Adr2PinCode = 0; } customerVo.Adr2City = txtPermAdrCity.Text.ToString(); if (ddlPermAdrState.SelectedIndex != 0) { customerVo.Adr2State = ddlPermAdrState.SelectedItem.Value.ToString(); } customerVo.Adr2Country = ddlPermAdrCountry.Text.ToString(); if (txtPhoneNo1Isd.Text != "") { customerVo.ResISDCode = int.Parse(txtPhoneNo1Isd.Text.ToString()); } else { customerVo.ResISDCode = 0; } if (txtPhoneNo1Std.Text != "") { customerVo.ResSTDCode = int.Parse(txtPhoneNo1Std.Text.ToString()); } else { customerVo.ResSTDCode = 0; } if (txtPhoneNo1.Text != "") { customerVo.ResPhoneNum = int.Parse(txtPhoneNo1.Text.ToString()); } else { customerVo.ResPhoneNum = 0; } if (txtPhoneNo2Isd.Text != "") { customerVo.OfcISDCode = int.Parse(txtPhoneNo2Isd.Text.ToString()); } else { customerVo.OfcISDCode = 0; } if (txtPhoneNo2Std.Text != "") { customerVo.OfcSTDCode = int.Parse(txtPhoneNo2Std.Text.ToString()); } else { customerVo.OfcSTDCode = 0; } if (txtPhoneNo2.Text != "") { customerVo.OfcPhoneNum = int.Parse(txtPhoneNo2.Text.ToString()); } else { customerVo.OfcPhoneNum = 0; } if (txtFax.Text != "") { customerVo.Fax = int.Parse(txtFax.Text.ToString()); } else { customerVo.Fax = 0; } if (txtFaxIsd.Text != "") { customerVo.ISDFax = int.Parse(txtFaxIsd.Text.ToString()); } else { customerVo.ISDFax = 0; } if (txtFaxStd.Text != "") { customerVo.STDFax = int.Parse(txtFaxStd.Text.ToString()); } else { customerVo.STDFax = 0; } customerVo.Email = txtEmail.Text.ToString(); customerVo.OfcFax = 0; customerVo.OfcISDFax = 0; customerVo.OfcSTDFax = 0; customerVo.OfcFax = 0; customerVo.OfcAdrPinCode = 0; customerVo.Dob = DateTime.MinValue; customerVo.MaritalStatus = null; customerVo.Nationality = null; customerVo.Occupation = null; customerVo.Qualification = null; if (customerBo.UpdateCustomer(customerVo)) { customerVo = customerBo.GetCustomer(customerVo.CustomerId); Session["CustomerVo"] = customerVo; if (customerVo.Type.ToUpper().ToString() == "IND") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('ViewCustomerIndividualProfile','none');", true); } else { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "pageloadscript", "loadcontrol('ViewNonIndividualProfile','none');", true); } } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "EditCustomerNonIndividualProfile.ascx:btnEdit_Click()"); object[] objects = new object[1]; objects[0] = customerVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }