Пример #1
0
        public static void deleteFactor(int id)
        {
            Factor fact = new Factor();

            using (adminproyectosEntities db = new adminproyectosEntities())
            {
                var query = (from al in db.Factor
                             where al.idFactor == id
                             select al).Single();
                db.Factor.Remove(query);
                db.SaveChanges();
            }
        }
Пример #2
0
        public static Factor CreateFactor(Factor fact)
        {
            Factor factor = new Factor();

            using (adminproyectosEntities db = new adminproyectosEntities())
            {
                factor.nombre  = fact.nombre;
                factor.detalle = fact.detalle;
                factor.estado  = fact.estado;

                db.Factor.Add(factor);
                db.SaveChanges();
            }
            return(factor);
        }
Пример #3
0
        public static Factor UpdateFactor(Factor fact)
        {
            using (adminproyectosEntities db = new adminproyectosEntities())
            {
                var query = (from al in db.Factor
                             where al.idFactor == fact.idFactor
                             select al).Single();

                query.nombre  = fact.nombre;
                query.detalle = fact.detalle;
                query.estado  = fact.estado;

                db.SaveChanges();
            }
            return(fact);
        }