예제 #1
0
        private void initDataset()
        {
            UserLista ul = new UserLista();
            userBindingSource.Clear();

            foreach (var k in ul.lUser)
            {
                userBindingSource.Add(k);
            }
        }
예제 #2
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);

            }
        }