public void eliminar() { try { using (var ctx = new tekusContext()) { ctx.Entry(this).State = EntityState.Deleted; ctx.SaveChanges(); } } catch (Exception E) { throw; } }
public List <cliente> Listar() { var clientes = new List <cliente>(); try { using (var ctx = new tekusContext()) { clientes = ctx.cliente.ToList(); } } catch (Exception E) { throw; } return(clientes); }
public cliente verCliente(int id) { var cliente = new cliente(); try { using (var ctx = new tekusContext()) { cliente = ctx.cliente.Include("servicio") .Include("servicio.pais") .Where(x => x.id == id) .SingleOrDefault(); } } catch (Exception E) { throw; } return(cliente); }
public void salvarCliente() { try { using (var ctx = new tekusContext()) { if (this.id > 0) { ctx.Entry(this).State = EntityState.Modified; } else { ctx.Entry(this).State = EntityState.Added; } ctx.SaveChanges(); } } catch (Exception E) { throw; } }