示例#1
0
        /// <summary>
        /// Final Cost Settings
        /// </summary>
        /// <returns></returns>
        public Boolean SetFinalCost()
        {
            var GRV = new CostCalculator();

            GRV.LoadGRV(ReceiptID);
            GRV.CalculateFinalCost();
            foreach (DataRowView drv in GRV.GRVSoundDetail.DefaultView)
            {
                double NewUnitCost, NewSellingPrice;
                NewUnitCost = Math.Round(Convert.ToDouble(drv["AverageCost"]),
                                         BLL.Settings.NoOfDigitsAfterTheDecimalPoint);
                NewSellingPrice = Math.Round(Convert.ToDouble(drv["SellingPrice"]),
                                             BLL.Settings.NoOfDigitsAfterTheDecimalPoint);
                var sellingPriceForm = new SellingPricePage(ReceiptID, Convert.ToInt32(drv["ItemID"]),
                                                            Convert.ToInt32(drv["ManufacturerID"]),
                                                            Convert.ToInt32(drv["ItemUnitID"]),
                                                            Convert.ToInt32(drv["AccountID"]), NewUnitCost,
                                                            NewSellingPrice);
                if (sellingPriceForm.ShowDialog(this) == DialogResult.Cancel)
                {
                    return(false);
                }
            }

            return(true);
        }
        private void LoadSelectedGRVDetailForFinalization(int ReceiptID)
        {
            //Display Correct Tab

            selectTab = grpTabFinalize;
            FocusOnSelectedTab();
            GRV.CalculateFinalCost();
            gridFinal.DataSource = GRV.GRVSoundDetail;
        }
示例#3
0
        private void LoadSelectedGRVDetailForFinalization()
        {
            //Display Correct Tab
            if (!GRV.CalculateFinalCost())
            {
                XtraMessageBox.Show("Some Items On the GRV are waiting to be Average,you cannot continue without average them", "Averaging Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            selectTab = grpTabFinalize;
            FocusOnSelectedTab();

            gridFinal.DataSource = GRV.GRVSoundDetail;
        }