private void SetCustomerInfo(LayawayReportObject rptObj, LayawayVO layaway) { if (GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer != null) { rptObj.CustomerName = GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.LastName + ", " + GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.FirstName; rptObj.CustomerFirstName = GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.FirstName; rptObj.CustomerLastName = GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.LastName; ContactVO cVo = GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer.getPrimaryContact(); if (cVo != null) { rptObj.ContactNumber = Commons.Format10And11CharacterPhoneNumberForUI(cVo.ContactAreaCode + cVo.ContactPhoneNumber); } else { rptObj.ContactNumber = ""; } } else { CustomerVO customerObject = CustomerProcedures.getCustomerDataByCustomerNumber(GlobalDataAccessor.Instance.DesktopSession, layaway.CustomerNumber); rptObj.CustomerFirstName = customerObject.FirstName; rptObj.CustomerLastName = customerObject.LastName; ContactVO cVo = customerObject.getPrimaryContact(); if (cVo != null) { rptObj.ContactNumber = Commons.Format10And11CharacterPhoneNumberForUI(cVo.ContactAreaCode + cVo.ContactPhoneNumber); } else { rptObj.ContactNumber = ""; } } }
public void populatePhoneNumber(List <ContactVO> customerPhoneData) { //populate home phone number of the customer ContactVO custHomePhone = customerPhoneData.Find(delegate(ContactVO contactObj) { return(contactObj.ContactType == CustomerPhoneTypes.HOME_NUMBER && contactObj.TelecomNumType == CustomerPhoneTypes.VOICE_NUMBER); }); populatePhoneNumbers(custHomePhone, "homePhoneAreaCode", "homePhoneNumber", "homePhoneExtn", "homePhoneCountryCode", "radioButtonHomePhone"); //populate cell phone number of the customer ContactVO custCellPhone = customerPhoneData.Find(delegate(ContactVO contactObj) { return(contactObj.ContactType == CustomerPhoneTypes.HOME_NUMBER && contactObj.TelecomNumType == CustomerPhoneTypes.MOBILE_NUMBER); }); populatePhoneNumbers(custCellPhone, "cellPhoneAreaCode", "cellPhoneNumber", "cellPhoneExtn", "cellPhoneCountryCode", "radioButtonCellPhone"); //populate work phone number of the customer ContactVO custWorkPhone = customerPhoneData.Find(delegate(ContactVO contactObj) { return(contactObj.ContactType == CustomerPhoneTypes.WORK_NUMBER && contactObj.TelecomNumType == CustomerPhoneTypes.VOICE_NUMBER); }); populatePhoneNumbers(custWorkPhone, "workPhoneAreaCode", "workPhoneNumber", "workPhoneExtn", "workPhoneCountryCode", "radioButtonWorkPhone"); //populate pager number of the customer ContactVO custPager = customerPhoneData.Find(delegate(ContactVO contactObj) { return(contactObj.ContactType == CustomerPhoneTypes.HOME_NUMBER && contactObj.TelecomNumType == CustomerPhoneTypes.PAGER_NUMBER); }); populatePhoneNumbers(custPager, "pagerAreaCode", "pagerNumber", "pagerExtn", "pagerCountryCode", ""); //populate fax phone number of the customer ContactVO custFax = customerPhoneData.Find(delegate(ContactVO contactObj) { return(contactObj.ContactType == CustomerPhoneTypes.HOME_NUMBER && contactObj.TelecomNumType == CustomerPhoneTypes.FAX_NUMBER); }); populatePhoneNumbers(custFax, "faxAreaCode", "faxNumber", "faxExtn", "faxCountryCode", ""); }
private void populatePhoneNumbers(ContactVO custContact, string areacodeTextBoxName, string phonenumberTextBoxName, string extensionTextBoxName, string countryCodeTextBoxName, string radiobuttonName) { if (custContact != null) { this.tableLayoutPanel1.Controls[areacodeTextBoxName].Text = custContact.ContactAreaCode; this.tableLayoutPanel1.Controls[phonenumberTextBoxName].Text = Commons.FormatPhoneNumberForUI(custContact.ContactPhoneNumber); this.tableLayoutPanel1.Controls[extensionTextBoxName].Text = custContact.ContactExtension; this.tableLayoutPanel1.Controls[extensionTextBoxName].Enabled = true; this.tableLayoutPanel1.Controls[countryCodeTextBoxName].Text = custContact.CountryDialNumCode; this.tableLayoutPanel1.Controls[countryCodeTextBoxName].Enabled = true; if (!string.IsNullOrEmpty(radiobuttonName)) { if (custContact.TeleusrDefText == "true") { ((RadioButton)this.tableLayoutPanel1.Controls[radiobuttonName]).Checked = true; } else { ((RadioButton)this.tableLayoutPanel1.Controls[radiobuttonName]).Checked = false; } } } else { this.tableLayoutPanel1.Controls[areacodeTextBoxName].Text = string.Empty; this.tableLayoutPanel1.Controls[phonenumberTextBoxName].Text = string.Empty; this.tableLayoutPanel1.Controls[extensionTextBoxName].Text = string.Empty; this.tableLayoutPanel1.Controls[extensionTextBoxName].Enabled = false; this.tableLayoutPanel1.Controls[countryCodeTextBoxName].Text = string.Empty; this.tableLayoutPanel1.Controls[countryCodeTextBoxName].Enabled = false; if (!string.IsNullOrEmpty(radiobuttonName)) { ((RadioButton)this.tableLayoutPanel1.Controls[radiobuttonName]).Checked = false; } } }
public List <ContactVO> getPhoneData() { custPhoneData = new List <ContactVO>(); numberOfPhoneNumbers = 0; checkValid(); if (_isValid) { var strPrimaryPhone = string.Empty; if (numberOfPhoneNumbers > 0) { if (homeNumberEntered) { if (radioButtonHomePhone.Checked) { strPrimaryPhone = "true"; } else { strPrimaryPhone = string.Empty; } ContactVO custPhone = new ContactVO(); custPhone.ContactAreaCode = this.homePhoneAreaCode.Text; custPhone.ContactExtension = this.homePhoneExtn.Text; custPhone.ContactPhoneNumber = Commons.FormatPhoneNumberForDB(this.homePhoneNumber.Text); custPhone.ContactType = CustomerPhoneTypes.HOME_NUMBER; custPhone.CountryDialNumCode = this.homePhoneCountryCode.Text; custPhone.TelecomNumType = CustomerPhoneTypes.VOICE_NUMBER; custPhone.TeleusrDefText = strPrimaryPhone; custPhoneData.Add(custPhone); } if (cellNumberEntered) { if (radioButtonCellPhone.Checked) { strPrimaryPhone = "true"; } else { strPrimaryPhone = string.Empty; } var custPhone = new ContactVO { ContactAreaCode = this.cellPhoneAreaCode.Text, ContactExtension = this.cellPhoneExtn.Text, ContactPhoneNumber = Commons.FormatPhoneNumberForDB(this.cellPhoneNumber.Text), ContactType = CustomerPhoneTypes.HOME_NUMBER, CountryDialNumCode = this.cellPhoneCountryCode.Text, TelecomNumType = CustomerPhoneTypes.MOBILE_NUMBER, TeleusrDefText = strPrimaryPhone }; custPhoneData.Add(custPhone); } if (workNumberEntered) { if (radioButtonWorkPhone.Checked) { strPrimaryPhone = "true"; } else { strPrimaryPhone = string.Empty; } ContactVO custPhone = new ContactVO(); custPhone.ContactAreaCode = this.workPhoneAreaCode.Text; custPhone.ContactExtension = this.workPhoneExtn.Text; custPhone.ContactPhoneNumber = Commons.FormatPhoneNumberForDB(this.workPhoneNumber.Text); custPhone.ContactType = CustomerPhoneTypes.WORK_NUMBER; custPhone.CountryDialNumCode = this.workPhoneCountryCode.Text; custPhone.TelecomNumType = CustomerPhoneTypes.VOICE_NUMBER; custPhone.TeleusrDefText = strPrimaryPhone; custPhoneData.Add(custPhone); } if (faxEntered) { strPrimaryPhone = string.Empty; ContactVO custPhone = new ContactVO(); custPhone.ContactAreaCode = this.faxAreaCode.Text; custPhone.ContactExtension = this.faxExtn.Text; custPhone.ContactPhoneNumber = Commons.FormatPhoneNumberForDB(this.faxNumber.Text); custPhone.ContactType = CustomerPhoneTypes.HOME_NUMBER; custPhone.CountryDialNumCode = this.faxCountryCode.Text; custPhone.TelecomNumType = CustomerPhoneTypes.FAX_NUMBER; custPhone.TeleusrDefText = strPrimaryPhone; custPhoneData.Add(custPhone); } if (pagerEntered) { strPrimaryPhone = string.Empty; ContactVO custPhone = new ContactVO(); custPhone.ContactAreaCode = this.pagerAreaCode.Text.ToString(); custPhone.ContactExtension = this.pagerExtn.Text.ToString(); custPhone.ContactPhoneNumber = Commons.FormatPhoneNumberForDB(this.pagerNumber.Text); custPhone.ContactType = CustomerPhoneTypes.HOME_NUMBER; custPhone.CountryDialNumCode = this.pagerCountryCode.Text.ToString(); custPhone.TelecomNumType = CustomerPhoneTypes.PAGER_NUMBER; custPhone.TeleusrDefText = strPrimaryPhone; custPhoneData.Add(custPhone); } return(custPhoneData); } } return(null); }
private void addCustomerButton_Click(object sender, EventArgs e) { string trigger = GlobalDataAccessor.Instance.DesktopSession.HistorySession.Trigger; //CashlinxDesktopSession.Instance.FormState = CashlinxDesktopSession.CustomerFormStates.ADDCUSTOMER; //CustomerController.NavigateUser(ownerFrm); var newCustomer = new CustomerVO { NewCustomer = true }; //get the Search criteria entered by the user var searchCriteria = GlobalDataAccessor.Instance.DesktopSession.ActiveLookupCriteria; //Get store state from desktop session var strStoreState = string.Empty; strStoreState = GlobalDataAccessor.Instance.CurrentSiteId.State; var newAddr = new AddressVO { State_Code = strStoreState, ContactTypeCode = CustomerAddressTypes.HOME_ADDRESS, ContMethodTypeCode = "POSTALADDR" }; newCustomer.addAddress(newAddr); newCustomer.FirstName = searchCriteria.FirstName; newCustomer.LastName = searchCriteria.LastName; if (!string.IsNullOrEmpty(searchCriteria.DOB) && searchCriteria.DOB != "mm/dd/yyyy") { newCustomer.DateOfBirth = Utilities.GetDateTimeValue(searchCriteria.DOB); } if (!string.IsNullOrEmpty(searchCriteria.IDIssuer)) { var idData = new IdentificationVO { IdIssuer = searchCriteria.IDIssuer, IdValue = searchCriteria.IDNumber, IdIssuerCode = searchCriteria.IdIssuerCode, IdType = searchCriteria.IdTypeCode }; newCustomer.addIdentity(idData); if (!string.IsNullOrEmpty(searchCriteria.PhoneNumber)) { var phoneData = new ContactVO { ContactPhoneNumber = searchCriteria.PhoneNumber, ContactAreaCode = searchCriteria.PhoneAreaCode }; newCustomer.addContact(phoneData); } newCustomer.SocialSecurityNumber = searchCriteria.SSN; } GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer = newCustomer; if (trigger.Equals("newpawnloan", StringComparison.OrdinalIgnoreCase)) { this.NavControlBox.IsCustom = true; this.NavControlBox.CustomDetail = "ManagePawnApplication"; this.NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT; } else { this.NavControlBox.IsCustom = true; this.NavControlBox.CustomDetail = "CreateCustomer"; this.NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT; } }
private bool contactInfoChanged() { bool phoneDataChanged = false; bool emailDataChanged = false; bool contactPreferencesChanged = false; //Check if any of the phone numbers changed if (_strTelecomNumTypeCode.Length != _custToEdit.NumberContacts) { //If the number of phone numbers now is not the same as number of contacts //in the customer object then phone number has changed phoneDataChanged = true; } else if (_strTelecomNumTypeCode[0] == "" && _custToEdit.NumberContacts > 0) { //If the type is empty but the customer object has contacts that implies //that we are deleting all of the phone numbers phoneDataChanged = true; } else { for (int i = 0; i < _strTelecomNumTypeCode.Length; i++) { ContactVO custContInfo = _custToEdit.getContact(_strContactType[i], _strAreaCode[i], _strPhoneNumber[i], _strPhoneExtension[i], _strCountryCode[i], _strPrimaryPhone[i]); //If contact object in the current customer's context does not match //the data on the form for one of the types(home,cell,work,pager,fax) //that means phone data has been changed if (custContInfo == null) { phoneDataChanged = true; break; } } } //Check if Email address changed string strPrimaryEmail = _custToEdit.getPrimaryEmail().EmailAddress; string strAlternateEmail = _custToEdit.getAlternateEmail().EmailAddress; if (strPrimaryEmail != null && strPrimaryEmail != primaryEmailTextBox.Text) { emailDataChanged = true; } else if (strPrimaryEmail == null && primaryEmailTextBox.Text.Length > 0) { emailDataChanged = true; } if (strAlternateEmail != null && strAlternateEmail != alternateEmailTextBox.Text) { emailDataChanged = true; } else if (strAlternateEmail == null && alternateEmailTextBox.Text.Length > 0) { emailDataChanged = true; } //Check if contact preferences changed if (_custToEdit.NoCallFlag != _noCalls || _custToEdit.NoEmailFlag != _noEmails || _custToEdit.NoFaxFlag != _noFaxes || _custToEdit.NoMailFlag != _noMail || _custToEdit.OptOutFlag != _optOut || _custToEdit.ReminderContact != _remindPmtDue || _custToEdit.PreferredContactMethod != _preferContact || _custToEdit.PreferredCallTime != _preferCallTime || _custToEdit.HearAboutUs != _howDidYouHear || _custToEdit.ReceivePromotionOffers != _receiveOffers) { contactPreferencesChanged = true; } if (phoneDataChanged || emailDataChanged || contactPreferencesChanged) { return(true); } else { return(false); } }
void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { _procMsg.Update(); _procMsg.Close(); _procMsg.Dispose(); SetButtonState(true); if (_updatePhoneData) { MessageBox.Show(Commons.GetMessageString("CustContactInfoUpdateSuccess")); //Update the customer object with the updated information CustomerVO updatedCustomer = new CustomerVO { NoCallFlag = _noCalls, NoEmailFlag = _noEmails, NoFaxFlag = _noFaxes, NoMailFlag = _noMail, OptOutFlag = _optOut, ReminderContact = _remindPmtDue, PreferredContactMethod = _preferContact, PreferredCallTime = _preferCallTime, HearAboutUs = _howDidYouHear, ReceivePromotionOffers = _receiveOffers }; //set the phone data for the customer if (_custPhone != null) { foreach (DataRow contact in _custPhone.Rows) { ContactVO custcontact = new ContactVO { TelecomNumType = Utilities.GetStringValue( contact.ItemArray[ (int)customerphonerecord.TELECOMNUMTYPECODE], ""), ContactAreaCode = Utilities.GetStringValue( contact.ItemArray[(int)customerphonerecord.AREADIALNUMCODE], ""), ContactPhoneNumber = Utilities.GetStringValue( contact.ItemArray[(int)customerphonerecord.TELECOMNUMBER], ""), ContactExtension = Utilities.GetStringValue( contact.ItemArray[(int)customerphonerecord.EXTENSIONNUMBER], ""), ContactType = Utilities.GetStringValue( contact.ItemArray[(int)customerphonerecord.CONTACTTYPECODE], ""), TeleusrDefText = Utilities.GetStringValue( contact.ItemArray[(int)customerphonerecord.TELEUSRDEFTEXT], ""), CountryDialNumCode = Utilities.GetStringValue( contact.ItemArray[ (int)customerphonerecord.COUNTRYDIALNUMCODE], "") }; updatedCustomer.addContact(custcontact); } } //Set the Email data for the customer if (_custEmail != null) { foreach (DataRow email in _custEmail.Rows) { string emailAddr = Utilities.GetStringValue(email.ItemArray[(int)customeremailrecord.EMAILADDRESS], ""); string emailAddrType = Utilities.GetStringValue(email.ItemArray[(int)customeremailrecord.EMAILADDRESSTYPECODE], ""); string contactinfoid = Utilities.GetStringValue(email.ItemArray[(int)customeremailrecord.CONTACTINFOID], ""); CustomerEmailVO custemail = new CustomerEmailVO(emailAddr, emailAddrType, contactinfoid); updatedCustomer.addEmail(custemail); } } Form ownerForm = this.Owner; if (ownerForm.GetType() == typeof(ViewCustomerInformation)) { ((ViewCustomerInformation)ownerForm).UpdatedCustomerToView = updatedCustomer; ((ViewCustomerInformation)ownerForm).ShowUpdates = true; } } }