Esempio n. 1
0
        /// <summary>
        /// Handles create website form submission.
        /// </summary>
        /// <param name="viewModel">View model containing new website details.</param>
        /// <returns>View model indicating whether or not action was successful.</returns>
        public WebViewModel PostCreateViewModel(WebViewModel viewModel)
        {
            // Get website details
            Web  web = _webConverter.GetModel(viewModel);
            long templateTenantId = Convert.ToInt64(viewModel.Template.Value);

            // Try to do the create
            try
            {
                _webService.Create(templateTenantId, web);
            }
            catch (ValidationErrorException)
            {
            }

            // Return form state
            return(viewModel);
        }