private void DispositionEdit_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { LoadItemData(); gunBookCustomer = new CustomerVO(); gunBookCustomer.FirstName = dispositionCustFirstName; gunBookCustomer.LastName = dispositionCustLastName; gunBookCustomer.MiddleInitial = dispositionCustMiddleName; AddressVO addr1 = new AddressVO(); addr1.Address1 = dispositionCustomerAddress1; addr1.City = dispositionCustomerCity; addr1.State_Code = dispositionCustomerState; addr1.ZipCode = dispositionCustomerZipcode; addr1.ContactTypeCode = CustomerAddressTypes.HOME_ADDRESS; addr1.ContMethodTypeCode = "POSTALADDR"; gunBookCustomer.addAddress(addr1); gunBookCustomer.CustomerNumber = dispositionCustNumber; IdentificationVO id = new IdentificationVO(); id.IdType = dispositionCustIDType; id.IdValue = dispositionCustIDNumber; id.IdIssuerCode = dispositionCustIDAgency; id.IsLatest = true; gunBookCustomer.addIdentity(id); CashlinxDesktopSession.Instance.ActiveCustomer = gunBookCustomer; CashlinxDesktopSession.Instance.GunAcquireCustomer = false; CashlinxDesktopSession.Instance.CustomerEditType = CustomerType.DISPOSITION; NavControlBox.IsCustom = true; NavControlBox.CustomDetail = "EditCustomer"; NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT; }
private void buttonBack_Click(object sender, EventArgs e) { //Take the user to the New Customer Information Add screen //Remove all Identities data from the customer being edited //and if its an existing customer add back the identities that already exists for //this customer..This step is done to remove the newly added identity _newCustomer.removeIdentities(); if (_currentCustomer != null) { foreach (var ident in _currentCustomer.getAllIdentifications()) { _newCustomer.addIdentity(ident); } } GlobalDataAccessor.Instance.DesktopSession.MPCustomer = _newCustomer; GlobalDataAccessor.Instance.DesktopSession.MPNameCheck = _nameCheck; this.NavControlBox.IsCustom = true; this.NavControlBox.CustomDetail = "ManagePawnApplication"; this.NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT; }
private void LoadIDDataInObject() { _updatedCustomer = new CustomerVO(); if (_custIdentities != null) { foreach (DataRow cust in _custIdentities.Rows) { IdentificationVO custid = new IdentificationVO { IdType = Utilities.GetStringValue( cust.ItemArray[(int)customeridrecord.IDENTTYPECODE], ""), IdValue = Utilities.GetStringValue( cust.ItemArray[(int)customeridrecord.ISSUEDNUMBER], ""), IdIssuer = Utilities.GetStringValue( cust.ItemArray[(int)customeridrecord.STATE_NAME], ""), IdIssuerCode = Utilities.GetStringValue( cust.ItemArray[(int)customeridrecord.ISSUERNAME], ""), DatedIdentDesc = Utilities.GetStringValue( cust.ItemArray[(int)customeridrecord.DATEDIDENTTYPEDESC], ""), IdExpiryData = Utilities.GetDateTimeValue( cust.ItemArray[(int)customeridrecord.EXPIRYDATE], DateTime.MaxValue), IdentId = Utilities.GetStringValue( cust.ItemArray[(int)customeridrecord.IDENTID], "") }; _updatedCustomer.addIdentity(custid); } } }
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 void buttonSubmit_Click(object sender, EventArgs e) { string strIdentNumber = customTextBoxCWPNumber.Text; Boolean cancelSubmit = false; //BZ # 753 //if (!_retailFirearmCheck && !customTextBoxRefNumber.isValid) if (!_retailFirearmCheck && !customTextBoxRefNumber.isValid && string.IsNullOrEmpty(strIdentNumber)) { MessageBox.Show(@"Background reference number must be entered"); return; } if (!checkExpDate()) { this.dateCWP.Focus(); return; } //store the background ref check number in the customer object _currentCustomer.BackgroundCheckRefNumber = customTextBoxRefNumber.Text; //store the CWP data against the customer if he did not already //have a cwp and if they entered CWP data in the form ComboBox statelist = (ComboBox)stateCWP.Controls[0]; string cwpIssuerState = statelist.GetItemText(statelist.SelectedItem); string cwpIssuerStateName = statelist.SelectedValue.ToString(); string strIdentExpiryDate = dateCWP.Controls[0].Text; if (strIdentExpiryDate.Equals("mm/dd/yyyy")) { strIdentExpiryDate = string.Empty; } string strIdentTypeCode = CustomerIdTypes.CW.ToString(); IdentificationVO custCWPID = new IdentificationVO(); string storeState = CashlinxDesktopSession.Instance.CurrentSiteId.State; if (_currentCustomer.HasValidConcealedWeaponsPermitInState(storeState, ShopDateTime.Instance.ShopDate)) { custCWPID = _currentCustomer.getIdByTypeandIssuer(CustomerIdTypes.CW.ToString(), storeState); } if (!string.IsNullOrEmpty(custCWPID.IdValue.Trim())) { _idCwpExists = true; //idExpDate = custCWPID.IdExpiryData.Date != DateTime.MaxValue.Date ? custCWPID.IdExpiryData.FormatDate() : string.Empty; //idIssuer = custCWPID.IdIssuerCode; } decimal backgroundCheckFee; if (_retailFirearmCheck || _layawayFirearmCheck) { //Check if ident number and issuer and expiry date is entered if reference number was not entered if (!customTextBoxRefNumber.isValid && (strIdentNumber.Equals(string.Empty) || cwpIssuerState.Equals("Select One") || strIdentExpiryDate == string.Empty || strIdentExpiryDate == string.Empty)) { if (!IsBackgroundCheckRequired) { MessageBox.Show("Either Background reference number or all CWP data should be entered"); return; } else { MessageBox.Show("Background reference number should be entered"); return; } } else if (_layawayFirearmCheck) { //if (!decimal.TryParse(customTextBoxBackgroundCheckFee.Text, out backgroundCheckFee) || backgroundCheckFee < 0) bool formatSuccess = Commons.FormatStringAsDecimal(customTextBoxBackgroundCheckFee.Text, out backgroundCheckFee); //BZ # 503 if (formatSuccess) { if (backgroundCheckFee <= 0.0m) { string msg = "Back ground Check Fee amount is less or equal to zero. Is that okay?"; DialogResult dgr = MessageBox.Show(msg, "Back ground Check Fee equals zero", MessageBoxButtons.YesNo); if (dgr == DialogResult.No) { return; } } else { CashlinxDesktopSession.Instance.BackgroundCheckFeeValue = backgroundCheckFee; } } else { MessageBox.Show("Invalid background check fee"); return; } //BZ # 503 end } else { CashlinxDesktopSession.Instance.BackgroundCheckFeeValue = 0M; } } else { if ((!customTextBoxRefNumber.isValid) && (strIdentNumber.Equals(string.Empty) || cwpIssuerState.Equals("Select One"))) { if (!IsBackgroundCheckRequired) { MessageBox.Show("Either Background reference number or all CWP data should be entered"); return; } else { MessageBox.Show("Background reference number should be entered"); return; } } CashlinxDesktopSession.Instance.BackgroundCheckFeeValue = 0M; } if ((!customTextBoxRefNumber.isValid) && !IsBackgroundCheckRequired && _currentCustomer.HasConcealedWeaponsPermit()) { //check to see if the object has been populated with data. if (custCWPID.IdExpiryData == DateTime.MaxValue) { custCWPID = _currentCustomer.getAllIdentifications().Where(i => i.IdType == CustomerIdTypes.CW.ToString()).FirstOrDefault(); } if (strIdentNumber.Trim() != custCWPID.IdValue.Trim() || cwpIssuerState != custCWPID.IdIssuerCode) { DialogResult dgr = MessageBox.Show("This customer has the following CWP on file: " + custCWPID.IdIssuerCode + "-" + custCWPID.IdValue + ". If you continue, the CWP you entered will replace the one on file.", "Concealed Weapons Permit Already Exists", MessageBoxButtons.YesNo); if (dgr == DialogResult.No) { return; } } } //Check if the ID is a new id entered in this form or it already exists //for the customer //Add to the database only if its a new id if (!string.IsNullOrEmpty(strIdentNumber) && !cwpIssuerState.Equals("Select One")) { IdentificationVO custIdInfo = _currentCustomer.getIdentity(CustomerIdTypes.CW.ToString(), strIdentNumber, cwpIssuerState, strIdentExpiryDate); if (custIdInfo == null) { DialogResult dgr; do { string strUserId = CashlinxDesktopSession.Instance.UserName; string errorMsg = string.Empty; string errorCode = string.Empty; bool updateIdData = new CustomerDBProcedures(CashlinxDesktopSession.Instance).UpdateCustPersonalIdentification(_currentCustomer.PartyId, strIdentNumber, strIdentExpiryDate, strIdentTypeCode, cwpIssuerState, strUserId, out errorCode, out errorMsg); if (updateIdData) { IdentificationVO newCustId = new IdentificationVO { IdType = strIdentTypeCode, IdValue = strIdentNumber, IdIssuerCode = cwpIssuerState, IdIssuer = cwpIssuerStateName, DatedIdentDesc = StateIdTypeDescription.CW.ToString(), IdExpiryData = Utilities.GetDateTimeValue(strIdentExpiryDate, DateTime.MaxValue) }; _currentCustomer.addIdentity(newCustId); break; } dgr = MessageBox.Show(Commons.GetMessageString("CustIdentUpdateFailure"), "Error", MessageBoxButtons.RetryCancel); } while (dgr == DialogResult.Retry); } } //If the user cancelled retrying to update the db when it failed //continue since the CWP can always be added later for the customer and do //not have to stop the pickup flow for it GlobalDataAccessor.Instance.DesktopSession.BackgroundCheckCompleted = true; GlobalDataAccessor.Instance.DesktopSession.ActiveCustomer = _currentCustomer; Close(); }