public string GetModel(ConvertServiceRequest request)
 {
     if (!string.IsNullOrEmpty(request.Data))
     {
         _viewModel = CommonUtils.JsonDeserialize<AdminDetailViewModel>(request.Data);
         try
         {
             Save(request);
             _viewModel.SetSuccessMessage("Authorize.Net Settings Successfully Saved");
         }
         catch (Exception ex)
         {
             _viewModel.SetErrorMessage("<strong>There was an error while trying to process the request</strong><br />" + ex.Message);
             return CommonUtils.JsonSerialize(_viewModel);
         }
     }
     else
     {
         CreateInitialViewModel(request);
         LoadPage(request);
     }
     return CommonUtils.JsonSerialize(_viewModel);
 }
        private string GetModel(ConvertServiceRequest request)
        {
            if (!string.IsNullOrEmpty(request.Data))
            {
                _viewModel = CommonUtils.JsonDeserialize<AdminDetailViewModel>(request.Data);

                try
                {
                    var command = string.Empty;

                    if (request.Parameters.ContainsKey("Command"))
                        command = request.Parameters["Command"];

                    if (command.Equals("UpgradeInstance"))
                    {
                        UpgradeInstance();
                    }
                    else if (_serviceInstanceId == 0)
                    {
                        Save();
                        CreateInitialViewModel();
                        _viewModel.SetSuccessMessage("Service Instance Successfully Created");
                    }
                }
                catch (Exception ex)
                {
                    _viewModel.SetErrorMessage("<strong>There was an error while trying to process the request</strong><br />" + ex.Message);
                    return CommonUtils.JsonSerialize(_viewModel);
                }
            }
            else
            {
                CreateInitialViewModel();
            }

            LoadPage();

            return CommonUtils.JsonSerialize(_viewModel);
        }