Exemplo n.º 1
0
 public static void AddSpecialInvent(SpecialInvent specialInvent)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.SpecialInvent.Add(specialInvent);
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
 //add
 public static void Add(Menu menu)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Menu.Add(menu);
         db.SaveChanges();
     }
 }
Exemplo n.º 3
0
 //update
 public static void Update(EmployeesTypes employeesTypes)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Entry(employeesTypes).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 4
0
 //add
 public static void Add(EmployeesTypes employeesTypes)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.EmployeesTypes.Add(employeesTypes);
         db.SaveChanges();
     }
 }
Exemplo n.º 5
0
 //delete
 public static void Delete(EmployeesTypes employeesTypes)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.EmployeesTypes.Remove(employeesTypes);
         db.SaveChanges();
     }
 }
Exemplo n.º 6
0
 //delete
 public static void Delete(StatusDose statusDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.StatusDose.Remove(statusDose);
         db.SaveChanges();
     }
 }
Exemplo n.º 7
0
 //delete
 public static void Delete(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.InventDose.Remove(inventDose);
         db.SaveChanges();
     }
 }
Exemplo n.º 8
0
 //update
 public static void Update(Tables tables)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Entry(tables).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 9
0
 //add
 public static void Add(CurrentEmployee currentEmployee)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.CurrentEmployee.Add(currentEmployee);
         db.SaveChanges();
     }
 }
Exemplo n.º 10
0
 //delete
 public static void Delete(CurrentEmployee currentEmployee)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.CurrentEmployee.Remove(currentEmployee);
         db.SaveChanges();
     }
 }
Exemplo n.º 11
0
 //add
 public static void Add(Tables tables)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Tables.Add(tables);
         db.SaveChanges();
     }
 }
Exemplo n.º 12
0
 //add
 public static void Add(Rating Rating)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Rating.Add(Rating);
         db.SaveChanges();
     }
 }
Exemplo n.º 13
0
 //delete
 public static void Delete(Rating Rating)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Rating.Remove(Rating);
         db.SaveChanges();
     }
 }
Exemplo n.º 14
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();
            }
        }
Exemplo n.º 15
0
 //add
 public static void Add(StatusDose statusDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.StatusDose.Add(statusDose);
         db.SaveChanges();
     }
 }
Exemplo n.º 16
0
 //update
 public static void Update(CurrentEmployee currentEmployee)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Entry(currentEmployee).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 17
0
 //delete
 public static void Delete(Tables tables)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Tables.Remove(tables);
         db.SaveChanges();
     }
 }
Exemplo n.º 18
0
 public static void Update(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Entry(inventDose).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 19
0
 //add
 public static void Add(Category Category)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Category.Add(Category);
         db.SaveChanges();
     }
 }
Exemplo n.º 20
0
 //delete
 public static void Delete(Visiters visiters)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Visiters.Remove(visiters);
         db.SaveChanges();
     }
 }
Exemplo n.º 21
0
 public static void DeleteSpecialInvent(SpecialInvent specialInvent)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var o = db.SpecialInvent.Single(so => so.Id == specialInvent.Id);
         db.SpecialInvent.Remove(o);
         db.SaveChanges();
     }
 }
Exemplo n.º 22
0
        //add

        public static Visiters Add(Visiters visiters)
        {
            using (restaurantEntities db = new restaurantEntities())
            {
                visiters = db.Visiters.Add(visiters);
                db.SaveChanges();
                return(visiters);
            }
        }
Exemplo n.º 23
0
 public static void UpdateSpecialInvent(SpecialInvent specialInvent)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var o = db.SpecialInvent.Single(so => so.Id == specialInvent.Id);
         o.isContact = true;
         db.SaveChanges();
     }
 }
Exemplo n.º 24
0
 public static void Addfeedback(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var dose = db.InventDose.FirstOrDefault(d => d.Id == inventDose.Id);
         dose.Feedback = inventDose.Feedback;
         db.SaveChanges();
     }
 }
Exemplo n.º 25
0
 //delete
 public static void Delete(Menu menu)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var m = db.Menu.FirstOrDefault(p => p.Id == menu.Id);
         db.Menu.Remove(m);
         db.SaveChanges();
     }
 }
Exemplo n.º 26
0
 //update
 public static void Update(Category Category)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var c = db.Category.FirstOrDefault(p => p.Id == Category.Id);
         c.nameCategory = Category.nameCategory;
         db.SaveChanges();
     }
 }
Exemplo n.º 27
0
 //update
 public static void Update(Menu menu)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var m = db.Menu.FirstOrDefault(p => p.Id == menu.Id);
         m.NameDose      = menu.NameDose;
         m.Price         = menu.Price;
         m.InventDetails = menu.InventDetails;
         db.SaveChanges();
     }
 }
Exemplo n.º 28
0
 public static int GetRate(int?doseId)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var d   = db.Rating.Where(p => p.doseId == doseId).ToList();
         var sum = d.Sum(p => p.rate);
         var cou = d.Count;
         var dos = db.Menu.First(p => p.Id == doseId);
         dos.RateDose = sum / cou;
         db.SaveChanges();
         return((int)sum / cou);
     }
 }
Exemplo n.º 29
0
 //update
 public static void UpdateIdStatus(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var dose = db.InventDose.FirstOrDefault(d => d.Id == inventDose.Id);
         if (dose.IdStatusDose == 3)
         {
             dose.IdStatusDose = 1;
         }
         else
         {
             dose.IdStatusDose = 2;
         }
         db.SaveChanges();
     }
 }
Exemplo n.º 30
0
 //delete
 public static void Delete(Category Category)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var m = db.Menu.Where(x => x.Category == Category.Id).ToList();
         if (m != null)
         {
             foreach (var item in m)
             {
                 db.Menu.Remove(item);
             }
         }
         var c = db.Category.FirstOrDefault(C => C.Id == Category.Id);
         db.Category.Remove(c);
         db.SaveChanges();
     }
 }