示例#1
0
        private void FrmVirtualTerminal_Load(object sender, EventArgs e)
        {
            ChangeLanguage();

            DataTable dtGroups    = Grup.LoadToControl();
            string    cbGrupText  = "";
            string    cbBiletText = "";


            if (Thread.CurrentThread.CurrentUICulture.Name == "tr-TR")
            {
                cbGrupText  = "Lütfen Grup Seçiniz...";
                cbBiletText = "Tüm Biletler...";
            }
            else
            {
                cbGrupText  = "Select Group...";
                cbBiletText = "All Tickets...";
            }

            CommonProcess.LoadDataToComboBox(CmbBxTransferGroups, dtGroups, cbGrupText);
            CommonProcess.LoadDataToComboBox(CmbBxFiktifGroups, dtGroups, cbGrupText);
            CommonProcess.LoadDataToComboBox(CmbBxQueueGroups, dtGroups, cbBiletText);

            _kuyruk = new Kuyruk(SanalTerminal.TerminalID);
            _kuyruk.NextTicketDetected += kuyruk_NextTicketDetected;

            _kuyruk.NotTicketDetected += kuyruk_NotTicketDetected;

            _kuyruk.TicketCallingFalied += kuyruk_TicketCallingFalied;

            _kuyruk.terminal.StatementChanged += terminal_StatementChanged;

            _kuyruk.terminal.SetTerminalState(Terminaller.TerminalDurum.Bosta);

            if (Thread.CurrentThread.CurrentUICulture.Name == "tr-TR")
            {
                NotifiyCurrentState("Boşta...", Color.Red);
            }
            else
            {
                NotifiyCurrentState("Idle...", Color.Red);
            }

            LblWaitingTickets.Text = _kuyruk.GetWaitingTicketsCount().ToString();

            SetWaitingLamb();

            DataTable dtTerminalGroups = TerminalGrup.GetGroupOfTerminal(SanalTerminal.TerminalID.ToString());

            if (dtTerminalGroups.Rows.Count > 0)
            {
                string strWhereForTermGroup = string.Empty;

                for (int i = 0; i < dtTerminalGroups.Rows.Count; i++)
                {
                    strWhereForTermGroup = string.Format(
                        "{0} (KUYRUK.GRPID= {1}) OR", strWhereForTermGroup, dtTerminalGroups.Rows[i][0]);
                }
                strWhereForTermGroup = strWhereForTermGroup.Substring(0, strWhereForTermGroup.Length - 2);

                DGVTicketLists.DataSource = GetAllTickets(strWhereForTermGroup);
            }


            if (DGVTicketLists.Rows.Count > 0)
            {
                DGVTicketLists.Rows[0].Selected = false;
            }

            if (SanalTerminal.OtomatikCagri)
            {
                TmrOtoTicketCall.Interval = SanalTerminal.OtomatikCagriSuresi;
                TmrOtoTicketCall.Start();
            }


            _startCoffeeBreak    = new Mola();
            _closeAndOpenService = new Servis();
            ChckBxMinMax.Checked = true;
            Location             = new Point(0, Location.Y);

            ParkingTickets = new DataTable();
            ParkingTickets.Columns.Add("BID", typeof(int));
            ParkingTickets.Columns.Add("GRPID", typeof(int));
            ParkingTickets.Columns.Add("BiletNo", typeof(string));

            LblCallingCount.Text = _kuyruk.terminal.GetCalledTicketCount().ToString();
        }