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
            }));
        }
Example #3
0
        /// <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));
        }
Example #4
0
        public async Task <IActionResult> Update([FromBody] LecturerVM value)
        {
            var result = await _courseService.Update(value);

            return(Ok(result));
        }
Example #5
0
 /// <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));
 }