public void alterarSessao(Sessoes ses) { using (CinemaEntities db = new CinemaEntities()) { db.Entry(ses).State = System.Data.EntityState.Modified; db.SaveChanges(); } }
public void Adicionar(Sessoes sessao) { try { using (CinemaEntities db = new CinemaEntities()) { db.Sessoes.Add(sessao); db.SaveChanges(); } } catch (Exception e) { throw e; //MessageBox.Show(e.Message); } }