Example #1
0
        public void UpdatePallets()
        {
            double units   = ItemsBLL.GetCaseQuantity(Convert.ToInt32(transferDetailsGridView.GetFocusedRowCellValue(transferItemGridColumn)));
            float  pallets = Convert.ToSingle(((ViewRecord)itemRepositoryItemLookUpEdit.GetDataSourceRowByKeyValue(transferDetailsGridView.GetFocusedRowCellValue(transferItemGridColumn)))[3]); //CasesPerPallet

            if (Convert.ToDouble(transferDetailsGridView.GetFocusedRowCellValue(colTransferQuantity)) < 1)
            {
                if (units != 0)
                {
                    transferDetailsGridView.SetFocusedRowCellValue(colTransferQuantity, Convert.ToDouble(transferDetailsGridView.GetFocusedRowCellValue(colTransferUnits)) * units);
                }
                else
                {
                    transferDetailsGridView.SetFocusedRowCellValue(colTransferQuantity, 0);
                }
            }

            //calculate the quantity
            if (Convert.ToDouble(transferDetailsGridView.GetFocusedRowCellValue(colTransferUnits)) == 0)
            {
                if (units != 0)
                {
                    transferDetailsGridView.SetFocusedRowCellValue(colTransferUnits, Math.Ceiling(Convert.ToDouble(transferDetailsGridView.GetFocusedRowCellValue(colTransferQuantity)) / units));
                }
            }

            if (pallets != 0)
            {
                transferDetailsGridView.SetFocusedRowCellValue(colTransferPallets, Convert.ToDouble(transferDetailsGridView.GetFocusedRowCellValue(colTransferUnits)) / pallets);
            }
            else
            {
                transferDetailsGridView.SetFocusedRowCellValue(colTransferPallets, 0);
            }
        }
Example #2
0
        public void UpdateQtyPerPallet()
        {
            double CasesPerPallet  = 0;
            double QuantityPerUnit = 0;
            int    itemId          = Convert.ToInt32(itemLookUpEdit.EditValue);

            QuantityPerUnit = ItemsBLL.GetCaseQuantity(itemId);
            CasesPerPallet  = m_Items.GetCasesPerPallet(itemId);

            //UnitsPerPltTextEdit.EditValue = CasesPerPallet;
            QtyPerPltTextEdit.EditValue = (CasesPerPallet * QuantityPerUnit);

            //if(!string.IsNullOrEmpty(QtyTextEdit.Text))
            //    UnitsTextEdit.EditValue = Math.Ceiling(Convert.ToDouble(QtyTextEdit.Text) / QuantityPerUnit);
        }