Пример #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 button1_Click(object sender, EventArgs e)
        {
            string str = DEFS.NyitNap_EV.ToString() + "." + DEFS.NyitNap_HO.ToString() + "." + DEFS.NyitNap_NAP.ToString();
            if (MessageBox.Show("Valóban szeretné lezárni a " + str + " napot?", "Nap zárás", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                LoggedInUsers l = new LoggedInUsers();
                while (l.lLoggedInUsers.Count > 0)
                {
                    foreach (var u in l.lLoggedInUsers)
                    {
                        DEFS.UserLogout(u.USER_ID);
                    }
                    l = new LoggedInUsers();
                }

                nz.CloseDay();
                doPrinting dp = new doPrinting();
                if ((string)Syspar2.GetValue(ParamCodes.OSSZ_REPORT_FORMAT) == "L")
                {
                    dp.setReportMaker(new OsszesitoReport(DEFS.NyitNap_EV
                                                            , DEFS.NyitNap_HO,
                                                            DEFS.NyitNap_NAP));
                }
                else
                {
                    dp.setReportMaker(new OsszesitoReportSmall(DEFS.NyitNap_EV
                                                                            , DEFS.NyitNap_HO,
                                                                            DEFS.NyitNap_NAP));
                }
                dp.doPrint();
                button1.Visible = false;
                btnClose.Visible = false;
                btnKilep.Visible = true;

            }
        }
Пример #3
0
        private static void OnApplicationExit(object sender, EventArgs e)
        {
            // When the application is exiting, write the application data to the
            // user file and close it.

            LoggedInUsers l = new LoggedInUsers();
            while (l.lLoggedInUsers.Count > 0)
            {
                foreach (var u in l.lLoggedInUsers)
                {
                    DEFS.UserLogout(u.USER_ID);
                }
                l = new LoggedInUsers();
            }
        }