示例#1
0
        public ActionResult AppEdit(API.Common.Model.RegisteredApplication app)
        {
            ViewBag.IsAdmin = true;
            if (ModelState.IsValid)
            {
                app = new RegisteredApplicationManager().UpdateRegisteredApplication(app, null);
                return(RedirectToAction("RegisteredApplications", "Admin"));
            }

            return(View(app));
        }
示例#2
0
        public ActionResult AppEdit(int?id)
        {
            var app    = new API.Common.Model.RegisteredApplication();
            var userId = (int)UserID;

            ViewBag.IsAdmin = true;

            if (id != null)
            {
                using (var appManager = new RegisteredApplicationManager())
                {
                    app = appManager.GetRegisteredApplication((int)id, null);
                }
            }
            else
            {
                app.UserID         = userId;
                app.IsEnabled      = true;
                app.IsWriteEnabled = true;
            }

            return(View("AppEdit", app));
        }