Beispiel #1
0
 public JsonResult DeleteTemplateCategory()
 {
     try
     {
         NoteTemplateRepository ntRepo = new NoteTemplateRepository();
         ntRepo.Remove(ntRepo.Get(int.Parse(Request.Form["Template"])));
         return(Json(new
         {
             error = "false"
         }));
     }
     catch
     {
         return(Json(new
         {
             error = "true"
         }));
     }
 }
Beispiel #2
0
        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"
                }));
            }
        }