12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using CP.Model;
- using NIU.Core;
- using NIU.Core.Log;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace CP.Admin.Controllers
- {
- public class KjhTdkController : AdminBaseController
- {
- // GET: KjhTdk
- public ActionResult Index()
- {
- return View();
- }
- public JsonResult GetList(string ename = "")
- {
- var list = new List<Cz>();
- if (string.IsNullOrWhiteSpace(ename))
- {
- list = CzData.GetCzList();
- }
- else
- {
- list = CzData.SearchByEname(ename);
- }
- return Json(list);
- }
- public ActionResult Edit(int cid)
- {
- var model = CzData.GetByCid(cid);
- return View(model);
- }
- [HttpPost]
- public JsonResult Edit(Cz model)
- {
- var apiResult = new APIResult();
- try
- {
- CzData.UpdateTDK(model);
- }
- catch (Exception ex)
- {
- apiResult.Ret = -1;
- apiResult.Msg = ex.Message;
- if (!(ex is OperationExceptionFacade))
- LogFactory.GetLogger().Log(LogLevel.Error, ex);
- }
- return Json(apiResult);
- }
- }
- }
|