Example #1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AdminPINLastAccess = DateTime.Now.AddYears(-1);

            var login = new Login();

            if (!Util.IsDebug())
            {
                login.FullScreen.Checked = true;
            }

            login.password.Focus();
            var r = login.ShowDialog();

            if (r == DialogResult.Cancel)
            {
                return;
            }
            PrintMode             = login.PrintMode.Text;
            PrintKiosks           = login.PrintKiosks.Text;
            Printer               = login.Printer.Text;
            DisableLocationLabels = login.DisableLocationLabels.Checked;
            BuildingMode          = login.BuildingAccessMode.Checked;
            FullScreen            = login.FullScreen.Checked;

            BaseForm b;

            if (BuildingMode)
            {
                attendant          = new Attendant();
                attendant.Location = new Point(Settings1.Default.AttendantLocX, Settings1.Default.AttendantLocY);
                home2           = new Home2();
                b               = new BaseForm(home2);
                b.StartPosition = FormStartPosition.Manual;
                b.Location      = new Point(Settings1.Default.BaseFormLocX, Settings1.Default.BaseFormLocY);
                baseform        = b;
                if (FullScreen)
                {
                    b.WindowState     = FormWindowState.Maximized;
                    b.FormBorderStyle = FormBorderStyle.None;
                }
                else
                {
                    b.FormBorderStyle = FormBorderStyle.FixedSingle;
                    b.ControlBox      = false;
                }
                attendant.StartPosition = FormStartPosition.Manual;
                Application.Run(attendant);
                return;
            }

            var f = new StartUp {
                campuses = login.campuses
            };
            var ret = f.ShowDialog();

            if (ret == DialogResult.Cancel)
            {
                return;
            }

            AdminPassword         = f.AdminPassword;
            CampusId              = f.CampusId;
            ThisDay               = f.DayOfWeek;
            HideCursor            = f.HideCursor.Checked;
            AskGrade              = f.AskGrade.Checked;
            AskLabels             = false;
            LeadTime              = int.Parse(f.LeadHours.Text);
            EarlyCheckin          = int.Parse(f.LateMinutes.Text);
            AskEmFriend           = f.AskEmFriend.Checked;
            KioskName             = f.KioskName.Text;
            AskChurch             = f.AskChurch.Checked;
            AskChurchName         = f.AskChurchName.Checked;
            EnableTimer           = f.EnableTimer.Checked;
            DisableJoin           = f.DisableJoin.Checked;
            SecurityLabelPerChild = f.SecurityLabelPerChild.Checked;

            f.Dispose();

            if (PrintMode == "Print From Server")
            {
                var p = new PrintingServer();
                Application.Run(p);
                return;
            }

            home            = new Home();
            b               = new BaseForm(home);
            baseform        = b;
            b.StartPosition = FormStartPosition.Manual;
            b.Location      = new Point(Settings1.Default.BaseFormLocX, Settings1.Default.BaseFormLocY);

            if (FullScreen)
            {
                b.WindowState     = FormWindowState.Maximized;
                b.FormBorderStyle = FormBorderStyle.None;
            }
            Application.Run(b);
        }
Example #2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            settings.load();

            AdminPINLastAccess = DateTime.Now.AddYears(-1);

            var login        = new Login();
            var loginResults = login.ShowDialog();

            if (loginResults == DialogResult.Cancel)
            {
                return;
            }

            var loginSettings        = new LoginSettings();
            var loginSettingsResults = loginSettings.ShowDialog();

            if (loginSettingsResults == DialogResult.Cancel)
            {
                return;
            }

            if (settings.buildingMode)
            {
                attendant          = new BuildingAttendant();
                attendant.Location = settings.attendantLastPosition();

                buildingHome = new BuildingHome();

                baseform = new BaseForm(buildingHome);
                baseform.StartPosition = FormStartPosition.Manual;
                baseform.Location      = settings.baseLastPosition();

                if (settings.fullScreen)
                {
                    baseform.WindowState     = FormWindowState.Maximized;
                    baseform.FormBorderStyle = FormBorderStyle.None;
                }
                else
                {
                    baseform.FormBorderStyle = FormBorderStyle.FixedSingle;
                    baseform.ControlBox      = false;
                }

                attendant.StartPosition = FormStartPosition.Manual;
                Application.Run(attendant);
                return;
            }

            if (settings.printMode == "Print From Server")
            {
                var p = new AttendPrintingServer();
                Application.Run(p);
                return;
            }

            attendHome = new AttendHome();

            baseform = new BaseForm(attendHome);
            baseform.StartPosition = FormStartPosition.Manual;
            baseform.Location      = settings.baseLastPosition();

            if (settings.fullScreen)
            {
                baseform.WindowState     = FormWindowState.Maximized;
                baseform.FormBorderStyle = FormBorderStyle.None;
            }

            Application.Run(baseform);
        }