public void AC_DepartmentService_GetAC_DepartmentById_Test() { var resultModel = _acDepartmentService.GetAC_DepartmentById(2); var test = resultModel.Data.ToEntity(); Assert.IsTrue(test != null); Assert.IsTrue(resultModel.Data.ID == 2); }
/// <summary> /// 添加、编辑部门 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Create(int?id) { AC_DepartmentModel model = null; if (id.HasValue) { var result = _ACDepartmentService.GetAC_DepartmentById(id.Value); if (result.Data != null) { model = result.Data; } } if (model == null) { model = new AC_DepartmentModel(); model.IsActive = 1; } return(PartialView(model)); }