示例#1
0
        //probar metodo
        public bool EliminarDescuento()
        {
            try
            {
                DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities();
                DALC.DESCUENTO          des = ctx.DESCUENTO.First(d => d.ID_DESCUENTO == IdDescuento);

                ctx.Entry(des).State = System.Data.EntityState.Deleted;
                ctx.SaveChanges();
                ctx = null;

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
示例#2
0
        //probar metodo
        public bool ActualizarDescuento()
        {
            try
            {
                DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities();
                DALC.DESCUENTO          des = ctx.DESCUENTO.First(d => d.ID_DESCUENTO == IdDescuento);

                des.MIN_PUNTOS = this.MinPuntos;
                des.MAX_PUNTOS = this.MaxPuntos;
                des.PORCENTAJE = this.Porcentaje;
                des.TOPE       = this.Tope;

                ctx.SaveChanges();
                ctx = null;

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