コード例 #1
0
 public static List <SpecialInvent> GetAllSpecialInvent()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.SpecialInvent.ToList());
     }
 }
コード例 #2
0
ファイル: RatingDAL.cs プロジェクト: PeerCohen/finalProject
 //get all
 public static List <Rating> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Rating.ToList());
     }
 }
コード例 #3
0
ファイル: VisitersDAL.cs プロジェクト: PeerCohen/finalProject
 //get by id
 public static Visiters GetById(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Visiters.FirstOrDefault(v => v.ld == id));
     }
 }
コード例 #4
0
 //get all
 public static List <InventDose> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.InventDose.ToList());
     }
 }
コード例 #5
0
ファイル: VisitersDAL.cs プロジェクト: PeerCohen/finalProject
 //get all
 public static List <Visiters> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Visiters.ToList());
     }
 }
コード例 #6
0
ファイル: VisitersDAL.cs プロジェクト: PeerCohen/finalProject
 public static Visiters GetByPassword(string username, string password)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Visiters.FirstOrDefault(p => p.Password == password && p.NameUser == username));
     }
 }
コード例 #7
0
 //get all
 public static List <EmployeesTypes> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.EmployeesTypes.ToList());
     }
 }
コード例 #8
0
 //get by id
 public static EmployeesTypes GetById(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.EmployeesTypes.Find(id));
     }
 }
コード例 #9
0
 public static StatusInvent GetByIdStatusInvent(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.StatusInvent.Find(id));
     }
 }
コード例 #10
0
ファイル: MenuDAL.cs プロジェクト: PeerCohen/finalProject
 //get by category
 public static List <Menu> GetByCategory(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Menu.Where(item => item.Category == id).ToList());
     }
 }
コード例 #11
0
ファイル: MenuDAL.cs プロジェクト: PeerCohen/finalProject
 //get by id
 public static Menu GetById(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Menu.Find(id));
     }
 }
コード例 #12
0
ファイル: RatingDAL.cs プロジェクト: PeerCohen/finalProject
 //get by id
 public static Rating GetById(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Rating.Find(id));
     }
 }
コード例 #13
0
ファイル: TablesDAL.cs プロジェクト: PeerCohen/finalProject
 //get all
 public static List <Tables> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Tables.ToList());
     }
 }
コード例 #14
0
 public static Employees Login(string username, string password)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Employees.FirstOrDefault(p => p.Password == password && p.LastName == username));
     }
 }
コード例 #15
0
 //get all
 public static List <Category> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Category.ToList());
     }
 }
コード例 #16
0
 //get by id
 public static Category GetById(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Category.Find(id));
     }
 }
コード例 #17
0
 //get all
 public static List <CommentVisiter> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.CommentVisiter.ToList());
     }
 }
コード例 #18
0
 //get by id
 public static CurrentEmployee GetById(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.CurrentEmployee.Find(id));
     }
 }
コード例 #19
0
ファイル: TablesDAL.cs プロジェクト: PeerCohen/finalProject
 //get by id
 public static Tables GetById(int id)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Tables.Find(id));
     }
 }
コード例 #20
0
 //get all
 public static List <CurrentEmployee> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.CurrentEmployee.ToList());
     }
 }
コード例 #21
0
ファイル: MenuDAL.cs プロジェクト: PeerCohen/finalProject
 //get all
 public static List <Menu> GetAll()
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         return(db.Menu.ToList());
     }
 }
コード例 #22
0
 //add
 public static void Add(Category Category)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Category.Add(Category);
         db.SaveChanges();
     }
 }
コード例 #23
0
        //    get by id
        //    public static CommentVisiter GetById(int id)
        //    {

        //        using (restaurantEntities db = new restaurantEntities())
        //        {
        //            return db.CommentVisiter.Find(id);
        //        }


        //    }
        //    add
        public static void Add(CommentVisiter CommentVisiter)
        {
            using (restaurantEntities db = new restaurantEntities())
            {
                db.CommentVisiter.Add(CommentVisiter);
                db.SaveChanges();
            }
        }
コード例 #24
0
 //delete
 public static void Delete(CurrentEmployee currentEmployee)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.CurrentEmployee.Remove(currentEmployee);
         db.SaveChanges();
     }
 }
コード例 #25
0
 //update
 public static void Update(CurrentEmployee currentEmployee)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Entry(currentEmployee).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #26
0
 //add
 public static void Add(CurrentEmployee currentEmployee)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.CurrentEmployee.Add(currentEmployee);
         db.SaveChanges();
     }
 }
コード例 #27
0
ファイル: TablesDAL.cs プロジェクト: PeerCohen/finalProject
 //delete
 public static void Delete(Tables tables)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Tables.Remove(tables);
         db.SaveChanges();
     }
 }
コード例 #28
0
ファイル: TablesDAL.cs プロジェクト: PeerCohen/finalProject
 //update
 public static void Update(Tables tables)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Entry(tables).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #29
0
ファイル: TablesDAL.cs プロジェクト: PeerCohen/finalProject
 //add
 public static void Add(Tables tables)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Tables.Add(tables);
         db.SaveChanges();
     }
 }
コード例 #30
0
ファイル: RatingDAL.cs プロジェクト: PeerCohen/finalProject
 //delete
 public static void Delete(Rating Rating)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Rating.Remove(Rating);
         db.SaveChanges();
     }
 }