Пример #1
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            loginUsers = new LoggedInUsers();
            ul = new UserLista();

            #region DebugUser
            _User nu = new _User(-666);
            //nu.NAME = "Administrator";
            //nu.USER_ID = -666;
            //nu.LOGIN_NAME = "x";
            UserButton ub = new UserButton();
            ub.fUser = nu;
            ub.Click += User_Click;
            ub.BackgroundImage = global::GUI.Properties.Resources.off_user;
            ub.BackgroundImageLayout = ImageLayout.Stretch;
            if (loginUsers.IsLoggedIn(-666))
            {
                //ub.BackColor = Color.Green;
                Label ll = new Label();
                ll.Text = nu.NAME;
                ll.ForeColor = Color.White;
                ll.Width = 60;
                flpLoggenInusers.Controls.Add(ll);
            }
            ub.Checked = true;

            flpUser.Controls.Add(ub);

            #endregion

            foreach (var u in ul.lUser)
            {
                UserButton ub2 = new UserButton();
                ub2.fUser = u;
                ub2.Click += User_Click;
                ub2.BackgroundImage = global::GUI.Properties.Resources.off_user;
                ub2.BackgroundImageLayout = ImageLayout.Stretch;
                if (loginUsers.IsLoggedIn(u.USER_ID))
                {
                    //ub2.BackColor = Color.Green;
                    Label ll = new Label();
                    ll.Text = u.NAME;
                    ll.ForeColor = Color.White;
                    ll.Width = 60;
                    flpLoggenInusers.Controls.Add(ll);
                }

                flpUser.Controls.Add(ub2);

            }
        }
Пример #2
0
        private void frmUjUser_Load(object sender, EventArgs e)
        {
            if (uid > -1)
            {
                aktU = new _User(uid);
            }
            else { aktU = new _User(); }

            loadData();
        }
Пример #3
0
 private void User_Click(object sender, EventArgs e)
 {
     _usr = ((UserButton)sender).fUser.LOGIN_NAME;
     selUser = ((UserButton)sender).fUser;
     if (loginUsers.IsLoggedIn(selUser.USER_ID))
     {
         needLogin = 0;
     }
     else
     {
         needLogin = 1;
     }
 }
Пример #4
0
 private void SetUserSettings(_User u)
 {
     panel7.Controls.Clear();
     DEFS.LogInUser = u;
     DEFS.UserRights = new Rights(u.USER_ID);
     UserButton ub = new UserButton();
     ub.fUser = u;
     //b.Click += (o, e) => { i.showPrefs(); };
     ub.Click += UserChange;
     ub.BackgroundImage = global::GUI.Properties.Resources.off_user;
     ub.BackgroundImageLayout = ImageLayout.Stretch;
     ub.Checked = true;
     ub.Dock = DockStyle.Left;
     panel7.Controls.Add(ub);
 }