コード例 #1
0
        public ActionResult AppGenerateNewKey(int?id)
        {
            var userId = (int)UserID;

            if (id != null)
            {
                using (var appManager = new RegisteredApplicationManager())
                {
                    var app = appManager.GetRegisteredApplication((int)id, userId);

                    if (app != null)
                    {
                        app = appManager.GenerateNewAPIKey((int)id, userId);
                    }
                }
            }

            return(RedirectToAction("Applications"));
        }
コード例 #2
0
        public ActionResult AppEdit(int?id)
        {
            var app    = new RegisteredApplication();
            var userId = (int)UserID;

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

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