public StockUser AddUser(StockUser newUser)
 {
     _dbStockContext.User.Add(newUser);
     _dbStockContext.SaveChanges();
     return(newUser);
     //   throw new NotImplementedException();
 }
        public CashTrans AddCashTrans(CashTrans cash)
        {
            _dbCashContext.Cash.Add(cash);
            _dbCashContext.SaveChanges();

            return(cash);

            //throw new NotImplementedException();
        }
Esempio n. 3
0
        public StockTrans AddStockTrans(StockTrans stock)
        {
            int      dayNumber = DateTime.Now.DayOfYear;
            int      year      = DateTime.Now.Year;
            DateTime theDate   = new DateTime(year, 1, 1).AddDays(dayNumber - 1);

            //30 days
            DateTime month = DateTime.Today.AddDays(-29);
            //7 days
            DateTime week = DateTime.Today.AddDays(-6);
            //today
            DateTime present = DateTime.Today;

            _dbStockContext.Stock.Add(stock);
            _dbStockContext.SaveChanges();

            return(stock);
            //throw new NotImplementedException();
        }