/// <summary> /// Adds a NoteTemplateCategory to the Repository. /// </summary> /// <param name="entity">The NoteTemplateCategory to add to the Repository.</param> public void Add(NoteTemplateCategory entity) { Session.Save(entity); }
/// <summary> /// Removes a NoteTemplateCategory from the Repository. /// </summary> /// <param name="entity">The NoteTemplateCategory to remove from the Repository.</param> public void Remove(NoteTemplateCategory entity) { Session.Delete(entity); }
public JsonResult AddTemplateCategory() { try { NoteTemplateRepository ntRepo = new NoteTemplateRepository(); NoteTemplateCategory ntCategory = new NoteTemplateCategory(); ntCategory.Name = Request.Form["Template"]; ntRepo.Add(ntCategory); return Json(new { ID = ntCategory.Id, Name = ntCategory.Name, error = "false" }); } catch { return Json(new { error = "true" }); } }