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

            return(Ok(changeRequestId));
        }
예제 #2
0
        public async Task <IHttpActionResult> Put(int id, BodyTypeInputModel bodyTypeInputModel)
        {
            BodyType bodyType = new BodyType()
            {
                Id   = bodyTypeInputModel.Id,
                Name = bodyTypeInputModel.Name,
                BodyStyleConfigCount          = bodyTypeInputModel.BodyStyleConfigCount,
                VehicleToBodyStyleConfigCount = bodyTypeInputModel.VehicleToBodyStyleConfigCount
            };
            CommentsStagingModel comment = new CommentsStagingModel()
            {
                Comment = bodyTypeInputModel.Comment
            };
            var attachments     = SetUpAttachmentsModels(bodyTypeInputModel.Attachments);
            var changeRequestId = await _bodyTypeApplicationService.UpdateAsync(bodyType, bodyType.Id, CurrentUser.Email, comment, attachments);

            return(Ok(changeRequestId));
        }