Ejemplo n.º 1
0
        public ActionResult AppEdit(RegisteredApplication app)
        {
            if (ModelState.IsValid)
            {
                app = new RegisteredApplicationManager().UpdateRegisteredApplication(app, UserID);
                return(RedirectToAction("Applications", "Profile"));
            }

            return(View(app));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> RegisteredApplications(string sortOrder, string keyword, int pageIndex = 1, int pageSize = 50)
        {
            ViewData["keyword"]   = keyword;
            ViewData["sortorder"] = sortOrder;
            using (var appManager = new RegisteredApplicationManager())
            {
                PaginatedCollection <API.Common.Model.RegisteredApplication> list = await appManager.Search(sortOrder, keyword, pageIndex, pageSize);

                return(View(list));
            }
        }
Ejemplo n.º 4
0
        public async Task <ActionResult> Applications()
        {
            UserManager userManager = new UserManager();

            var user = userManager.GetUser((int)UserID);

            ViewBag.UserProfile = user;

            using (var apps = new RegisteredApplicationManager())
            {
                var summary = new ApplicationSummary();
                summary.RegisteredApplications = (await apps.Search(null, null, 1, 500, user.ID)).ToList();
                summary.AuthorizedApplications = apps.GetUserAuthorizedApplications(user.ID);
                return(View(summary));
            }
        }
Ejemplo n.º 5
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"));
        }
Ejemplo n.º 6
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));
        }