public ActionResult ClassesManageCreate(int cId = 0) { var model = new GetClassesInfoForEditOutput(); if (cId > 0) { model = classesinfoService.GetClassesInfoForEdit(new NullableIdDto <long> { Id = cId }); } return(View("ClassesManage/Create", model.ClassesInfo)); }
/// <summary> /// 通过Id获取班级信息进行编辑或修改 /// </summary> public GetClassesInfoForEditOutput GetClassesInfoForEdit(NullableIdDto <long> input) { var output = new GetClassesInfoForEditOutput(); ClassesInfoEditDto classesInfoEditDto; if (input.Id.HasValue) { var entity = _classesInfoRepository.Get(input.Id.Value); classesInfoEditDto = entity.MapTo <ClassesInfoEditDto>(); } else { classesInfoEditDto = new ClassesInfoEditDto(); } output.ClassesInfo = classesInfoEditDto; return(output); }