Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public Boolean SetFinalCost()
        {
            foreach (DataRowView drv in gridFinalView.DataSource as DataView)
            {
                double NewUnitCost, NewSellingPrice;
                NewUnitCost     = Math.Round(Convert.ToDouble(drv["AverageCost"]), BLL.Settings.NoOfDigitsAfterTheDecimalPoint);
                NewSellingPrice = Math.Round(Convert.ToDouble(drv["SellingPrice"]), BLL.Settings.NoOfDigitsAfterTheDecimalPoint);
                SellingPricePage sellingPriceForm = new SellingPricePage(ReceiptID, Convert.ToInt32(drv["ItemID"]), Convert.ToInt32(drv["ManufacturerID"]), Convert.ToInt32(drv["ItemUnitID"]), Convert.ToInt32(drv["MovingAverageID"]), NewUnitCost, NewSellingPrice);
                if (sellingPriceForm.ShowDialog(this) == System.Windows.Forms.DialogResult.Cancel)
                {
                    return(false);
                }
            }

            return(true);
        }