public virtual JsonResult SaveDocuments(string operationNumber)
        {
            ResponseBase response;
            var          jsonDataRequest = PageSerializationHelper.DeserializeJsonForm(Request.Form[0]);
            var          viewModel       = PageSerializationHelper.DeserializeObject <VerDocumentViewModel>(jsonDataRequest.SerializedData);

            ClientFieldDataMapper.UpdateDocumentViewModel(viewModel, jsonDataRequest.ClientFieldData);

            var userName     = IDBContext.Current.UserLoginName;
            var errorMessage = SynchronizationHelper.AccessToResources(
                "edit", VmrGlobalValues.URL_DOCUMENT, operationNumber, userName);

            if (!string.IsNullOrWhiteSpace(errorMessage))
            {
                response = new ResponseBase
                {
                    IsValid      = false,
                    ErrorMessage = errorMessage
                };
            }
            else
            {
                response = _vmrService.SaveDocument(viewModel);
                if (response.IsValid)
                {
                    SynchronizationHelper.TryReleaseLock(
                        VmrGlobalValues.URL_DOCUMENT, operationNumber, userName);
                }
            }

            return(Json(response));
        }
        public virtual JsonResult SaveBasicData(int instanceId, ClientFieldData[] additionalData)
        {
            var additionalFields = ClientFieldDataMapper.SetAdditionalFieldForm(additionalData);
            var request          = new SaveBasicDataRequest
            {
                InstanceId     = instanceId,
                AdditionalData = additionalFields
            };

            var response = _vmrService.SaveBasicData(request);

            return(Json(response));
        }
        public virtual JsonResult SubmitInstance(
            int instanceId, int actionType, ClientFieldData[] additionalData)
        {
            var additionalFields = ClientFieldDataMapper.SetAdditionalFieldForm(additionalData);
            var requestSubmit    = new VmrSubmitRequest
            {
                InstanceId     = instanceId,
                ActionType     = actionType,
                Mode           = SubmitType.MANUAL,
                AdditionalData = additionalFields
            };
            var response = _vmrGenericService.SubmitInstance(requestSubmit);

            return(Json(response));
        }