Exemplo 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");
 }
Exemplo 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();
        }
Exemplo 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;
        }
Exemplo 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");
 }
Exemplo 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();
         }
 }