コード例 #1
0
        public OptionBatches(DeliveryAdviceAPIs deliveryAdviceAPIs, DeliveryAdviceDetailDTO deliveryAdviceDetailDTO)
        {
            InitializeComponent();

            this.deliveryAdviceAPIs      = deliveryAdviceAPIs;
            this.deliveryAdviceDetailDTO = deliveryAdviceDetailDTO;
        }
コード例 #2
0
        private void ViewDetails_ListChanged(object sender, ListChangedEventArgs e)
        {
            if (e.ListChangedType == ListChangedType.ItemAdded || e.ListChangedType == ListChangedType.ItemDeleted || e.ListChangedType == ListChangedType.Reset)
            {
                this.customTabCenter.TabPages[0].Text = "Advice Line Details [" + this.deliveryAdviceViewModel.ViewDetails.Count.ToString("N0") + " item(s)]             ";

                this.customizeColumnWidth();
            }

            if (this.EditableMode && e.PropertyDescriptor != null && e.NewIndex >= 0 && e.NewIndex < this.deliveryAdviceViewModel.ViewDetails.Count)
            {
                DeliveryAdviceDetailDTO deliveryAdviceDetailDTO = this.deliveryAdviceViewModel.ViewDetails[e.NewIndex];
                if (deliveryAdviceDetailDTO != null)
                {
                    this.CalculateQuantityDetailDTO(deliveryAdviceDetailDTO, e.PropertyDescriptor.Name, this.deliveryAdviceViewModel.DeliveryAdviceID, null);
                }
            }
        }
コード例 #3
0
        private void menuOptionBatches_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.EditableMode)
                {
                    DeliveryAdviceDetailDTO deliveryAdviceDetailDTO = this.gridexViewDetails.CurrentRow.DataBoundItem as DeliveryAdviceDetailDTO;
                    if (deliveryAdviceDetailDTO != null)
                    {
                        deliveryAdviceDetailDTO.DeliveryAdviceID = this.deliveryAdviceViewModel.DeliveryAdviceID;
                        deliveryAdviceDetailDTO.LocationID       = this.deliveryAdviceViewModel.LocationID;
                        OptionBatches optionBatches = new OptionBatches(deliveryAdviceDetailDTO);
                        optionBatches.ShowDialog(); this.customizeColumnWidth();

                        optionBatches.Dispose();
                    }
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
コード例 #4
0
        private void buttonAddESC_Click(object sender, EventArgs e)
        {
            try
            {
                if (sender.Equals(this.buttonAdd) || sender.Equals(this.buttonAddExit))
                {
                    foreach (var checkedObjects in this.fastPendingSalesOrderDetails.CheckedObjects)
                    {
                        PendingSalesOrderDetail pendingSalesOrderDetail = (PendingSalesOrderDetail)checkedObjects;
                        DeliveryAdviceDetailDTO deliveryAdviceDetailDTO = new DeliveryAdviceDetailDTO()
                        {
                            DeliveryAdviceID = this.deliveryAdviceViewModel.DeliveryAdviceID,

                            SalesOrderID        = pendingSalesOrderDetail.SalesOrderID,
                            SalesOrderDetailID  = pendingSalesOrderDetail.SalesOrderDetailID,
                            SalesOrderReference = pendingSalesOrderDetail.SalesOrderReference,
                            SalesOrderEntryDate = pendingSalesOrderDetail.SalesOrderEntryDate,

                            VoucherCode = pendingSalesOrderDetail.SalesOrderVoucherCode,

                            CommodityID   = pendingSalesOrderDetail.CommodityID,
                            CommodityCode = pendingSalesOrderDetail.CommodityCode,
                            CommodityName = pendingSalesOrderDetail.CommodityName,

                            PackageSize = pendingSalesOrderDetail.PackageSize,

                            Volume        = pendingSalesOrderDetail.Volume,
                            PackageVolume = pendingSalesOrderDetail.PackageVolume,

                            QuantityAvailable   = pendingSalesOrderDetail.QuantityAvailable,
                            LineVolumeAvailable = pendingSalesOrderDetail.LineVolumeAvailable,

                            QuantityRemains   = pendingSalesOrderDetail.QuantityRemains,
                            LineVolumeRemains = pendingSalesOrderDetail.LineVolumeRemains,

                            Quantity   = pendingSalesOrderDetail.QuantityRemains,
                            LineVolume = pendingSalesOrderDetail.LineVolumeRemains
                        };
                        this.deliveryAdviceViewModel.ViewDetails.Add(deliveryAdviceDetailDTO);
                    }


                    if (sender.Equals(this.buttonAddExit))
                    {
                        this.DialogResult = DialogResult.OK;
                    }
                    else
                    {
                        this.WizardDetail_Load(this, new EventArgs());
                    }
                }

                if (sender.Equals(this.buttonESC))
                {
                    this.DialogResult = DialogResult.Cancel;
                }
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }