Example #1
0
        public QuestionBuilder()
        {
            this.InitializeComponent();
            MultpleChoices = new List <string>();

            FormQuestionViewModel = new FormQuestionViewModel();
            dropDownItems         = new DropDownItems();

            //TODO: load from database
            dropDownItems.AddItem("image", "Afbeelding");
            dropDownItems.AddItem("multiple_choice", "Meerkeuze");
            dropDownItems.AddItem("open", "Open Vraag");
        }
Example #2
0
        public UsersEdit()
        {
            this.InitializeComponent();

            this.UserViewModel = new UserViewModel();
            this.dropDownItems = new DropDownItems();

            PageHelper.DoAsync(overlay, Dispatcher, () =>
            {
                UnitOfWork unitOfWork = new UnitOfWork();
                var roles             = unitOfWork.UserRoleRepository.Get();

                foreach (var role in roles)
                {
                    PageHelper.MainUI(Dispatcher, () =>
                    {
                        dropDownItems.AddItem(role.Role, role.Role.Substring(0, 1).ToUpper() + role.Role.Substring(1, role.Role.Length - 1).ToLower());
                    });
                }

                User dbUser     = unitOfWork.UserRepository.Get(u => u.Id == this._userId).First();
                dbUser.Location = unitOfWork.LocationRepository.Get(l => l.Id == dbUser.LocationId).First();

                PageHelper.MainUI(Dispatcher, () =>
                {
                    this.UserViewModel          = new UserViewModel(dbUser);
                    this.UserViewModel.UserRole = this.UserViewModel.UserRole;
                    this.Bindings.Update();
                });

                unitOfWork.Dispose();
            });
        }
Example #3
0
        public EventCreate()
        {
            this.InitializeComponent();

            this.EventViewModel        = new EventViewModel();
            this.dropDownItemsCustomer = new DropDownItems();

            PageHelper.DoAsync(overlay, Dispatcher, () =>
            {
                this.EventViewModel.LoadCustomers();

                this.EventViewModel.Customers.ForEach(customer =>
                {
                    PageHelper.MainUI(Dispatcher, () =>
                    {
                        dropDownItemsCustomer.AddItem(customer.Id, customer.Name.Substring(0, 1).ToUpper() + customer.Name.Substring(1, customer.Name.Length - 1).ToLower());
                    });
                });
            });
        }
Example #4
0
        public UserCreate()
        {
            this.InitializeComponent();

            this.UserViewModel = new UserViewModel();
            this.dropDownItems = new DropDownItems();

            PageHelper.DoAsync(overlay, Dispatcher, () =>
            {
                this.UserViewModel.LoadRoles();

                this.UserViewModel.Roles.ForEach(role =>
                {
                    PageHelper.MainUI(Dispatcher, () =>
                    {
                        dropDownItems.AddItem(role.Role, role.Role.Substring(0, 1).ToUpper() + role.Role.Substring(1, role.Role.Length - 1).ToLower());
                    });
                });
            });
        }
Example #5
0
        public UsersCreate()
        {
            this.InitializeComponent();

            this.UserViewModel = new UserViewModel();
            this.dropDownItems = new DropDownItems();

            PageHelper.DoAsync(overlay, Dispatcher, () =>
            {
                UnitOfWork unitOfWork = new UnitOfWork();
                var roles             = unitOfWork.UserRoleRepository.Get();

                foreach (var role in roles)
                {
                    PageHelper.MainUI(Dispatcher, () =>
                    {
                        dropDownItems.AddItem(role.Role, role.Role.Substring(0, 1).ToUpper() + role.Role.Substring(1, role.Role.Length - 1).ToLower());
                    });
                }
            });
        }