public async Task <LecturerNotification> Update(LecturerVM lecturerVM) { return(await _mediator.Send(new LecturerUpdateCommand() { lecturer = _mapper.Map <LecturerModel>(lecturerVM) })); }
public async Task <LecturerNotification> Add(LecturerVM lecturer) { var entity = _mapper.Map <LecturerModel>(lecturer); return(await _mediator.Send(new LecturerCreateCommand() { lecturer = entity })); }
/// <summary> /// 列表 /// </summary> /// <param name="_LecturerVM"></param> /// <param name="pn"></param> /// <returns></returns> public ActionResult List(LecturerVM _LecturerVM, int pn = 1) { int totalCount, pageIndex = pn, pageSize = PagingConfig.PAGE_SIZE; var list = _LecturerService.GetManagerList(_LecturerVM.QueryName, pageIndex, pageSize, out totalCount); var paging = new Paging <Lecturer>() { Items = list, Size = PagingConfig.PAGE_SIZE, Total = totalCount, Index = pn, }; _LecturerVM.Paging = paging; return(View(_LecturerVM)); }
public async Task <IActionResult> Update([FromBody] LecturerVM value) { var result = await _courseService.Update(value); return(Ok(result)); }
/// <summary> /// 编辑 /// </summary> /// <param name="_LecturerVM"></param> /// <returns></returns> public ActionResult Edit(LecturerVM _LecturerVM) { _LecturerVM.Lecturer = _LecturerService.GetById(_LecturerVM.Id) ?? new Lecturer(); _LecturerVM.ImgInfo = _imageInfoService.GetById(_LecturerVM.Lecturer.ImageInfoId) ?? new ImageInfo(); return(View(_LecturerVM)); }