Exemple #1
0
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            var          errorDesc = string.Empty;
            DialogResult dgr       = DialogResult.Retry;

            //Make a call to save in the database

            do
            {
                vendorID = vendor.ID;
                retValue = VendorProcedures.AddVendor(vendor, strUserId, strStoreNumber, out vendorID, out errorDesc);
                if (retValue)
                {
                    break;
                }
                else
                {
                    dgr = MessageBox.Show(Commons.GetMessageString("ProcessingError"), "Error", MessageBoxButtons.RetryCancel);

                    if (dgr == DialogResult.OK)
                    {
                        break;
                    }
                }
            }while (dgr == DialogResult.Retry);
        }
Exemple #2
0
        private void LoadSelectedVendor()
        {
            //Get the selected row from the grid and get the corresponding data from the customer table
            //for the selected customer
            DataRowView drv = (DataRowView)(_bindingSource1.Current);
            DataRow     selectedVendorRow = _vendors.Rows.Find(drv.Row["vendor_id"]);
            string      selectedId        = selectedVendorRow.ItemArray[(int)vendorrecord.ID].ToString();

            _vendorObject = VendorProcedures.getVendorDataInObject(selectedId, selectedVendorRow);
        }
Exemple #3
0
 private void createVendorObject()
 {
     VendorProcedures.setVendorDataInObject(ref vendor,
                                            name.Text,
                                            taxID.Text,
                                            ffl.Text,
                                            address1.Text,
                                            address2.Text,
                                            zipcode.Text,
                                            zip4.Text,
                                            city.Text,
                                            state.selectedValue,
                                            phone.Text,
                                            phone2.Text,
                                            fax.Text,
                                            contact.Text,
                                            comment.Text);
     if (!string.IsNullOrEmpty(vendorID))
     {
         vendor.ID = vendorID;
     }
 }
