Exemplo n.º 1
0
        public ActionResult Create(string org, string service, string edition, ViewMetadata view)
        {
            if (!ModelState.IsValid)
            {
                return(View(view));
            }

            bool viewCreated = _viewRepository.CreateView(org, service, edition, view);

            if (viewCreated)
            {
                Save(org, service, edition, view.Name, string.Empty);
                IList <ViewMetadata> allViewsMetadata = _viewRepository.GetViews(org, service, edition);
                _repository.AddViewNameTextResource(org, service, edition, allViewsMetadata);

                return(RedirectToAction("Edit", new { org, service, edition, id = view.Name }));
            }

            ViewBag.viewNameAlreadyExists = true;
            return(View());
        }