Exemplo n.º 1
0
        public async Task <IActionResult> ChangeUserRole(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var UserData = await _context.UserData
                           .FirstOrDefaultAsync(m => m.Id == id);

            if (UserData == null)
            {
                return(NotFound());
            }

            var IdentRole = await _context.IdentRole
                            .FirstOrDefaultAsync(m => m.Id == id);

            if (UserData == null)
            {
                return(NotFound());
            }

            var val = await _context.IdentRole
                      .FirstOrDefaultAsync();


            //System.Diagnostics.Debug.WriteLine(roleManager.Roles);


            var CurrentRole = await _userManager.GetRolesAsync(UserData);

            this.currentID = id;

            System.Diagnostics.Debug.WriteLine("here yo");
            UserSpecs specs = new UserSpecs();

            specs.AvailableRoles = _roleManager.Roles.ToList();
            specs.CurrentRole    = CurrentRole.ToList();
            var modelCollection = new ModelContainer();

            modelCollection.AddModel(UserData);
            modelCollection.AddModel(specs);
            return(View(modelCollection));
        }
Exemplo n.º 2
0
        // GET: BidsNewViewModels/Create
        public ActionResult Create()
        {
            Bids           Bid  = new Bids();
            ModelContainer cont = new ModelContainer();

            cont.AddModel(Bid);

            return(View(cont));
        }
Exemplo n.º 3
0
        // GET: BidsNewViewModels/Create
        public ActionResult Create()
        {
            Auctions       auction = new Auctions();
            ModelContainer cont    = new ModelContainer();

            cont.AddModel(auction);

            return(View(cont));
        }
Exemplo n.º 4
0
        // GET: AuctionPageViewModels
        public ActionResult Index(string id)
        {
            //db = new AuctionPageContext();
            var            it   = db.auctions.auctions.Where(x => x.Id == id).FirstOrDefault();
            var            vm   = new AuctionPageViewModel(it);
            ModelContainer cont = new ModelContainer();

            cont.AddModel(vm);
            return(View(cont));
        }
        // GET: AuctionListViewModels
        public ActionResult Index()
        {
            SortProperties sp = new SortProperties()
            {
                id = "1",
            };

            db = new AuctionListContext(sp, Enums.paramTypeForAuctionList.byCategories);
            var            AuctionList = db.AuctionListView;
            ModelContainer cont        = new ModelContainer();

            cont.AddModel(AuctionList);
            return(View(cont));
        }
Exemplo n.º 6
0
        public void LoadModelFormat(IModelSceneFormat resourceFormat)
        {
            var resource = resourceFormat.ToGeneric();

            if (ResourceFormats.Contains(resourceFormat))
            {
                activeModelCB.SelectedItem = resource.Name;
                return;
            }

            ResourceFormats.Add(resourceFormat);

            var container = new ModelContainer();

            container.AddModel(resourceFormat);
            Runtime.ModelContainers.Add(container);
            ModelContainers.Add(container);

            var drawableContainer = new DrawContainer();

            drawableContainer.Name = resource.Name;
            var drawable = new GenericModelRender(resourceFormat.Renderer);

            drawableContainer.Drawables.Add(drawable);
            foreach (var model in resource.Models)
            {
                var skeleton = new GenericSkeletonRenderer(model.Skeleton);
                drawableContainer.Drawables.Add(skeleton);
            }
            Containers.Add(drawableContainer);

            if (Viewport3D.Scene != null)
            {
                ReloadScene();
            }

            activeModelCB.Items.Add(resource.Name);
            activeModelCB.SelectedItem = resource.Name;
        }