public mesa Obtener(int id) { var empre = new mesa(); try { using (var db = new RrestauranteModel()) { empre = db.mesa.Where(x => x.mesa_id == id).SingleOrDefault(); } } catch (Exception ex) { throw ex; } return(empre); }
public mesa DesactivarMesa(int id) { var mesa = new mesa(); try { using (var db = new RrestauranteModel()) { mesa = db.mesa.Find(id); mesa.estado = "Inactivo"; db.SaveChanges(); } } catch (Exception ex) { throw ex; } return(mesa); }