Ejemplo n.º 1
0
        public void AddProductToStockBL(TypeBO objTypeBO)
        {
            StockBO   objStockBO   = new StockBO();
            StockDA   objStockDA   = new StockDA();
            TypeDA    objTypeDA    = new TypeDA();
            ProductDA objProductDA = new ProductDA();

            objStockBO.StockName  = objProductDA.GetProductName(objTypeBO.ProductID);
            objStockBO.StockType  = objTypeBO.TypeName;
            objStockBO.StockCount = objTypeBO.TypeCount;
            objStockBO.StockDate  = DateTime.Today;

            int oldCount = objTypeDA.GetOldTypeCount(objTypeBO.TypeName, objTypeBO.ProductID);

            objTypeBO.TypeCount = objTypeBO.TypeCount + oldCount;

            objTypeDA.AddProductToStockDA(objTypeBO);
            objStockDA.AddStockRecord(objStockBO);
        }