public async Task <IHttpActionResult> Post(int id, MfrBodyCodeInputModel model) { MfrBodyCode mfrBodyCode = new MfrBodyCode() { Id = model.Id, VehicleToMfrBodyCodeCount = model.VehicleToMfrBodyCodeCount }; CommentsStagingModel comment = new CommentsStagingModel() { Comment = model.Comment, }; var attachments = SetUpAttachmentsModels(model.Attachments); var changeRequestId = await _mfrBodyCodeApplicationService.DeleteAsync(mfrBodyCode, id, CurrentUser.Email, comment, attachments); return(Ok(changeRequestId)); }
public async Task <IHttpActionResult> Post(MfrBodyCodeInputModel model) { MfrBodyCode mfrBodyCode = new MfrBodyCode() { Id = model.Id, Name = model.Name }; CommentsStagingModel comment = new CommentsStagingModel() { Comment = model.Comment }; var attachments = SetUpAttachmentsModels(model.Attachments); var changeRequestId = await _mfrBodyCodeApplicationService.AddAsync(mfrBodyCode, CurrentUser.Email, comment, attachments); return(Ok(changeRequestId)); }
public async Task <IHttpActionResult> Replace(int id, MfrBodyCodeInputModel model) { MfrBodyCode mfrBodyCode = new MfrBodyCode() { Id = model.Id, Name = model.Name, VehicleToMfrBodyCodes = model.VehicleToMfrBodyCodes.Select(item => new VehicleToMfrBodyCode { MfrBodyCodeId = item.MfrBodyCodeId, Id = item.Id, VehicleId = item.VehicleId }).ToList(), }; CommentsStagingModel comment = new CommentsStagingModel { Comment = model.Comment }; var attachments = SetUpAttachmentsModels(model.Attachments); var changeRequestId = await _mfrBodyCodeApplicationService.ReplaceAsync(mfrBodyCode, id, CurrentUser.Email, comment, attachments); return(Ok(changeRequestId)); }