public List <PESSOA> Listar() { using (var ctx = new LEILAOEntities()) { return(ctx.PESSOA.ToList()); } }
public List <PRODUTO> Listar() { using (var ctx = new LEILAOEntities()) { return(ctx.PRODUTO.ToList()); } }
public List <LANCES> Listar() { using (var ctx = new LEILAOEntities()) { return(ctx.LANCES.ToList()); } }
public bool Salvar(PRODUTO PRODUTO) { int salvo = 0; try { using (var ctx = new LEILAOEntities()) { ctx.PRODUTO.Add(PRODUTO); salvo = ctx.SaveChanges(); } } catch (Exception ex) { throw ex; } return(salvo > 0); }
public bool Salvar(PESSOA pessoa) { int salvo = 0; try { using (var ctx = new LEILAOEntities()) { ctx.PESSOA.Add(pessoa); salvo = ctx.SaveChanges(); } } catch (Exception ex) { throw ex; } return(salvo > 0); }
public bool Salvar(LANCES LANCES) { int salvo = 0; try { using (var ctx = new LEILAOEntities()) { ctx.LANCES.Add(LANCES); salvo = ctx.SaveChanges(); } } catch (Exception ex) { throw ex; } return(salvo > 0); }
public PRODUTO BuscaID(int ID) { PRODUTO pes = new PRODUTO(); if (ID > 0) { using (var ctx = new LEILAOEntities()) { pes = ctx.PRODUTO.FirstOrDefault(x => x.ID == ID); } } if (pes == null) { pes = new PRODUTO(); } return(pes); }
public PESSOA BuscaID(int ID) { PESSOA pes = new PESSOA(); if (ID > 0) { using (var ctx = new LEILAOEntities()) { pes = ctx.PESSOA.FirstOrDefault(x => x.ID == ID); } } if (pes == null) { pes = new PESSOA(); } return(pes); }
public LANCES BuscaID(int ID) { LANCES pes = new LANCES(); if (ID > 0) { using (var ctx = new LEILAOEntities()) { pes = ctx.LANCES.FirstOrDefault(x => x.ID == ID); } } if (pes == null) { pes = new LANCES(); } return(pes); }
public bool Remover(int ID) { int removido = 0; try { if (ID > 0) { using (var ctx = new LEILAOEntities()) { if (ctx.PRODUTO.Any(x => x.ID == ID)) { ctx.PRODUTO.Remove(BuscaID(ID)); removido = ctx.SaveChanges(); } } } } catch (Exception ex) { throw ex; } return(removido > 0); }
public bool Editar(PRODUTO PRODUTO) { int salvo = 0; try { if (PRODUTO.ID > 0) { using (var ctx = new LEILAOEntities()) { if (ctx.PRODUTO.Any(x => x.ID == PRODUTO.ID)) { ctx.PRODUTO.Add(PRODUTO); salvo = ctx.SaveChanges(); } } } } catch (Exception ex) { throw ex; } return(salvo > 0); }
public bool Editar(PESSOA pessoa) { int salvo = 0; try { if (pessoa.ID > 0) { using (var ctx = new LEILAOEntities()) { if (ctx.PESSOA.Any(x => x.ID == pessoa.ID)) { ctx.PESSOA.Add(pessoa); salvo = ctx.SaveChanges(); } } } } catch (Exception ex) { throw ex; } return(salvo > 0); }
public bool Editar(LANCES LANCES) { int salvo = 0; try { if (LANCES.ID > 0) { using (var ctx = new LEILAOEntities()) { if (ctx.LANCES.Any(x => x.ID == LANCES.ID)) { ctx.LANCES.Add(LANCES); salvo = ctx.SaveChanges(); } } } } catch (Exception ex) { throw ex; } return(salvo > 0); }