Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo 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());
 }
Ejemplo n.º 4
0
 public List <Shift> GetAll()
 {
     _dbContext = new CoffeeDbContext();
     return(_dbContext.Shifts.ToList());
 }
Ejemplo n.º 5
0
 public List <Item> GetAll()
 {
     _dbContext = new CoffeeDbContext();
     return(_dbContext.Items.ToList());
 }
Ejemplo n.º 6
0
 public UnitDao()
 {
     _dbContext = new CoffeeDbContext();
 }
Ejemplo n.º 7
0
 public List <Bill> GetAll()
 {
     dbContext = new CoffeeDbContext();
     return(dbContext.Bills.Include(b => b.CurrentUser).ToList());
 }
Ejemplo n.º 8
0
 public List <Table> GetTables()
 {
     db = new CoffeeDbContext();
     return(db.Tables.ToList());
 }