Beispiel #1
0
        public virtual ActionResult Index(PageCreateModel p)
        {
            ViewData["p"] = p;
            if (!ModelState.IsValid)
            {
                return(View(Pages.All().WithDocuments()));
            }

            var x = p.CreatePage();

            try
            {
                Pages.Save(x);
                return(this.RedirectToAction(c => c.Edit(x.Document.Id)));
            }
            catch (Exception ex)
            {
                Notifier.Notify(ex);
                return(View(Pages.All().WithDocuments()));
            }
        }
 private void OnPagePropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     this.IsFinishEnabled = Pages.All(page => !page.HasErrors);
     this.IsNextEnabled   = false;
 }
Beispiel #3
0
        public virtual ActionResult Index()
        {
            var pages = Pages.All().WithDocuments().ToArray();

            return(View(pages));
        }
Beispiel #4
0
 private void OnPagePropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     IsFinishEnabled = Pages.All(page => !page.HasErrors);
     IsNextEnabled   = !Pages.First(page => page.IsSelected).HasErrors&& Pages.Count > 1;
 }