示例#1
0
 //update
 public static void Update(Visiters visiters)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Entry(visiters).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
示例#2
0
 //delete
 public static void Delete(Visiters visiters)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Visiters.Remove(visiters);
         db.SaveChanges();
     }
 }
示例#3
0
        //add

        public static Visiters Add(Visiters visiters)
        {
            using (restaurantEntities db = new restaurantEntities())
            {
                visiters = db.Visiters.Add(visiters);
                db.SaveChanges();
                return(visiters);
            }
        }