public int DeleteStock(int stockid)
        {
            tblStock ts = _db.tblStocks.Where(s => s.StockID == stockid).FirstOrDefault();

            _db.tblStocks.Remove(ts);
            return(_db.SaveChanges());
        }
        public int AddNewTempStock(TempStockDetails tsd)
        {
            tblTemp_Stock tts = new tblTemp_Stock();
            //tblProduct tp = new tblProduct();
            tblStock ts = new tblStock();

            tts.ProductID = tsd.ProductID;
            tts.Quantity  = tsd.Quantity;
            _db.tblTemp_Stock.Add(tts);
            return(_db.SaveChanges());
        }
        public int UpdateStock(StockDetails sd)
        {
            tblStock ts = _db.tblStocks.Where(s => s.StockID == sd.StockID).FirstOrDefault();

            ts.StockID    = sd.StockID;
            ts.StockNo    = sd.StockNo;
            ts.ProductID  = sd.ProductID;
            ts.SupplierID = sd.SupplierID;
            ts.Quantity   = sd.Quantity;
            ts.Date       = DateTime.Now;
            return(_db.SaveChanges());
        }
        public int AddNewStock(StockDetails sd)
        {
            tblStock ts = new tblStock();

            ts.StockNo    = sd.StockNo;
            ts.ProductID  = sd.ProductID;
            ts.SupplierID = sd.SupplierID;
            ts.Quantity   = sd.Quantity;
            ts.Date       = DateTime.Now;
            _db.tblStocks.Add(ts);
            return(_db.SaveChanges());
        }