예제 #1
0
        private void radSpinEditorSessionTime_MouseDown(object sender, MouseEventArgs e)
        {
            tsNumericKeypad keyboard = new tsNumericKeypad("Enter Minutes");

            DialogResult dr = keyboard.ShowDialog();

            if (dr == DialogResult.OK)
            {
                int tmpMin = 50;

                int.TryParse(keyboard.Data, out tmpMin);

                radSpinEditorSessionTime.Value = tmpMin == 0 ? 50 : tmpMin;
            }
        }
예제 #2
0
        private void radSpinEditorNumPrint_MouseDown(object sender, MouseEventArgs e)
        {
            tsNumericKeypad keyboard = new tsNumericKeypad("Enter The Number Of Ticket To Print");

            DialogResult dr = keyboard.ShowDialog();

            if (dr == DialogResult.OK)
            {
                int tmpNum = 0;

                int.TryParse(keyboard.Data, out tmpNum);

                radSpinEditorNumPrint.Value = (decimal)((tmpNum == 0 || tmpNum > radSpinEditorNumPrint.Maximum || tmpNum < radSpinEditorNumPrint.Minimum) ? 0 : tmpNum);
            }
        }
예제 #3
0
        private void radButtonChangeManagerPassword_Click(object sender, EventArgs e)
        {
            string firstPassword;

            tsNumericKeypad keyboard = new tsNumericKeypad("Enter New Manager Password");

            keyboard.IsPassword = true;

            this.ShowAlertBox("Change Manager Password", "Please enter the new manager password.");

            DialogResult dr = keyboard.ShowDialog();

            if (dr == DialogResult.OK)
            {
                firstPassword = keyboard.Data;

                keyboard.Text = "Enter New Manager Password Again";
                keyboard.Data = "";

                this.ShowAlertBox("Change Manager Password", "Please re-enter the new manager password.");

                dr = keyboard.ShowDialog();

                if (dr == DialogResult.OK)
                {
                    if (keyboard.Data == firstPassword)
                    {
                        this.ShowAlertBox("Change Manager Password", "New manager password is saved!");
                        NetworkFunction.SetSystemConfig(new SystemConfig(Enums.SysConfigType.MANAGER_PASSWORD, firstPassword));
                    }
                    else
                    {
                        this.ShowAlertBox("Change Manager Password", "First password unmatch to the second password. Please re-try!");
                    }
                }
            }
        }
