Ejemplo n.º 1
0
        public ActionResult AddCategory(string name)
        {
            Advert_Category c = new Advert_Category()
            {
                Name = name,
            };

            db.Advert_Category.Add(c);
            db.SaveChanges();
            return(RedirectToAction("Utils"));
        }
Ejemplo n.º 2
0
 private int getAdvertsCountInCategory(Advert_Category category)
 {
     return(db.Advert.Where(x => x.ACCode == category.ACCode).ToList().Count());
 }