public JsonResult GuidelinesSave(GuidelineManagement obj) { try { if (obj.ID == 0) { obj.CreatedDate = DateTime.Now; _guidline.Insert(obj); _guidline.Save(); TempData["Message"] = string.Format("Guidelines Saved Successfully!!!"); } else { obj.ModifiedDate = DateTime.Now; _guidline.Update(obj); _guidline.Save(); TempData["Message"] = string.Format("Guidelines Updated Successfully!!!"); } } catch (Exception ex) { TempData["Alert"] = string.Format("A server error occurred. Please contact the administrator."); } return(Json(true)); }
/****************************Delete Guidline Page Information under Maintanance Link**********************************/ public JsonResult GuidelinesDelete(int id) { try { GuidelineManagement obj = new GuidelineManagement(); _guidline.Delete(id); _guidline.Save(); TempData["DeleteMessage"] = string.Format("Guideline Deleted Successfully!!!"); } catch (Exception e) { TempData["Alert"] = string.Format("A server error occurred. Please contact the administrator."); } return(Json(true)); }