Esempio n. 1
0
        public void InventoryLocalActionProc(ProductsDataSet.ProductsTblRow datarow, ProductsDataSet.DocsTblRow docsRow)
        {
            ScannedProductsDataSet.ScannedBarcodesRow[] r =
                _scannedProducts.ScannedBarcodes.FindByBarcodeAndDocType(datarow.Barcode, docsRow.DocType);
            if (r != null)
            {
                for (int i = 0; i < r.Length; i++)
                {
                    if (r[i].FactQuantity < r[i].PlanQuanity)
                    {
                        
                        PlayVibroAsyncAction(docsRow);
                        PlaySoundAsyncAction(docsRow);
                        //PrintLabelAsync(datarow, docsRow);
                        //r[i].FactQuantity += 1;
                        uint shablonCode = TSDUtils.ActionCodeDescription.ActionDescription.GetShablon(docsRow.DocType, (uint)docsRow.LabelCode);
                        if (PrintLabel(datarow, docsRow, shablonCode))
                        //if (PrintLabel(datarow, docsRow, docsRow.LabelCode))
                        {
                            r[i].FactQuantity += 1;
                            //PlayVibroAsyncAction(docsRow);
                            //PlaySoundAsyncAction(docsRow);
                        }
                        else
                        {
                            PlayVibroAsync((byte)TSDUtils.ActionCode.NotFound);
                            PlaySoundAsync((byte)TSDUtils.ActionCode.NotFound);
                        }

                        if (r[i].FactQuantity == r[i].PlanQuanity)
                        {

                            using (RemoveFinishForm frm = new RemoveFinishForm(datarow, docsRow))
                            {
                                frm.ShowDialog();
                            }
                        }
                        if (OnActionCompleted != null)
                            OnActionCompleted(docsRow, r[i]);
                        break;
                    }

                }
            }
        }
Esempio n. 2
0
        public void RemoveActionProc(ProductsDataSet.ProductsTblRow datarow, ProductsDataSet.DocsTblRow docsRow)
        {
            ScannedProductsDataSet.ScannedBarcodesRow[] r =
                _scannedProducts.ScannedBarcodes.FindByBarcodeAndDocType(datarow.Barcode, docsRow.DocType);
            if (r != null)
            {
                for (int i = 0; i < r.Length; i++)
                {
                    if (r[i].FactQuantity < r[i].PlanQuanity)
                    {
                        //r[i].FactQuantity += 1;
                        try
                        {
                            PlayVibroAsyncAction(docsRow);
                            PlaySoundAsyncAction(docsRow);
                            /*PrintLabelAsync(datarow, docsRow);
                            r[i].FactQuantity += 1;
                            */
                            uint shablonCode = TSDUtils.ActionCodeDescription.ActionDescription.GetShablon(docsRow.DocType, (uint)docsRow.LabelCode);
                            if (PrintLabel(datarow, docsRow, shablonCode))

                            //if (PrintLabel(datarow, docsRow, docsRow.LabelCode))
                            {
                                r[i].FactQuantity += 1;
                                //PlayVibroAsyncAction(docsRow);
                                //PlaySoundAsyncAction(docsRow);
                            }
                            else
                            {
                                PlayVibroAsync((byte)TSDUtils.ActionCode.NotFound);
                                PlaySoundAsync((byte)TSDUtils.ActionCode.NotFound);
                            }


                            if (r[i].FactQuantity == r[i].PlanQuanity)
                            {

                                using (RemoveFinishForm frm = new RemoveFinishForm(datarow, docsRow))
                                {
                                    frm.ShowDialog();

                                }
                            }
                        }
                        finally
                        {
                            if (OnActionCompleted != null)
                                OnActionCompleted(docsRow, r[i]);
                        }
                        break;
                    }
                    
                }
                //this.actionLabel.Text = TSDUtils.ActionCodeDescription.ActionDescription[ac];
 

            }
            /*ScannedProductsDataSet.ScannedBarcodesRow r = _scannedProducts.ScannedBarcodes.UpdateQuantity(
            docsRow.Barcode, docsRow.DocType, 1);
            if (r != null)
            {
                //TSDUtils.ActionCode ac = (TSDUtils.ActionCode)docsRow.DocType;

                if (r.FactQuantity == r.PlanQuanity)
                {
                    using (RemoveFinishForm frm = new RemoveFinishForm())
                    {
                        frm.ShowDialog();
                    }
                }
                //this.actionLabel.Text = TSDUtils.ActionCodeDescription.ActionDescription[ac];
                if (OnActionCompleted != null)
                    OnActionCompleted(docsRow, r);
            }*/

        }