Esempio n. 1
0
 public ActionResult CreateContact(Category cat)
 {
     if (!ModelState.IsValid)
         return View(cat);
     data.CreateContactCat(cat, (Session["LoggedInUser"] as user).id);
     return RedirectToAction("ListContactCats");
 }
Esempio n. 2
0
        public void CreateAwardCat(Category cat, int p)
        {
            award_categories c = new award_categories
                    {
                        name = cat.Name
                    };

                dbContext.award_categories.Add(c);
                dbContext.SaveChanges();
        }
Esempio n. 3
0
        public Category CreateContactCat(Category cat, int createdBy)
        {
            contact_categories c = new contact_categories
                    {
                        name = cat.Name
                    };

                var newCat = dbContext.contact_categories.Add(c);
                dbContext.SaveChanges();
                cat.Id = newCat.id;
                return cat;
        }
Esempio n. 4
0
 public ActionResult EditAward(Category cat)
 {
     if (!ModelState.IsValid)
         return View(cat);
     data.UpdateAwardCat(cat, (Session["LoggedInUser"] as user).id);
     return RedirectToAction("ListAwardCats");
 }
Esempio n. 5
0
 public void UpdateContactCat(Category cat, int p)
 {
     var c = dbContext.contact_categories.First(x => x.id == cat.Id);
         {
             c.name = cat.Name;
             dbContext.SaveChanges();
         }
 }