Esempio n. 1
0
        public bool Crear(EN.Tecnomecanica other)
        {
            bool resultado = false;

            try
            {
                //Mapeo de EN a BR
                BR.Tecnomecanica tec = new BR.Tecnomecanica(other.placa, other.expedicion, other.vencimiento, other.valor);
                //Insert en la bd
                db.Tecnomecanica.Add(tec);
                db.SaveChanges();
                resultado = true;
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }
Esempio n. 2
0
        public bool Actualizar(EN.Tecnomecanica other)
        {
            bool resultado = false;

            try
            {
                BR.Tecnomecanica update = db.Tecnomecanica.Where(x => x.id == other.id).FirstOrDefault();
                update.expedicion  = other.expedicion;
                update.placa       = other.placa;
                update.valor       = other.valor;
                update.vencimiento = other.vencimiento;
                db.SaveChanges();
                resultado = true;
            }
            catch (Exception)
            {
                throw;
            }
            return(resultado);
        }