Пример #1
0
 public Salas retornarSala(int id)
 {
     try
     {
         Salas sala = new Salas();
         using (CinemaEntities db = new CinemaEntities())
         {
             sala = (from g in db.Salas where g.sal_id == id select g).FirstOrDefault();
         }
         return(sala);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Пример #2
0
 public void Adicionar(Salas sala)
 {
     try
     {
         using (CinemaEntities db = new CinemaEntities())
         {
             db.Salas.Add(sala);
             db.SaveChanges();
         }
     }
     catch (Exception e)
     {
         throw e;
         //MessageBox.Show(e.Message);
     }
 }