Example #1
0
        public async Task <IHttpActionResult> Put(int id, VehicleToDriveTypeInputModel model)
        {
            var changeRequestId = await _vehicleToDriveTypeApplicationService.UpdateAsync(new VehicleToDriveType()
            {
                Id          = model.Id,
                VehicleId   = model.Vehicle.Id,
                DriveTypeId = model.DriveType.Id
            }, id, CurrentUser.Email);

            return(Ok(changeRequestId));
        }
Example #2
0
        public async Task <IHttpActionResult> Post(int id, VehicleToDriveTypeInputModel vehicleToDriveTypeInputModel)
        {
            CommentsStagingModel comment = new CommentsStagingModel()
            {
                Comment = vehicleToDriveTypeInputModel.Comment
            };
            var attachments     = SetUpAttachmentsModels(vehicleToDriveTypeInputModel.Attachments);
            var changeRequestId = await _vehicleToDriveTypeApplicationService.DeleteAsync(null, id, CurrentUser.Email, comment, attachments);

            return(Ok(changeRequestId));
        }
Example #3
0
        public async Task <IHttpActionResult> Post(VehicleToDriveTypeInputModel model)
        {
            CommentsStagingModel comment = new CommentsStagingModel()
            {
                Comment = model.Comment
            };
            var attachments     = SetUpAttachmentsModels(model.Attachments);
            var changeRequestId = await _vehicleToDriveTypeApplicationService.AddAsync(new VehicleToDriveType()
            {
                Id          = model.Id,
                DriveTypeId = model.DriveType.Id,
                VehicleId   = model.Vehicle.Id
            }, CurrentUser.Email, comment, attachments);

            return(Ok(changeRequestId));
        }