public bool Read() { try { DALC.Cliente cli = bdd.Cliente.First(c => c.RutCliente.Equals(RutCliente)); CommonBC.Syncronize(cli, this); return(true); } catch (Exception) { return(false); } }
public bool Read() { try { DALC.Contrato con = bdd.Contrato.First(c => c.Numero.Equals(Numero)); CommonBC.Syncronize(con, this); return(true); } catch (Exception ex) { Logger.mensaje(ex.Message); return(false); } }
public bool Update() { try { DALC.Cliente cli = bdd.Cliente.First(c => c.RutCliente.Equals(this.RutCliente)); CommonBC.Syncronize(this, cli); bdd.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Read() { try { DALC.CoffeeBreak c = bdd.CoffeeBreak.Find(this.Numero); CommonBC.Syncronize(c, this); bdd.SaveChanges(); return(true); } catch (Exception ex) { Logger.mensaje(ex.Message); return(false); } }
public bool Create() { try { DALC.CoffeeBreak c = new DALC.CoffeeBreak(); CommonBC.Syncronize(this, c); bdd.CoffeeBreak.Add(c); bdd.SaveChanges(); return(true); } catch (Exception ex) { Logger.mensaje(ex.Message); return(false); } }
public bool Create() { try { DALC.Contrato con = new DALC.Contrato(); CommonBC.Syncronize(this, con); bdd.Contrato.Add(con); bdd.SaveChanges(); return(true); } catch (Exception ex) { Logger.mensaje(ex.Message); return(false); } }
public bool Update() { try { DALC.CoffeeBreak c = bdd.CoffeeBreak.Find(this.Numero); Contrato con = new Contrato() { Numero = this.Numero }; con.Read(); if (con.Realizado) { if (c == null) { DALC.Cocktail c**k = bdd.Cocktail.Find(this.Numero); if (c**k == null) { DALC.Cenas cen = bdd.Cenas.Find(this.Numero); bdd.Cenas.Remove(cen); bdd.SaveChanges(); } else { bdd.Cocktail.Remove(c**k); bdd.SaveChanges(); } c = new DALC.CoffeeBreak(); CommonBC.Syncronize(this, c); bdd.CoffeeBreak.Add(c); bdd.SaveChanges(); } CommonBC.Syncronize(this, c); bdd.SaveChanges(); return(true); } else { return(false); } } catch (Exception ex) { Logger.mensaje(ex.Message); return(false); } }
public List <Cliente> ReadAll() { try { List <Cliente> lista_clase_cliente = new List <Cliente>(); List <DALC.Cliente> lista_cliente = bdd.Cliente.ToList(); foreach (DALC.Cliente item in lista_cliente) { Cliente cli = new Cliente(); CommonBC.Syncronize(item, cli); lista_clase_cliente.Add(cli); } return(lista_clase_cliente); } catch (Exception) { return(null); } }
public bool Update() { try { DALC.Contrato con = bdd.Contrato.First(c => c.Numero.Equals(Numero)); if (con.Realizado) { CommonBC.Syncronize(this, con); bdd.SaveChanges(); return(true); } else { return(false); } } catch (Exception ex) { Logger.mensaje(ex.Message); return(false); } }
public bool Read() { try { DALC.Cliente cli = bdd.Cliente.First(c => c.RutCliente.Equals(RutCliente)); CommonBC.Syncronize(cli, this); /*this.RutCliente = cli.RutCliente; * this.RazonSocial = cli.RazonSocial; * this.NombreContacto = cli.NombreContacto; * this.Telefono = cli.Telefono; * this.MailContacto = cli.MailContacto; * this.Direccion = cli.Direccion; * this.IdActividadEmpresa = cli.IdActividadEmpresa; * this.IdTipoEmpresa = cli.IdTipoEmpresa; */ return(true); } catch (Exception ex) { Logger.mensaje(ex.Message); return(false); } }
public bool Create() { try { DALC.Cliente cli = new DALC.Cliente(); /*cli.RutCliente = this.RutCliente; * cli.RazonSocial = this.RazonSocial; * cli.NombreContacto = this.NombreContacto; * cli.MailContacto = this.MailContacto; * cli.Direccion = this.Direccion; * cli.Telefono = this.Telefono; * cli.IdActividadEmpresa = this.IdActividadEmpresa; * cli.IdTipoEmpresa = this.IdTipoEmpresa;*/ CommonBC.Syncronize(this, cli); bdd.Cliente.Add(cli); bdd.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public void RestaurarEventoCache(Memento memento) { EventoSalvar eve = memento.RecuperarEventoCache(); CommonBC.Syncronize(eve, this); }
public void Restaurar(Memento memento) { ContratoSalvar cont = memento.RecuperarContratoCache(); CommonBC.Syncronize(cont, this); }