コード例 #1
0
ファイル: frmLogin.cs プロジェクト: hayrettinbebek/e-cafe
        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
ファイル: frmUjUser.cs プロジェクト: hayrettinbebek/e-cafe
        private void frmUjUser_Load(object sender, EventArgs e)
        {
            if (uid > -1)
            {
                aktU = new _User(uid);
            }
            else { aktU = new _User(); }

            loadData();
        }
コード例 #3
0
ファイル: frmLogin.cs プロジェクト: hayrettinbebek/e-cafe
 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
ファイル: MMenu.cs プロジェクト: hayrettinbebek/e-cafe
 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);
 }