Example #1
0
        private void InternalLoadQuantities(long pLonCustomerId)
        {
            grdCustomerStockDatail.BlockUI();
            Thread.Sleep(300);

            try
            {
                InternalSetQuantities
                (
                    mObjAuctionsServices.GetBatchAuctionService().GetAvailableQuantityBySeller(AuctionId, pLonCustomerId),
                    mObjAuctionsServices.GetBatchAuctionService().GetSoldQuantityBySeller(AuctionId, pLonCustomerId),
                    mObjAuctionsServices.GetBatchAuctionService().GetPurchasedQuantityByBuyer(AuctionId, pLonCustomerId),
                    mObjAuctionsServices.GetBatchAuctionService().GetSoldQuantityByAuction(AuctionId)
                );
            }
            catch (Exception lObjException)
            {
                grdCustomerStockDatail.UnblockUI();
                InternalShowMessageError(lObjException);
            }
            finally
            {
                grdCustomerStockDatail.UnblockUI();
            }
        }
Example #2
0
        private void SkipBatches()
        {
            grdSkipBatch.BlockUI();

            try
            {
                int  lIntSkipBatch    = GetSkipBatch();
                int  lIntNextBatch    = GetNextBatch();
                bool lBolDialogResult = false;

                if (lIntSkipBatch > lIntNextBatch)
                {
                    for (int lIntBatchNumber = lIntNextBatch; lIntBatchNumber < lIntSkipBatch; lIntBatchNumber++)
                    {
                        var x = GetBatchObject(mLonAuctionId, lIntBatchNumber);
                        mObjAuctionsFactory.GetBatchAuctionService().SaveOrUpdateBatch(GetBatchObject(mLonAuctionId, lIntBatchNumber));
                    }
                    lBolDialogResult = true;
                }
                CloseDialog(lBolDialogResult);
            }
            catch (Exception lObjException)
            {
                grdSkipBatch.UnblockUI();
                ShowMessage("Error", lObjException.Message);
            }
            finally
            {
                grdSkipBatch.UnblockUI();
            }
        }
Example #3
0
        private string CancelGoodsIssue(CancelMovementDTO pObjCancelMovementDTO)
        {
            string lStrResult = string.Empty;

            try
            {
                List <GoodsIssue>  lLstGoodsIssue      = mObjAuctionsFactory.GetBatchAuctionService().GetBatches(mObjAuction.Id).SelectMany(x => x.GoodsIssues).Where(y => y.BatchId == mObjBatch.Id).ToList();
                List <GoodsReturn> lLstGoodsReturnExit = mObjAuctionsFactory.GetBatchAuctionService().GetBatches(mObjAuction.Id).SelectMany(x => x.GoodsReturns).Where(y => !y.Removed && y.BatchId == mObjBatch.Id && y.Delivered == true).ToList();

                int lIntQtyGoodIssue = lLstGoodsIssue != null?lLstGoodsIssue.Sum(z => z.Quantity) : 0;

                int lIntQtyGoodReturnExit = lLstGoodsReturnExit != null?lLstGoodsReturnExit.Sum(z => z.Quantity) : 0;

                if (lIntQtyGoodIssue - pObjCancelMovementDTO.GoodIssue.Quantity >= lIntQtyGoodReturnExit)
                {
                    pObjCancelMovementDTO.GoodIssue.Canceled = true;
                    mObjInventoryServicesFactory.GetGoodsIssueService().SaveOrUpdate(pObjCancelMovementDTO.GoodIssue);
                    mObjInventoryServicesFactory.GetGoodsIssueService().Remove(pObjCancelMovementDTO.MovementId);
                    lStrResult = "";
                }
                else
                {
                    lStrResult = "Favor de revisar las cantidades " + "Cantidad Salidas - Cantidad Salida a Cancelar >= Cantidad Devoluciones(Salida)";
                }
            }
            catch (Exception ex)
            {
                lStrResult = "Error al cancelar folio: " + pObjCancelMovementDTO.GoodIssue.Id + " Error: " + ex.Message;
                //CustomMessageBox.Show("Error al cancelar", ex.Message, this.GetParent());
            }

            return(lStrResult);
        }
Example #4
0
        private void DivideBuyers()
        {
            try
            {
                //Add new Batches
                mObjAuctionsFactory.GetBatchService().SaveOrUpdateEntityList(GetNewBatches());
                //Update Divided Batch
                mObjAuctionsFactory.GetBatchAuctionService().SaveOrUpdateBatch(GetEditedBatch(), true);

                ResetForm();

                ShowMessage("DivisiĆ³n de lote", "El lote se dividio correctamente");
            }
            catch (Exception)
            {
                throw;
            }
        }