Exemple #4
0
        private void customButtonContinue_Click(object sender, EventArgs e)
        {
            labelErrorMessage.Visible = false;
            PurchaseVO purchaseObj;
            CustomerVO customerObj;
            string     errorCode;
            string     errorText;
            bool       retValue;
            bool       vendorReturn = false;

            string tenderType;

            if (radioButtonBuyNo.Checked)
            {
                CashlinxDesktopSession.Instance.Purchases = new List <PurchaseVO>();
                if (customTextBoxBuyNo.Text.Length > 0)
                {
                    if (CashlinxDesktopSession.Instance.HistorySession.Trigger.Equals("returnvendorbuy", StringComparison.OrdinalIgnoreCase))
                    {
                        retValue = PurchaseProcedures.GetPurchaseData(Utilities.GetIntegerValue(CashlinxDesktopSession.Instance.CurrentSiteId.StoreNumber, 0),
                                                                      Utilities.GetIntegerValue(customTextBoxBuyNo.Text, 0), "2", StateStatus.BLNK, ProductStatus.PFI.ToString(), false, out purchaseObj, out customerObj, out tenderType, out errorCode, out errorText);
                        vendorReturn = true;
                        if (retValue)
                        {
                            purchaseObj.PurchaseTenderType = tenderType.ToUpper() == "CASH" ? PurchaseTenderTypes.CASHOUT.ToString() : PurchaseTenderTypes.BILLTOAP.ToString();
                        }
                    }
                    else
                    {
                        retValue = PurchaseProcedures.GetPurchaseData(Utilities.GetIntegerValue(CashlinxDesktopSession.Instance.CurrentSiteId.StoreNumber, 0),
                                                                      Utilities.GetIntegerValue(customTextBoxBuyNo.Text, 0), "2", StateStatus.BLNK, ProductStatus.PUR.ToString(), true, out purchaseObj, out customerObj, out tenderType, out errorCode, out errorText);
                    }

                    if (retValue && purchaseObj != null)
                    {
                        CashlinxDesktopSession.Instance.Purchases.Add(purchaseObj);
                        if (vendorReturn)
                        {
                            CashlinxDesktopSession.Instance.ActiveVendor = VendorProcedures.getVendorDataByID(purchaseObj.EntityNumber, CashlinxDesktopSession.Instance.CurrentSiteId.StoreNumber);
                        }
                        else
                        {
                            CashlinxDesktopSession.Instance.ActiveCustomer = customerObj;
                        }
                        CashlinxDesktopSession.Instance.BuyReturnIcn = false;
                        NavControlBox.IsCustom     = true;
                        NavControlBox.CustomDetail = "SHOWITEMS";
                        NavControlBox.Action       = NavBox.NavAction.BACKANDSUBMIT;
                    }
                    else
                    {
                        labelErrorMessage.Text    = "The buy number was not found. ";
                        labelErrorMessage.Visible = true;
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
            else
            {
                if (customTextBoxICN.Text.Length > 0)
                {
                    bool isProperIcn = customTextBoxICN.Text.Contains(".") && !customTextBoxICN.Text.EndsWith(".");
                    if (!isProperIcn)
                    {
                        MessageBox.Show("Invalid ICN entered");
                        return;
                    }
                    if (CashlinxDesktopSession.Instance.HistorySession.Trigger.Equals("returnvendorbuy", StringComparison.OrdinalIgnoreCase))
                    {
                        //BZ # 301 - add new param store number to work with icn short code
                        retValue = PurchaseProcedures.GetPurchaseDataFromIcn(GlobalDataAccessor.Instance.OracleDA, customTextBoxICN.Text.ToString(), CashlinxDesktopSession.Instance.CurrentSiteId.StoreNumber,
                                                                             false, out purchaseObj, out customerObj, out tenderType, out errorCode, out errorText);
                        vendorReturn = true;
                        if (retValue)
                        {
                            purchaseObj.PurchaseTenderType = tenderType.ToUpper() == "CASH" ? PurchaseTenderTypes.CASHOUT.ToString() : PurchaseTenderTypes.BILLTOAP.ToString();
                        }
                    }
                    else
                    {
                        //BZ # 301 - add new param store number to work with icn short code
                        retValue = PurchaseProcedures.GetPurchaseDataFromIcn(GlobalDataAccessor.Instance.OracleDA, customTextBoxICN.Text.ToString(), CashlinxDesktopSession.Instance.CurrentSiteId.StoreNumber,
                                                                             true, out purchaseObj, out customerObj, out tenderType, out errorCode, out errorText);
                    }

                    if (retValue && purchaseObj != null)
                    {
                        if (!CashlinxDesktopSession.Instance.BuyReturnIcn)
                        {
                            CashlinxDesktopSession.Instance.Purchases.Add(purchaseObj);
                        }
                        else
                        {
                            //Check if the new icn belongs to the purchase that was already selected
                            if (CashlinxDesktopSession.Instance.ActivePurchase.TicketNumber != purchaseObj.TicketNumber)
                            {
                                DialogResult dgr = MessageBox.Show("The ticket number for this item does not match items previously found. Please process each ticket number separately. Do you want to search for another item?", "Buy Return Error", MessageBoxButtons.YesNo);
                                if (dgr == DialogResult.Yes)
                                {
                                    return;
                                }
                                else
                                {
                                    NavControlBox.Action = NavBox.NavAction.CANCEL;
                                }
                            }
                            int idx = CashlinxDesktopSession.Instance.ActivePurchase.Items.FindIndex(iItem => iItem.Icn == purchaseObj.Items[0].Icn);
                            if (idx < 0)
                            {
                                CashlinxDesktopSession.Instance.ActivePurchase.Items.Add(purchaseObj.Items[0]);
                            }
                            else
                            {
                                MessageBox.Show("The ICN is already selected. Please enter another ICN number");
                                return;
                            }
                        }
                        if (vendorReturn)
                        {
                            CashlinxDesktopSession.Instance.ActiveVendor = VendorProcedures.getVendorDataByID(purchaseObj.EntityNumber, CashlinxDesktopSession.Instance.CurrentSiteId.StoreNumber);
                        }
                        else
                        {
                            CashlinxDesktopSession.Instance.ActiveCustomer = customerObj;
                        }
                        if (!CashlinxDesktopSession.Instance.BuyReturnIcn)
                        {
                            CashlinxDesktopSession.Instance.BuyReturnIcn = true;
                        }
                        NavControlBox.IsCustom     = true;
                        NavControlBox.CustomDetail = "SHOWITEMS";
                        NavControlBox.Action       = NavBox.NavAction.BACKANDSUBMIT;
                    }
                    else
                    {
                        labelErrorMessage.Text    = "The ICN number was not found.";
                        labelErrorMessage.Visible = true;
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
        }