Exemplo n.º 1
0
        public void WhenAuthenticated(UserModel model)
        {
            MVCHISSession.Instance.CurrentUser = model;

            string   prev = "";
            TreeNode node = null;

            foreach (var stuple in CntrlUS.GetMenu(model).OrderBy(x => x.Item1))
            {
                var egn = stuple.Item1.FromCamelCaseToWords();
                if (prev.Equals(egn) == false)
                {
                    node           = this.treeViewMenu.Nodes.Add(egn);
                    node.ForeColor = Color.Red;
                    menu[egn]      = new List <TreeNode>();
                    prev           = egn;
                }
                TreeNode child = node.Nodes.Add(stuple.Item2.FromCamelCaseToWords());
                child.Tag = stuple.Item3;
                menu[egn].Add(child);
            }

            MVCHISSession.Instance.UserEntitlements = CntrlPE.Read(new ProfileEntitlementModel {
                ProfileId = model.ProfileId
            }, "ProfileId");
            tsslCurrentUser.Text = model.UserName;
            setProgress("Login successful", 0);
            this.treeViewMenu.ExpandAll();
            FormsHelper.ApplyLanguageLocalization(this);
        }
Exemplo n.º 2
0
        private void WhenAuthenticated(UserModel model)
        {
            MVCHISSession.Instance.CurrentUser = model;
            Login1.Visible        = false;
            DictionaryUC1.Visible = false;

            string   prev = "";
            TreeNode node = null;

            foreach (var stuple in CntrlUS.GetMenu(model).OrderBy(x => x.Item1))
            {
                var egn = stuple.Item1;
                if (prev.Equals(egn) == false)
                {
                    node = new TreeNode(egn);
                    TreeView2.Nodes.Add(node);
                    prev = egn;
                }
                TreeNode child = new TreeNode(stuple.Item2);
                node.ChildNodes.Add(child);
            }

            MVCHISSession.Instance.UserEntitlements = CntrlPE.Read(new ProfileEntitlementModel {
                ProfileId = model.ProfileId
            }, "ProfileId");
        }