public int InsertarTipoCliente(tipo_clientes tipo) { try { ctx.tipo_clientes.Add(tipo); ctx.SaveChanges(); return(1); } catch (Exception) { return(0); } }
public bool eliminar(int id) { try { cliente c = ctx.cliente.Find(id); if (c == null) { throw new System.ArgumentException("El cliente no existe", "error"); } ctx.cliente.Remove(c); ctx.SaveChanges(); return(true); } catch (Exception) { return(false); } }