Пример #1
0
        private void fastPendingPallets_MouseClick(object sender, MouseEventArgs e)
        {
            try
            {
                if (this.EditableMode && this.pickupViewModel.Editable && this.pickupViewModel.IsValid && !this.pickupViewModel.IsDirty)
                {
                    this.timerLoadPending.Enabled = false;
                    PendingPallet pendingPallet = (PendingPallet)this.fastPendingPallets.SelectedObject;
                    if (pendingPallet != null)
                    {
                        PickupDetailDTO pickupDetailDTO = this.InitPickupDetailDTO(pendingPallet);
                        WizardDetail    wizardDetail    = new WizardDetail(pickupDetailDTO);
                        TabletMDI       tabletMDI       = new TabletMDI(wizardDetail);

                        if (tabletMDI.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            if (this.fastPendingPallets.CheckedObjects.Count > 0) //this.pickupViewModel.FillingLineID == (int)GlobalVariables.FillingLine.Drum &&
                            {
                                this.pickupViewModel.ViewDetails.RaiseListChangedEvents = false;
                                foreach (var checkedObjects in this.fastPendingPallets.CheckedObjects)
                                {
                                    PickupDetailDTO pDTO = this.InitPickupDetailDTO((PendingPallet)checkedObjects);
                                    pDTO.BinLocationID   = pickupDetailDTO.BinLocationID;
                                    pDTO.BinLocationCode = pickupDetailDTO.BinLocationCode;
                                    this.pickupViewModel.ViewDetails.Add(pDTO);
                                }
                                this.pickupViewModel.ViewDetails.RaiseListChangedEvents = true;
                                this.pickupViewModel.ViewDetails.ResetBindings();
                            }
                            else
                            {
                                this.pickupViewModel.ViewDetails.Add(pickupDetailDTO);
                            }

                            this.callAutoSave();
                        }

                        wizardDetail.Dispose(); tabletMDI.Dispose();
                    }
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
            finally
            {
                if (!this.pickupViewModel.ViewDetails.RaiseListChangedEvents)
                {
                    this.pickupViewModel.ViewDetails.RaiseListChangedEvents = true;
                    this.pickupViewModel.ViewDetails.ResetBindings();
                }
                this.timerLoadPending.Enabled = true;
            }
        }
Пример #2
0
        private void fastPendingList_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            try
            {
                FastObjectListView fastPendingList = this.customTabBatch.SelectedIndex == 0 ? this.fastPendingPallets : (this.customTabBatch.SelectedIndex == 1 ? this.fastPendingCartons : null);

                if (this.warehouseAdjustmentViewModel.WarehouseAdjustmentTypeID == (int)GlobalEnums.WarehouseAdjustmentTypeID.ChangeBinLocation && fastPendingList.SelectedObject != null)
                {
                    if (fastPendingList != null && fastPendingList.SelectedObject != null)
                    {
                        GoodsReceiptDetailAvailable goodsReceiptDetailAvailable = (GoodsReceiptDetailAvailable)fastPendingList.SelectedObject;
                        if (goodsReceiptDetailAvailable != null)
                        {
                            LineDetailBinlLocation lineDetailBinlLocation = new LineDetailBinlLocation()
                            {
                                CommodityID     = goodsReceiptDetailAvailable.CommodityID,
                                CommodityCode   = goodsReceiptDetailAvailable.CommodityCode,
                                CommodityName   = goodsReceiptDetailAvailable.CommodityName,
                                PackID          = goodsReceiptDetailAvailable.PackID,
                                PackCode        = goodsReceiptDetailAvailable.PalletCode,
                                CartonID        = goodsReceiptDetailAvailable.CartonID,
                                CartonCode      = goodsReceiptDetailAvailable.CartonCode,
                                PalletID        = goodsReceiptDetailAvailable.PalletID,
                                PalletCode      = goodsReceiptDetailAvailable.PalletCode,
                                WarehouseID     = (int)this.warehouseAdjustmentViewModel.WarehouseReceiptID,
                                BinLocationID   = goodsReceiptDetailAvailable.NewBinLocationID,
                                BinLocationCode = goodsReceiptDetailAvailable.NewBinLocationCode,
                                Quantity        = (decimal)goodsReceiptDetailAvailable.QuantityAvailable,
                                LineVolume      = (decimal)goodsReceiptDetailAvailable.LineVolumeAvailable
                            };

                            Pickups.WizardDetail wizardDetail = new Pickups.WizardDetail(lineDetailBinlLocation);
                            TabletMDI            tabletMDI    = new TabletMDI(wizardDetail);

                            if (tabletMDI.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                            {
                                foreach (var checkedObject in fastPendingList.CheckedObjects)
                                {
                                    GoodsReceiptDetailAvailable p = (GoodsReceiptDetailAvailable)checkedObject;
                                    p.NewBinLocationID   = (int)lineDetailBinlLocation.BinLocationID;
                                    p.NewBinLocationCode = lineDetailBinlLocation.BinLocationCode;
                                }
                                fastPendingList.RefreshObject(goodsReceiptDetailAvailable);
                            }

                            wizardDetail.Dispose(); tabletMDI.Dispose();
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Пример #3
0
        private void AddDetails(bool usingTablet)
        {
            try
            {
                if (this.EditableMode && this.goodsIssueViewModel.Editable && this.goodsIssueViewModel.IsValid && !this.goodsIssueViewModel.IsDirty)
                {
                    IPendingPrimaryDetail pendingPrimaryDetail = null; string fileName = null;

                    if (usingTablet)
                    {
                        pendingPrimaryDetail = this.fastPendingPrimaryDetails.SelectedObject as IPendingPrimaryDetail;
                    }
                    else
                    {
                        OpenFileDialog openFileDialog = new OpenFileDialog();
                        openFileDialog.Filter = "Text Document (.txt)|*.txt";
                        if (openFileDialog.ShowDialog() == DialogResult.OK && openFileDialog.FileName != "")
                        {
                            fileName = openFileDialog.FileName;
                        }
                    }

                    if (pendingPrimaryDetail != null || fileName != null)
                    {
                        bool         dialogResultOK;
                        WizardDetail wizardDetail = new WizardDetail(this.goodsIssueViewModel, this.pendingPrimaryDetails, pendingPrimaryDetail, fileName);

                        if (usingTablet)
                        {
                            TabletMDI tabletMDI = new TabletMDI(wizardDetail);
                            dialogResultOK = tabletMDI.ShowDialog() == System.Windows.Forms.DialogResult.OK;
                            wizardDetail.Dispose(); tabletMDI.Dispose();
                        }
                        else
                        {
                            dialogResultOK = wizardDetail.ShowDialog() == System.Windows.Forms.DialogResult.OK;
                            wizardDetail.Dispose();
                        }
                        if (dialogResultOK)
                        {
                            this.callAutoSave();
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Пример #4
0
        private void fastPendingCartons_MouseDown(object sender, MouseEventArgs e)
        {
            try
            {
                if (e.Button == System.Windows.Forms.MouseButtons.Right && this.fastPendingCartons.SelectedObject != null)
                {
                    Carton carton = (Carton)this.fastPendingCartons.SelectedObject;
                    if (carton != null)
                    {
                        LineDetailBinlLocation lineDetailBinlLocation = new LineDetailBinlLocation()
                        {
                            CommodityID     = carton.CommodityID,
                            CartonID        = carton.CartonID,
                            CartonCode      = carton.Code,
                            WarehouseID     = this.warehouseAdjustmentViewModel.WarehouseID,
                            BinLocationID   = carton.BinLocationID,
                            BinLocationCode = carton.BinLocationCode,
                            Quantity        = (decimal)carton.Quantity,
                            LineVolume      = carton.LineVolume
                        };

                        Pickups.WizardDetail wizardDetail = new Pickups.WizardDetail(lineDetailBinlLocation);
                        TabletMDI            tabletMDI    = new TabletMDI(wizardDetail);

                        if (tabletMDI.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            foreach (var checkedObject in this.fastPendingCartons.Objects)
                            {
                                Carton p = (Carton)checkedObject;
                                //if (p.BinLocationID == null)
                                //{
                                p.BinLocationID   = (int)lineDetailBinlLocation.BinLocationID;
                                p.BinLocationCode = lineDetailBinlLocation.BinLocationCode;
                                //}
                            }

                            this.fastPendingCartons.RefreshObject(carton);
                        }

                        wizardDetail.Dispose(); tabletMDI.Dispose();
                    }
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Пример #5
0
        private void menuOptionBinLocations_Click(object sender, EventArgs e)
        {
            try
            {
                FastObjectListView fastPendingList = this.customTabBatch.SelectedIndex == 0 ? this.fastPendingPallets : (this.customTabBatch.SelectedIndex == 1 ? this.fastPendingCartons : null);

                if (fastPendingList != null && fastPendingList.SelectedObject != null)
                {
                    IPendingforGoodsReceiptDetail pendingforGoodsReceiptDetail = (IPendingforGoodsReceiptDetail)fastPendingList.SelectedObject;
                    if (pendingforGoodsReceiptDetail != null)
                    {
                        LineDetailBinlLocation lineDetailBinlLocation = new LineDetailBinlLocation()
                        {
                            CommodityID     = pendingforGoodsReceiptDetail.CommodityID,
                            CommodityCode   = pendingforGoodsReceiptDetail.CommodityCode,
                            CommodityName   = pendingforGoodsReceiptDetail.CommodityName,
                            PackID          = pendingforGoodsReceiptDetail.PackID,
                            PackCode        = pendingforGoodsReceiptDetail.PackCode,
                            CartonID        = pendingforGoodsReceiptDetail.CartonID,
                            CartonCode      = pendingforGoodsReceiptDetail.CartonCode,
                            PalletID        = pendingforGoodsReceiptDetail.PalletID,
                            PalletCode      = pendingforGoodsReceiptDetail.PalletCode,
                            WarehouseID     = this.goodsReceiptViewModel.WarehouseID,
                            BinLocationID   = pendingforGoodsReceiptDetail.BinLocationID,
                            BinLocationCode = pendingforGoodsReceiptDetail.BinLocationCode,
                            Quantity        = (decimal)pendingforGoodsReceiptDetail.Quantity,
                            LineVolume      = pendingforGoodsReceiptDetail.LineVolume
                        };

                        Pickups.WizardDetail wizardDetail = new Pickups.WizardDetail(lineDetailBinlLocation);
                        TabletMDI            tabletMDI    = new TabletMDI(wizardDetail);

                        if (tabletMDI.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            //if (fastPendingList.Equals(this.fastPendingCartons)) NEU AAP DUNG CACH NAY: CHI CARTON MOI CHO PHEP SET BIN LOCATION HANG LOAT
                            //{
                            foreach (var checkedObject in fastPendingList.CheckedObjects)
                            {
                                IPendingforGoodsReceiptDetail p = (IPendingforGoodsReceiptDetail)checkedObject;
                                p.BinLocationID   = (int)lineDetailBinlLocation.BinLocationID;
                                p.BinLocationCode = lineDetailBinlLocation.BinLocationCode;
                            }
                            //}
                            //else
                            //{
                            //    pendingforGoodsReceiptDetail.BinLocationID = (int)lineDetailBinlLocation.BinLocationID;
                            //    pendingforGoodsReceiptDetail.BinLocationCode = lineDetailBinlLocation.BinLocationCode;
                            //}

                            fastPendingList.RefreshObject(pendingforGoodsReceiptDetail);
                        }

                        wizardDetail.Dispose(); tabletMDI.Dispose();
                    }
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }