Example #1
0
        public void SaveCostCoefficient(int userID)
        {
            ReceiveDoc grvFullDetail = new ReceiveDoc();

            grvFullDetail.FlushData();
            grvFullDetail.LoadAllByReceiptID(GRV.ID);
            CostBuildUp.SaveChange();
            while (!grvFullDetail.EOF)
            {
                //Insurance here is costCoefficient
                ReceiveDoc receivedoc = new ReceiveDoc();
                receivedoc.LoadByPrimaryKey(grvFullDetail.ID);
                //Use Custom StoreProcedure for Costing
                receivedoc.Insurance = CostCoefficient;
                receivedoc.Save();
                ReceiveDoc.SetUnitCostByReceiveDoc(grvFullDetail.ID, Math.Round(receivedoc.PricePerPack * CostCoefficient, 2), userID);
                ReceiveDoc.SetAverageCostByReceiveDoc(grvFullDetail.ID, Math.Round(receivedoc.PricePerPack * CostCoefficient, 2), userID);
                grvFullDetail.MoveNext();
            }
        }