private void customButtonSubmit_Click(object sender, EventArgs e) { string errorCode; string errorText; var dSession = GlobalDataAccessor.Instance.DesktopSession; MerchandiseProcedures.UpdateGunCustomerData(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, gunNumber, dSession.GunAcquireCustomer ? "A" : "D", newCustomer.LastName, newCustomer.FirstName, !string.IsNullOrEmpty(newCustomer.MiddleInitial) ? newCustomer.MiddleInitial.Substring(0, 1) : "", string.Format("{0} {1}", customTextBoxaddr1.Text, customTextBoxAddr2.Text), customTextBoxCity.Text, state1.selectedValue, zipcode1.Text, newCustomer.getFirstIdentity().IdType, newCustomer.getFirstIdentity().IdIssuer, newCustomer.getFirstIdentity().IdValue, dSession.UserName, out errorCode, out errorText); if (errorCode != "0") { MessageBox.Show("Customer data could not be updated"); } else { MessageBox.Show("Customer data updated successfully"); DataTable gunTableData; Item gunItem; MerchandiseProcedures.GetGunData(GlobalDataAccessor.Instance.OracleDA, GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, Utilities.GetIntegerValue(gunNumber), out gunTableData, out gunItem, out errorCode, out errorText); dSession.GunData = gunTableData; dSession.GunItemData = gunItem; } NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT; }
private void customButtonSubmit_Click(object sender, EventArgs e) { ComboBox addrstate = (ComboBox)this.state1.Controls[0]; getPersonalIdentificationDataFromForm(); if (idEditResource) { if (string.IsNullOrEmpty(customTextBoxLastName.Text.Trim()) || string.IsNullOrEmpty(customTextBoxFirstName.Text.Trim()) || string.IsNullOrEmpty(customTextBoxAddr1.Text.Trim()) || string.IsNullOrEmpty(addrstate.GetItemText(addrstate.SelectedItem)) || string.IsNullOrEmpty(customTextBoxCity.Text.Trim()) || string.IsNullOrEmpty(zipcode1.Text) || string.IsNullOrEmpty(strIdentTypeCode) || string.IsNullOrEmpty(strIdentIssuer) || string.IsNullOrEmpty(strIdentNumber.Trim())) { incompleteData = true; } } else { if (string.IsNullOrEmpty(customTextBoxAddr1.Text.Trim()) || string.IsNullOrEmpty(addrstate.GetItemText(addrstate.SelectedItem)) || string.IsNullOrEmpty(customTextBoxCity.Text.Trim()) || string.IsNullOrEmpty(zipcode1.Text)) { incompleteData = true; } } string errorCode; string errorText; string custMiddleInitial = string.Empty; custMiddleInitial = this.idEditResource ? (!string.IsNullOrEmpty(this.customTextBoxInitial.Text)?this.customTextBoxInitial.Text.Substring(0, 1):"") : this.newCustomer.MiddleInitial; var dSession = GlobalDataAccessor.Instance.DesktopSession; MerchandiseProcedures.UpdateGunCustomerData(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, Utilities.GetStringValue(gunBookData.Rows[0]["gun_number"]), dSession.GunAcquireCustomer ? "A" : "D", idEditResource ? customTextBoxLastName.Text : newCustomer.LastName, idEditResource ? customTextBoxFirstName.Text : newCustomer.FirstName, custMiddleInitial, string.Format("{0} {1}", customTextBoxAddr1.Text, customTextBoxAddr2.Text), customTextBoxCity.Text, addrstate.GetItemText(addrstate.SelectedItem), zipcode1.Text, idEditResource ? strIdentTypeCode : newCustomer.getFirstIdentity().IdType, idEditResource ? strIdentIssuer : newCustomer.getFirstIdentity().IdIssuer, idEditResource ? strIdentNumber : newCustomer.getFirstIdentity().IdValue, dSession.UserName, out errorCode, out errorText); if (errorCode != "0") { MessageBox.Show("Customer data could not be updated"); } else { MessageBox.Show("Customer data updated successfully"); DataTable gunTableData; Item gunItem; MerchandiseProcedures.GetGunData(GlobalDataAccessor.Instance.OracleDA, GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber, Utilities.GetIntegerValue(gunBookData.Rows[0]["gun_number"]), out gunTableData, out gunItem, out errorCode, out errorText); dSession.GunData = gunTableData; dSession.GunItemData = gunItem; } NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT; }