Exemplo n.º 1
0
        public bool Crear(EN.Toperacion other)
        {
            bool resultado = false;

            try
            {
                //Mapeo de entidad del negocio a la entidad de persistencia
                BR.Toperacion top = new BR.Toperacion(other.placa, other.vencimiento, other.valor);
                //Insert en la bd
                db.Toperacion.Add(top);
                db.SaveChanges();
                resultado = true;
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }
Exemplo n.º 2
0
        public bool Actualizar(EN.Toperacion other)
        {
            bool resultado = false;

            try
            {
                BR.Toperacion update = db.Toperacion.Where(x => x.id == other.id).FirstOrDefault();
                //Update en la bd
                update.placa       = other.placa;
                update.vencimiento = other.vencimiento;
                update.valor       = other.valor;
                db.SaveChanges();
                resultado = true;
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }