public static void InitDatabase()
        {
            CoffeeDbContext context = new CoffeeDbContext();

            // Init database with context
            context.Users.Add(new User
            {
                UserName = "******",
                Password = "******",
                FullName = "Admin",
                Level    = Utilities.AppEnum.UserLevel.Admin
            });

            context.Users.Add(new User
            {
                UserName = "******",
                Password = "******",
                FullName = "Worker",
                Level    = Utilities.AppEnum.UserLevel.Worker
            });

            for (int i = 1; i <= 20; i++)
            {
                context.Tables.Add(new Table {
                    Name = "Bàn " + i, IsOccupied = false
                });
            }

            context.SaveChanges();
        }
        public static void InitDatabase()
        {
            CoffeeDbContext context = new CoffeeDbContext();

            // Init database with context
            context.Users.Add(new User
            {
                UserName = "******",
                Password = "******",
                FullName = "Admin",
                Level    = Utilities.AppEnum.UserLevel.Admin
            });

            context.Users.Add(new User
            {
                UserName = "******",
                Password = "******",
                FullName = "Baristar",
                Level    = Utilities.AppEnum.UserLevel.Baristar
            });

            context.Users.Add(new User
            {
                UserName = "******",
                Password = "******",
                FullName = "Receptionist",
                Level    = Utilities.AppEnum.UserLevel.Worker
            });

            context.SaveChanges();
        }
Esempio n. 3
0
 public List <Shift> GetShifts(DateTime date)
 {
     _dbContext = new CoffeeDbContext();
     return(_dbContext.Shifts.ToList().Where(s => s.Date.Date.Equals(date.Date)).ToList());
 }
Esempio n. 4
0
 public List <Shift> GetAll()
 {
     _dbContext = new CoffeeDbContext();
     return(_dbContext.Shifts.ToList());
 }
Esempio n. 5
0
 public List <Item> GetAll()
 {
     _dbContext = new CoffeeDbContext();
     return(_dbContext.Items.ToList());
 }
Esempio n. 6
0
 public UnitDao()
 {
     _dbContext = new CoffeeDbContext();
 }
Esempio n. 7
0
 public List <Bill> GetAll()
 {
     dbContext = new CoffeeDbContext();
     return(dbContext.Bills.Include(b => b.CurrentUser).ToList());
 }
Esempio n. 8
0
 public List <Table> GetTables()
 {
     db = new CoffeeDbContext();
     return(db.Tables.ToList());
 }