Esempio n. 1
0
        public bool Delete()
        {
            try
            {
                LOG_PRECIO log = CommonBC.DBConexion.LOG_PRECIO.First(l => l.ID == this.Id);
                CommonBC.DBConexion.LOG_PRECIO.Remove(log);
                CommonBC.DBConexion.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 2
0
        public bool Read()
        {
            try
            {
                LOG_PRECIO log = CommonBC.DBConexion.LOG_PRECIO.First(l => l.ID == this.Id);
                this.Fecha         = log.FECHA;
                this.PrecioAntiguo = (int)log.PRECIO_ANTIGUO;
                this.PrecioNuevo   = (int)log.PRECIO_NUEVO;

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 3
0
        public bool Update()
        {
            try
            {
                LOG_PRECIO log = CommonBC.DBConexion.LOG_PRECIO.First(l => l.ID == this.Id);
                log.FECHA          = this.Fecha;
                log.PRECIO_ANTIGUO = this.PrecioAntiguo;
                log.PRECIO_NUEVO   = this.PrecioNuevo;
                CommonBC.DBConexion.Entry(log).State = System.Data.EntityState.Modified;
                CommonBC.DBConexion.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 4
0
        public bool Create()
        {
            try
            {
                LOG_PRECIO log = new LOG_PRECIO();
                log.ID             = this.Id;
                log.FECHA          = this.Fecha;
                log.PRECIO_ANTIGUO = this.PrecioAntiguo;
                log.PRECIO_NUEVO   = this.PrecioNuevo;
                CommonBC.DBConexion.LOG_PRECIO.Add(log);
                CommonBC.DBConexion.SaveChanges();

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