public ActionResult TemplateSection(TemplateFormSectionBE model) { bool success = false; int id = 0; bool sectionExist = true; TemplateFormSectionBE templateFormSection = FormLogic.FetchTemplateFormSection(model.FormID, model.Section); if (templateFormSection == null) { sectionExist = false; templateFormSection = new TemplateFormSectionBE(); } templateFormSection.FormID = model.FormID; templateFormSection.Section = model.Section.ToUpper(); templateFormSection.Description = model.Description; if (!sectionExist) { success = FormLogic.AddTemplateFormSection(templateFormSection); } else { success = FormLogic.UpdateTemplateFormSection(templateFormSection); } return(Json(new { success, id })); }