Example #1
0
 public static void Delete(int id)
 {
     using (CinemaContext db = new CinemaContext())
     {
         Telephone telephone = db.Telephones.Find(id);
         db.Telephones.Remove(telephone);
         db.SaveChanges();
     }
 }
Example #2
0
 public static void Update(int id, int clentid, int number)
 {
     using (CinemaContext db = new CinemaContext())
     {
         Telephone telephone = db.Telephones.Find(id);
         telephone.ClientId = clentid;
         telephone.Number   = number;
         db.Telephones.Update(telephone);
         db.SaveChanges();
     }
 }
Example #3
0
 public static void Insert(int id, int clentid, int number)
 {
     using (CinemaContext db = new CinemaContext())
     {
         Telephone telephone = new Telephone();
         telephone.Id       = id;
         telephone.ClientId = clentid;
         telephone.Number   = number;
         db.Telephones.Add(telephone);
         db.SaveChanges();
     }
 }