using PMS.BusinessModels.Problem; using PMS.Interface; using PMS.Interface.BaseCode; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace PMS.WebUI.Controllers { public class ClassifyManageController : BaseController { IProblemClassfy ProblemClassfy = InterfaceFactory.CreateBusinessInstance(); // GET: ClassifyManage public ActionResult Index() { return View(); } public ActionResult Add_Window() { return View(); } public ActionResult Edit_Window(string id) { ViewBag.ID = id; return View(); } /// /// 获取分类的树形网格 /// /// public ActionResult GetTreeGrid() { var json = ProblemClassfy.GetTreeGrid(GetCurrentUser()); return Content(json, "application/json"); } /// /// 获取分类树形选择项 /// /// public ActionResult GetClassTree() { var json = ProblemClassfy.GetClassTree(GetCurrentUser()); return Content(json, "application/json"); } /// /// 新建问题分类 /// /// public ActionResult Add_Class(ProblemClassModel model) { model.Deatil= model.Deatil.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""); model.ChanelId = GetCurrentUser().CompanyID; var r = ProblemClassfy.AddClass(model); return Content(r?"1":"0"); } /// /// 删除分类 /// /// /// public ActionResult DelClass(string id) { var r = ProblemClassfy.DelClass(id); return Content(r ? "1" : "0"); } /// /// 通过ID获取问题分类 /// /// /// public ActionResult GetProblemClassByID(string id) { var json = ProblemClassfy.GetProblemClassByID(id); return Content(json, "application/json"); } /// /// 修改问题分类 /// /// /// public ActionResult EditClass(ProblemClassModel model) { var r = ProblemClassfy.EditClass(model); return Content(r ? "1" : "0"); } } }