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 ex) { Logger.mensaje(ex.Message); return(false); } }
public bool Grabar() { try { Biblioteca.DALC.Cliente Cli; Cli = new DALC.Cliente(); Cli.RutCliente = this.RutCliente; Cli.Nombres = this.Nombres; Cli.Apellidos = this.Apellidos; Cli.FechaNacimiento = this.FechaNacimiento; Cli.IdSexo = this.IdSexo; Cli.IdEstadoCivil = this.IdEstadoCivil; Entidades.Cliente.Add(Cli); Entidades.SaveChanges(); return(true); } 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); return(true); } catch (Exception) { return(false); } }
public bool Delete() { try { DALC.Cliente cliente = CommonBC.ModeloDecortex.Cliente.First(v => v.Codigo == Codigo); CommonBC.ModeloDecortex.Cliente.Remove(cliente); CommonBC.ModeloDecortex.SaveChanges(); return(true); } catch (Exception) { 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 Delete() { try { DALC.Cliente cli = bdd.Cliente.First(c => c.RutCliente.Equals(this.RutCliente)); bdd.Cliente.Remove(cli); bdd.SaveChanges(); return(true); } catch (Exception) { return(false); } }
//metodos public bool Crear()//CON EL CommonBC { try { Biblioteca.DALC.Cliente Cli; Cli = new DALC.Cliente(); CommonBC.Syncronize(this, Cli); Entidades.Cliente.Add(Cli); Entidades.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Update() { try { DALC.Cliente cliente = CommonBC.ModeloDecortex.Cliente.First(v => v.Codigo == Codigo); cliente.Correo = Correo; cliente.Direccion = Direccion; cliente.Nombre = Nombre; cliente.Telefono = Telefono; cliente.Especificaciones = Especificaciones; CommonBC.ModeloDecortex.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Create() { try { DALC.Cliente cliente = new DALC.Cliente(); cliente.Correo = Correo; cliente.Direccion = Direccion; cliente.Nombre = Nombre; cliente.Telefono = Telefono; cliente.Especificaciones = Especificaciones; CommonBC.ModeloDecortex.Cliente.Add(cliente); CommonBC.ModeloDecortex.SaveChanges(); return(true); } catch (Exception) { 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); } }