public visita selecionarVisitaComID(int id) { visita vis = new visita(); using (ImobGentilEntities db = new ImobGentilEntities()) { vis = (from vi in db.visita where vi.id == id select vi).FirstOrDefault(); } return(vis); }
public void modificarStatusVisita(visita vis) { using (ImobGentilEntities db = new ImobGentilEntities()) { try { db.Entry(vis).State = System.Data.EntityState.Modified; db.SaveChanges(); } catch (Exception) { throw; } } }
public void AdicionarAgendamento(visita vis) { try { using (ImobGentilEntities db = new ImobGentilEntities()) { db.visita.Add(vis); db.SaveChanges(); } } catch (Exception e) { throw e; //MessageBox.Show(e.Message); } }