Ejemplo n.º 1
0
        public bool Read()
        {
            bool status = false;

            Dato.OnBreakEntities entidades = new Dato.OnBreakEntities();
            try
            {
                Dato.Cliente datoCliente = entidades.Cliente.First(cli => cli.rut_cliente == rut_cliente);
                datoCliente.GetType().GetProperties();
                CommonBC.Sincronyze(datoCliente, this);
                status = true;
            }
            catch (Exception)
            {
                status = false;
            }
            return(status);
        }
Ejemplo n.º 2
0
        public bool Update()
        {
            OnBreakEntities entidades = new OnBreakEntities();

            Dato.Cliente datoCliente = new Dato.Cliente();
            //Obejto tipo entidad Cliente.
            try
            {
                datoCliente = entidades.Cliente.First(cli => cli.rut_cliente == rut_cliente);
                CommonBC.Sincronyze(this, datoCliente);
                entidades.SaveChanges();
                return(true);
            }
            catch (MetadataException ex)
            {
                entidades.Cliente.Remove(datoCliente);
                Console.Write(ex);
                return(false);
            }
        }
Ejemplo n.º 3
0
        public bool Create()
        {
            //Objeto tipo Modelo de Entidades.
            Dato.Cliente    datoCliente = new Dato.Cliente();
            OnBreakEntities entidades   = new OnBreakEntities();

            //Obejto tipo entidad Cliente.
            try
            {
                CommonBC.Sincronyze(this, datoCliente);

                entidades.Cliente.Add(datoCliente);
                entidades.SaveChanges();
                return(true);
            }
            catch (MetadataException ex)
            {
                entidades.Cliente.Remove(datoCliente);
                Console.Write(ex);
                return(false);
            }
        }