/// <summary> /// 修改工序 /// </summary> /// <param name="processTypeDto"></param> /// <returns></returns> public virtual async Task UpdateProcessType(ProcessTypeDto processTypeDto) { var processType = await Manager.GetByIdAsync(processTypeDto.Id); processTypeDto.MapTo(processType); await Manager.UpdateAsync(processType); }
public async Task <int> CreateAsync(ProcessTypeDto processTypeDto) { var processType = mapper.Map <ProcessType>(processTypeDto); await dbContext.ProcessType.AddAsync(processType); await dbContext.SaveChangesAsync(); return(processType.Id); }
public async Task <bool> UpdateAsync(ProcessTypeDto processTypeDto) { var processType = await dbContext.ProcessType.FirstOrDefaultAsync(pt => pt.Id == processTypeDto.Id); processType.Title = processTypeDto.Title; dbContext.ProcessType.Update(processType); await dbContext.SaveChangesAsync(); return(true); }
public async Task <IActionResult> CreateProcessTypeAsync(CreateProcessTypeViewModel model) { try { ProcessTypeDto processType = new ProcessTypeDto { Title = model.Title }; await processTypeService.CreateAsync(processType); return(RedirectToAction("ProcessTypesList", "ProcessType")); } catch (Exception ex) { ErrorViewModel errorModel = new ErrorViewModel(); errorModel.ErrorMessage = ex.Message.ToString(); return(View("Views/Shared/Error.cshtml", errorModel)); } }
public async Task <bool> UpdateAsync(ProcessTypeDto processTypeDto) { var isUpdated = await litigationPlannerUnitOfWork.ProcessTypeRepository.UpdateAsync(processTypeDto); return(isUpdated); }
public async Task <int> CreateAsync(ProcessTypeDto processTypeDto) { var processTypeId = await litigationPlannerUnitOfWork.ProcessTypeRepository.CreateAsync(processTypeDto); return(processTypeId); }