Beispiel #1
0
        public ActionResult singleApp(int id)
        {
            AppPartialViewModel view = new AppPartialViewModel();
            //This controller will be used to show just the selected application in the datatable
            //var accessCheck = _appService.GrabUsersAppIds(User.Identity.Name);
            //var apps = _appService.Grabusersapps(User.Identity.Name);

            var check  = _appService.GrabUsersAppIds(User.Identity.Name);
            var access = check.Contains(id);

            if (access)
            {
                var app = _appService.GrabSingleApp(id, User.Identity.Name);
                AppPartialViewModel vm = new AppPartialViewModel();
                vm.Id            = app.Id;
                vm.Name          = app.Name;
                vm.Description   = app.Description;
                vm.ProductionUrl = app.ProductionUrl;
                vm.TestUrl       = app.TestUrl;
                vm.EndDateTime   = app.EndDateTime;

                return(View(vm));
            }

            return(View(view));
        }
Beispiel #2
0
        public ActionResult Index()
        {
            //this view will be for displaying all of the users applications and reports this view is relient on the ReportsTable patialview



            List <AppPartialViewModel> model = new List <AppPartialViewModel>();

            var apps = _appService.Grabusersapps(User.Identity.Name);


            foreach (var app in apps)
            {
                AppPartialViewModel appmodel = new AppPartialViewModel();
                appmodel.Id            = app.Id;
                appmodel.Name          = app.Name;
                appmodel.Description   = app.Description;
                appmodel.ProductionUrl = app.ProductionUrl;
                appmodel.TestUrl       = app.TestUrl;
                appmodel.EndDateTime   = app.EndDateTime;
                model.Add(appmodel);
            }



            return(View(model));
        }
Beispiel #3
0
        public PartialViewResult AppsDropdown()
        {
            //this partial view is for the _layout dropdown for all of the apps the user has access to

            List <AppPartialViewModel> model = new List <AppPartialViewModel>();
            var apps = _appService.Grabusersapps(User.Identity.Name);

            foreach (var app in apps)
            {
                AppPartialViewModel appmodel = new AppPartialViewModel();
                appmodel.Id   = app.Id;
                appmodel.Name = app.Name;
                model.Add(appmodel);
            }

            return(PartialView("_UserAppsPartial", model));
        }