Пример #1
0
        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;
        }
Пример #2
0
        private void submitButton_Click(object sender, EventArgs e)
        {
            string    errorCode;
            string    errorText;
            DataTable gunTableData;
            Item      gunItemData;

            if (!string.IsNullOrEmpty(txtGunNumber.Text) && !string.IsNullOrEmpty(tboxShopNumber.Text))
            {
                _storeNumber = tboxShopNumber.Text.PadLeft(5, '0');
                bool retVal = MerchandiseProcedures.GetGunData(GlobalDataAccessor.Instance.OracleDA,
                                                               _storeNumber, //GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber,
                                                               Utilities.GetIntegerValue(txtGunNumber.Text),
                                                               out gunTableData,
                                                               out gunItemData,
                                                               out errorCode,
                                                               out errorText);

                if (retVal && errorText.Contains("No Merchandise data found"))
                {
                    MessageBox.Show(Commons.GetMessageString("GunEditErrorMessage"));
                    txtGunNumber.Focus();
                    return;
                }

                if (!retVal)
                {
                    MessageBox.Show("Invalid Gun Number");
                    txtGunNumber.Focus();
                    return;
                }

                GlobalDataAccessor.Instance.DesktopSession.GunData = gunTableData;
                CashlinxPawnSupportSession.Instance.GunItemData    = gunItemData;
                NavControlBox.Action = NavBox.NavAction.BACKANDSUBMIT;
            }
        }
Пример #3
0
        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;
        }
Пример #4
0
        public static bool UpdateGunDescriptionData()
        {
            GlobalDataAccessor.Instance.beginTransactionBlock();
            string errorCode;
            string errorMessage;
            bool   gunMdseUpdate = MerchandiseProcedures.UpdateGunData(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber,
                                                                       GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0],
                                                                       GlobalDataAccessor.Instance.DesktopSession.UserName,
                                                                       out errorCode,
                                                                       out errorMessage);

            if (gunMdseUpdate)
            {
                bool deleteOtherdsc = MerchandiseProcedures.DeleteOtherDesc(GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber,
                                                                            GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mStore,
                                                                            GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mYear,
                                                                            GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mDocNumber,
                                                                            GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mDocType,
                                                                            GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mItemOrder,
                                                                            out errorCode,
                                                                            out errorMessage);
                if (deleteOtherdsc)
                {
                    if ((from iAttr in GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].Attributes
                         where iAttr.Answer.AnswerCode == 999
                         select ProcessTenderProcedures.ExecuteInsertOtherDscRecord(
                             GlobalDataAccessor.Instance.DesktopSession.CurrentSiteId.StoreNumber,
                             GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mStore,
                             GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mYear,
                             GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mDocNumber,
                             string.Format("{0}", GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mDocType),
                             GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].mItemOrder, 0, iAttr.MaskOrder,
                             iAttr.Answer.AnswerText, GlobalDataAccessor.Instance.DesktopSession.UserName,
                             out errorCode, out errorMessage)).Any(otherDscVal => !otherDscVal))
                    {
                        GlobalDataAccessor.Instance.DesktopSession.endTransactionBlock(EndTransactionType.ROLLBACK);
                        return(false);
                    }
                    Item   pawnItem   = GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0];
                    string sErrorText = string.Empty;
                    string sErrorCode = string.Empty;
                    if (!string.IsNullOrEmpty(GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].Comment))
                    {
                        ProcessTenderProcedures.ExecuteInsertOtherDscRecord(
                            GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber,
                            pawnItem.mStore, pawnItem.mYear, pawnItem.mDocNumber,
                            pawnItem.mDocType, pawnItem.mItemOrder, 0, 999,
                            pawnItem.Comment, GlobalDataAccessor.Instance.DesktopSession.UserName, out sErrorCode, out sErrorText);
                        if (sErrorCode != "0")
                        {
                            FileLogger.Instance.logMessage(LogLevel.ERROR, null, "Could not insert comment data when updating gun description for " + pawnItem.GunNumber.ToString());
                        }
                    }
                }
                else
                {
                    GlobalDataAccessor.Instance.DesktopSession.endTransactionBlock(EndTransactionType.ROLLBACK);
                    return(false);
                }
                DataTable gunTableData;
                Item      gunItemData;
                MerchandiseProcedures.GetGunData(GlobalDataAccessor.Instance.OracleDA,
                                                 GlobalDataAccessor.Instance.CurrentSiteId.StoreNumber,
                                                 Utilities.GetIntegerValue(GlobalDataAccessor.Instance.DesktopSession.ActivePawnLoan.Items[0].GunNumber),
                                                 out gunTableData,
                                                 out gunItemData,
                                                 out errorCode,
                                                 out errorMessage);
                GlobalDataAccessor.Instance.DesktopSession.GunData     = gunTableData;
                GlobalDataAccessor.Instance.DesktopSession.GunItemData = gunItemData;
                GlobalDataAccessor.Instance.DesktopSession.endTransactionBlock(EndTransactionType.COMMIT);
                return(true);
            }
            GlobalDataAccessor.Instance.endTransactionBlock(EndTransactionType.ROLLBACK);
            return(false);
        }