예제 #4
0
        private void NetworkFunction_OnIncommingSystemConfig(object sender, EventArgs e)
        {
            List <SystemConfig> lsc = ((SystemConfigEvent)e).SystemConfig;

            foreach (SystemConfig sc in lsc)
            {
                switch (sc.Type)
                {
                case Enums.SysConfigType.ADMIN_PASSWORD:

                    if (_optionButtonTrigged)
                    {
                        _optionButtonTrigged = false;

                        if (sc.Value != "")
                        {
                            this.InvokeUI(() =>
                            {
                                tsNumericKeypad keyboard = new tsNumericKeypad("Enter Admin Password");
                                keyboard.IsPassword      = true;

                                DialogResult dr = keyboard.ShowDialog();

                                if (dr == DialogResult.OK)
                                {
                                    if (keyboard.Data == sc.Value)
                                    {
                                        try
                                        {
                                            Options op = new Options();
                                            op.ShowDialog();
                                        }
                                        catch
                                        {
                                            // eat radcontrol error
                                        }
                                    }
                                    else
                                    {
                                        this.ShowAlertBox("System Options", "Password is incorrect!");
                                    }
                                }
                            });
                        }
                        else
                        {
                            this.InvokeUI(() =>
                            {
                                try
                                {
                                    Options op = new Options();
                                    op.ShowDialog();
                                }
                                catch
                                {
                                    // eat radcontrol error
                                }
                            });
                        }
                    }
                    break;

                case Enums.SysConfigType.MANAGER_PASSWORD:

                    if (_managerButtonTrigged)
                    {
                        _managerButtonTrigged = false;

                        if (sc.Value != "")
                        {
                            this.InvokeUI(() =>
                            {
                                tsNumericKeypad keyboard = new tsNumericKeypad("Enter Manager Password");
                                keyboard.IsPassword      = true;

                                DialogResult dr = keyboard.ShowDialog();

                                if (dr == DialogResult.OK)
                                {
                                    if (keyboard.Data == sc.Value)
                                    {
                                        ManagerFeatures mf = new ManagerFeatures();
                                        mf.ShowDialog();
                                    }
                                    else
                                    {
                                        this.ShowAlertBox("Manager Features", "Password is incorrect!");
                                    }
                                }
                            });
                        }
                        else
                        {
                            this.InvokeUI(() =>
                            {
                                ManagerFeatures mf = new ManagerFeatures();
                                mf.ShowDialog();
                            });
                        }
                    }
                    else if (_barcodeButtonTrigged)
                    {
                        _barcodeButtonTrigged = false;
                        if (sc.Value != "")
                        {
                            this.InvokeUI(() =>
                            {
                                tsNumericKeypad keyboard = new tsNumericKeypad("Enter Manager Password");
                                keyboard.IsPassword      = true;

                                DialogResult dr = keyboard.ShowDialog();

                                if (dr == DialogResult.OK)
                                {
                                    if (keyboard.Data == sc.Value)
                                    {
                                        BarcodeGeneration bg = new BarcodeGeneration();
                                        bg.ShowDialog();
                                    }
                                    else
                                    {
                                        this.ShowAlertBox("Barcode Generation", "Password is incorrect!");
                                    }
                                }
                            });
                        }
                        else
                        {
                            this.InvokeUI(() =>
                            {
                                BarcodeGeneration bg = new BarcodeGeneration();
                                bg.ShowDialog();
                            });
                        }
                    }
                    else if (_waiverProceesButtonTrigged)
                    {
                        _waiverProceesButtonTrigged = false;

                        if (sc.Value != "")
                        {
                            this.InvokeUI(() =>
                            {
                                tsNumericKeypad keyboard = new tsNumericKeypad("Enter Manager Password");
                                keyboard.IsPassword      = true;

                                DialogResult dr = keyboard.ShowDialog();

                                if (dr == DialogResult.OK)
                                {
                                    if (keyboard.Data == sc.Value)
                                    {
                                        try
                                        {
                                            WaiverProcess wp = new WaiverProcess();
                                            wp.ShowDialog();
                                        }
                                        catch (ExternalException)
                                        {
                                        }
                                    }
                                    else
                                    {
                                        this.ShowAlertBox("Waiver Process", "Password is incorrect!");
                                    }
                                }
                            });
                        }
                        else
                        {
                            this.InvokeUI(() =>
                            {
                                try
                                {
                                    WaiverProcess wp = new WaiverProcess();
                                    wp.ShowDialog();
                                }
                                catch (ExternalException)
                                {
                                }
                            });
                        }
                    }

                    break;

                case Enums.SysConfigType.LCD_BARCODE_MODULE:

                    this.InvokeUI(() =>
                    {
                        if (sc.Value == "True")
                        {
                            radButtonPrintBarcode.Visible  = true;
                            radButtonWaiverProcess.Visible = true;
                        }
                        else
                        {
                            radButtonPrintBarcode.Visible  = false;
                            radButtonWaiverProcess.Visible = false;
                        }
                    });

                    break;

                default:
                    break;
                }
            }
        }
예제 #5
0
        private void NetworkFunction_OnIncommingSystemConfig(object sender, EventArgs e)
        {
            List <SystemConfig> lsc = ((SystemConfigEvent)e).SystemConfig;

            foreach (SystemConfig sc in lsc)
            {
                switch (sc.Type)
                {
                case Enums.SysConfigType.MANAGER_PASSWORD:

                    if (_moreConfigTrigged)
                    {
                        _moreConfigTrigged = false;
                        if (sc.Value != "")
                        {
                            this.InvokeUI(() =>
                            {
                                tsNumericKeypad keyboard = new tsNumericKeypad("Enter Manager Password");
                                keyboard.IsPassword      = true;

                                DialogResult dr = keyboard.ShowDialog();

                                if (dr == DialogResult.OK)
                                {
                                    if (keyboard.Data == sc.Value)
                                    {
                                        radButtonMoreConfig.Enabled = false;

                                        int tmpAddHeight = 160;
                                        this.Height     += tmpAddHeight;
                                        if (this.Location.Y - tmpAddHeight / 2 > 0)
                                        {
                                            this.Location = new Point(this.Location.X, this.Location.Y - tmpAddHeight / 2);
                                        }

                                        //this.ShowAlertBox("Client Info", "Please becareful with these powerful features!");
                                    }
                                    else
                                    {
                                        this.ShowAlertBox("Manager Features", "Password is incorrect!");
                                    }
                                }
                            });
                        }
                        else
                        {
                            this.InvokeUI(() =>
                            {
                                radButtonMoreConfig.Enabled = false;

                                int tmpAddHeight = 160;
                                this.Height     += tmpAddHeight;
                                if (this.Location.Y - tmpAddHeight / 2 > 0)
                                {
                                    this.Location = new Point(this.Location.X, this.Location.Y - tmpAddHeight / 2);
                                }
                            });
                        }
                    }

                    break;

                case Enums.SysConfigType.DEFAULT_TIMED_SESSION_LENGTH:

                    this.InvokeUI(() =>
                    {
                        int tmpMin = 50;

                        int.TryParse(sc.Value, out tmpMin);

                        radSpinEditorSessionTime.Value = tmpMin == 0 ? 50 : tmpMin;
                    });

                    break;
                }
            }
        }