예제 #1
0
        public async Task <IHttpActionResult> Post(int id, EngineVinInputModel model)
        {
            EngineVin EngineVin = new EngineVin()
            {
                Id = model.Id, EngineVinName = model.EngineVinName
            };
            CommentsStagingModel comment = new CommentsStagingModel()
            {
                Comment = model.Comment
            };
            var attachments     = SetUpAttachmentsModels(model.Attachments);
            var changeRequestId = await _EngineVinApplicationService.DeleteAsync(EngineVin, id, CurrentUser.Email, comment, attachments);

            return(Ok(changeRequestId));
        }
예제 #2
0
        public async Task <IHttpActionResult> Put(int id, EngineVinInputModel EngineVinInputModel)
        {
            EngineVin EngineVin = new EngineVin()
            {
                Id                         = id,
                EngineVinName              = EngineVinInputModel.EngineVinName,
                EngineConfigCount          = EngineVinInputModel.EngineConfigCount,
                VehicleToEngineConfigCount = EngineVinInputModel.VehicleToEngineConfigCount
            };
            CommentsStagingModel comment = new CommentsStagingModel()
            {
                Comment = EngineVinInputModel.Comment
            };
            var attachments     = SetUpAttachmentsModels(EngineVinInputModel.Attachments);
            var changeRequestId = await _EngineVinApplicationService.UpdateAsync(EngineVin, EngineVin.Id, CurrentUser.Email, comment, attachments);

            return(Ok(changeRequestId));
        }