Exemple #1
0
        public bool ReadRazon()
        {
            try
            {
                DALC.Clientes clientes = (from a in db.Clientes
                                          where a.RazonSocial.Equals(this.RazonSocial)
                                          select a).First();


                this.RazonSocial         = clientes.RazonSocial;
                this.RutEmpresa          = clientes.RutEmpresa;
                this.Giro                = clientes.Giro;
                this.Direccion           = clientes.Direccion;
                this.TelefonoContacto    = clientes.TelefonoContacto;
                this.IdCiudad            = clientes.IdCiudad;
                this.IdComuna            = clientes.IdComuna;
                this.IdTipoPago          = clientes.IdTipoPago;
                this.IdContactoComercial = clientes.IdContactoComercial;

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemple #2
0
        public bool Read()
        {
            try
            {
                DALC.Clientes clientes = db.Clientes.Find(this.RutEmpresa);

                this.RutEmpresa          = clientes.RutEmpresa;
                this.RazonSocial         = clientes.RazonSocial;
                this.Giro                = clientes.Giro;
                this.Direccion           = clientes.Direccion;
                this.TelefonoContacto    = clientes.TelefonoContacto;
                this.IdTipoPago          = clientes.IdTipoPago;
                this.IdContactoComercial = clientes.IdContactoComercial;
                this.Condicion           = clientes.Condicion;
                this.LineaCredito        = clientes.LineaDeCredito;
                this.Dicom               = clientes.Dicom;
                this.Observacion         = clientes.Observacion;
                this.FechaActualizacion  = clientes.FechaDeActualizacion;
                this.FechaIngreso        = clientes.FechaIngreso;
                this.IdCiudad            = clientes.IdCiudad;
                this.IdComuna            = clientes.IdComuna;

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemple #3
0
        public bool Update()
        {
            try
            {
                DALC.Clientes clientes = db.Clientes.Find(this.RutEmpresa);

                clientes.RutEmpresa          = this.RutEmpresa;
                clientes.RazonSocial         = this.RazonSocial;
                clientes.Giro                = this.Giro;
                clientes.Direccion           = this.Direccion;
                clientes.TelefonoContacto    = this.TelefonoContacto;
                clientes.IdCiudad            = this.IdCiudad;
                clientes.IdComuna            = this.IdComuna;
                clientes.IdTipoPago          = this.IdTipoPago;
                clientes.IdContactoComercial = this.IdTipoPago;

                db.Entry(clientes).State = System.Data.EntityState.Modified;

                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemple #4
0
        public bool Create()
        {
            try
            {
                DALC.Clientes clientes = new DALC.Clientes();
                clientes.RutEmpresa           = this.RutEmpresa;
                clientes.RazonSocial          = this.RazonSocial;
                clientes.Giro                 = this.Giro;
                clientes.Direccion            = this.Direccion;
                clientes.TelefonoContacto     = this.TelefonoContacto;
                clientes.IdTipoPago           = this.IdTipoPago;
                clientes.IdContactoComercial  = this.IdContactoComercial;
                clientes.Condicion            = this.Condicion;
                clientes.LineaDeCredito       = this.LineaCredito;
                clientes.Dicom                = this.Dicom;
                clientes.Observacion          = this.Observacion;
                clientes.FechaDeActualizacion = this.FechaActualizacion;
                clientes.FechaIngreso         = this.FechaIngreso;
                clientes.IdCiudad             = this.IdCiudad;
                clientes.IdComuna             = this.IdComuna;

                db.Clientes.Add(clientes);

                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemple #5
0
        public bool Delete()
        {
            try
            {
                DALC.Clientes clientes = db.Clientes.Find(this.RutEmpresa);

                db.Clientes.Remove(clientes);
                db.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }