public ActionResult EditSNovelty(SNovelty snovelty) { if (ModelState.IsValid) { SNovelty SNovelty = null; if (snovelty.Id == 0) { SNovelty = snovelty; context.AddSNovelty(SNovelty); } else { SNovelty = context.GetSNoveltyById(snovelty.Id); SNovelty.Name = snovelty.Name; SNovelty.Type = snovelty.Type; SNovelty.htmlcode = snovelty.htmlcode; } context.SaveChanges(); } return RedirectToAction("SNoveltysEditPage"); }
public void RemoveSNovelty(SNovelty snovelty) { SNovelties.Remove(snovelty); SaveChanges(); }
public void AddSNovelty(SNovelty snovelty) { SNovelties.Add(snovelty); SaveChanges(); }