public void AC_FunctionService_Update_Test() { var result = _aC_FunctionService.Update(new AC_FunctionModel { ModuleID = 10, FunctionName = "eeee" }); Assert.IsTrue(result.IsValid); }
public ActionResult Create(AC_FunctionModel model) { var opera = string.Empty; if (ModelState.IsValid) { var resultModel = new ResultModel(); if (model.FunctionID != 0) { var result = _aC_FunctionService.Update(model); if (result.Data > 0) { resultModel.IsValid = true; resultModel.Messages = new List <string> { "Change system function success" }; } else { resultModel.IsValid = true; resultModel.Messages = new List <string> { "Change system function failed" }; } opera = string.Format("修改系统功能参数:{0},结果:{1}", JsonConverts.ToJson(model), resultModel.IsValid ? "成功" : "失败"); LogPackage.InserAC_OperateLog(opera, "系统管理--权限管理"); } else { var resut = _aC_FunctionService.Add(model); resultModel.Messages = new List <string> { resut.Data != null ? "Add system function success" : "Add system function failed" }; } return(Json(resultModel, JsonRequestBehavior.AllowGet)); } else { DrowList(null); } return(PartialView(model)); }