Ejemplo n.º 1
0
        public ActionResult Access(AccessEditModel am)
        {
            if (am.Access.IsNew)
            {
                ViewBag.Title = Piranha.Resources.Settings.EditTitleNewAccess;
            }
            else
            {
                ViewBag.Title = Piranha.Resources.Settings.EditTitleExistingAccess;
            }

            if (ModelState.IsValid)
            {
                try {
                    if (am.SaveAll())
                    {
                        ModelState.Clear();
                        ViewBag.Title = Piranha.Resources.Settings.EditTitleExistingAccess;
                        SuccessMessage(Piranha.Resources.Settings.MessageAccessSaved);
                    }
                    else
                    {
                        ErrorMessage(Piranha.Resources.Settings.MessageAccessNotSaved);
                    }
                } catch (Exception e) {
                    ErrorMessage(e.ToString());
                }
            }
            return(View(@"~/Areas/Manager/Views/Settings/Access.cshtml", am));
        }
Ejemplo n.º 2
0
 public ActionResult Access(string id)
 {
     if (!String.IsNullOrEmpty(id))
     {
         ViewBag.Title = Piranha.Resources.Settings.EditTitleExistingAccess;
         return(View(@"~/Areas/Manager/Views/Settings/Access.cshtml", AccessEditModel.GetById(new Guid(id))));
     }
     else
     {
         ViewBag.Title = Piranha.Resources.Settings.EditTitleNewAccess;
         return(View(@"~/Areas/Manager/Views/Settings/Access.cshtml", new AccessEditModel()));
     }
 }
Ejemplo n.º 3
0
        public ActionResult DeleteAccess(string id)
        {
            AccessEditModel am = AccessEditModel.GetById(new Guid(id));

            ViewBag.SelectedTab = "access";
            if (am.DeleteAll())
            {
                SuccessMessage(Piranha.Resources.Settings.MessageAccessDeleted);
            }
            else
            {
                ErrorMessage(Piranha.Resources.Settings.MessageAccessNotDeleted);
            }

            return(AccessList());
        }