Beispiel #1
0
        private void BtnTransfer_Click(object sender, EventArgs e)
        {
            if (CmbBxTransferGroups.SelectedIndex == 0)
            {
                MessageBox.Show(
                    "Please select the group to transfer the ticket to!", "Visual Terminal - Warning",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning
                    );
                return;
            }
            else if (CmbBxTransferGroups.SelectedValue.ToString() == LblTicketGroupName.Tag.ToString())
            {
                MessageBox.Show(
                    "This ticket is a ticket belonging to the group you already selected!"
                    + Environment.NewLine
                    + "Please select a different group from the group where the ticket is located for the transfer.",
                    "Virtual Terminal - Warning",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning
                    );
                return;
            }

            BtnTransfer.Text = "Ticket is being transported...";
            SetEnabledForTransferControls(false);
            Bilet ticketTransfer = CreateTicket(
                int.Parse(CmbBxTransferGroups.SelectedValue.ToString()),
                true,
                false,
                int.Parse(LblTicketNo.Tag.ToString())
                );

            Hashtable hshNewTransferTicket = ticketTransfer.New();

            if (!hshNewTransferTicket.ContainsKey("Error"))
            {
                _kuyruk.HasNotTicket();
                LblWaitingTickets.Text = _kuyruk.GetWaitingTicketsCount().ToString();
                SetWaitingLamb();
                ClearTicketInf();
                DGVTicketLists.DataSource         = GetAllTickets("");
                LblTicketNo.Text                  = "Ticket transfer is complete";
                CmbBxTransferGroups.SelectedIndex = 0;

                TmrTicketProcessCounter.Stop();
                TmrOtoTicketCall.Start();
                NotifiyCurrentState("idled...", Color.Red);
            }
            else
            {
                LblTicketNo.Text        = "There was a mistake in the ticket transfer process.";
                LblTicketGroupName.Text = "Please try again the transfer process.";
                SetEnabledForTransferControls(true);
            }

            BtnTransfer.Text = "Transfer Ticket";
        }
Beispiel #2
0
 private void kuyruk_TicketCallingFalied()
 {
     MessageBox.Show(
         string.Format("{0}{1}{2}", "The QPU Server cannot be get at.",
                       Environment.NewLine,
                       "Make sure the Server program is running."),
         Settings.MessageBoxTitle,
         MessageBoxButtons.OK,
         MessageBoxIcon.Warning
         );
     TmrTicketProcessCounter.Stop();
 }
Beispiel #3
0
        private void BtnFiktif_Click(object sender, EventArgs e)
        {
            if (CmbBxFiktifGroups.SelectedIndex == 0)
            {
                MessageBox.Show(
                    "Please select the group in which the fictitious ticket will be produced!", "Virtual Terminal - Uyarı",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning
                    );
                return;
            }


            BtnFiktif.Enabled = false;

            Bilet ticketFiktif = CreateTicket(int.Parse(CmbBxFiktifGroups.SelectedValue.ToString()),
                                              false,
                                              true,
                                              GetNextFiktifTicketNumber()
                                              );

            Hashtable hshFiktif = ticketFiktif.New();

            if (!hshFiktif.ContainsKey("Error"))
            {
                LblFiktifTicketNumber.Text = ticketFiktif.BiletNo.ToString();
                if (ChckBxFiktifCurrentTicket.Checked)
                {
                    _kuyruk.HasNotTicket();
                    LblWaitingTickets.Text = _kuyruk.GetWaitingTicketsCount().ToString();
                    SetWaitingLamb();

                    ClearTicketInf();
                    SetEnabledForTransferControls(false);
                    TmrTicketProcessCounter.Stop();
                    NotifiyCurrentState("idled...", Color.Red);
                    _kuyruk.terminal.SetTerminalState(Terminaller.TerminalDurum.Bosta);

                    TmrOtoTicketCall.Start();
                }

                PrintFiktifTicket(ticketFiktif.BiletNo);
                DGVTicketLists.DataSource = GetAllTickets("");
            }
            else
            {
                LblFiktifError.Text  = "A mistake has occurred in the process of producing a fictitious ticket.";
                LblFiktifError.Text += "\nPlease try again.";
            }

            BtnFiktif.Enabled = true;
        }
Beispiel #4
0
        private void kuyruk_NotTicketDetected()
        {
            LblWaitingTickets.Text = "0";
            SetWaitingLamb();
            SetEnabledForTransferControls(false);
            TmrOtoTicketCall.Start();
            TmrTicketProcessCounter.Stop();

            NotifiyCurrentState("idled...", Color.Red);

            LblTicketNo.Tag = null;
            TCPIPCommunicating.NotExistWaitingResponse(_kuyruk.terminal.ElTerminalID);
        }
Beispiel #5
0
        private void btnPark_Click(object sender, EventArgs e)
        {
            if (LblTicketNo.Tag != null && !string.IsNullOrEmpty(LblTicketNo.Tag.ToString()))
            {
                ParkingTickets.Rows.Add(
                    int.Parse(LblSisTar.Tag.ToString()), int.Parse(LblTicketGroupName.Tag.ToString()),
                    LblTicketNo.Text);
                TmrOtoTicketCall.Start();
                TmrTicketProcessCounter.Stop();
                SetEnabledForTransferControls(false);
                ClearTicketInf();
                _kuyruk.terminal.SetActiveTicketID(0);

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

                NotifiyCurrentState("idled...", Color.Red);
            }
        }
Beispiel #6
0
        private void BtnMola_Click(object sender, EventArgs e)
        {
            TmrOtoTicketCall.Stop();
            //TmrWaitingCountRefresh.Stop();
            if (!_startCoffeeBreak.Molada)
            {
                _startCoffeeBreak.PersonelID    = SanalTerminal.PersonelID;
                _startCoffeeBreak.MolaBaslangic = DateTime.Now;
                _startCoffeeBreak.LetsCoffeeBreak();

                TCPIPCommunicating.MakeLineOnDisplay(_kuyruk.terminal.ElTerminalID);

                if (Thread.CurrentThread.CurrentUICulture.Name == "tr-TR")
                {
                    NotifiyCurrentState("Molada...", Color.Red);
                }
                else
                {
                    NotifiyCurrentState("Takes Break...", Color.Red);
                }
                BtnMola.BackColor = Color.OrangeRed;
                BtnMola.FlatAppearance.BorderColor        = SystemColors.InactiveBorder;
                BtnMola.FlatAppearance.MouseDownBackColor = Color.Orange;
                BtnMola.FlatAppearance.MouseOverBackColor = Color.DarkOrange;
                ToolTipForProcess.SetToolTip(BtnMola, "End Break");

                SetEnabledCommonControls(false);
                BtnOutOfService.BackColor = SystemColors.InactiveBorder;
                BtnOutOfService.Enabled   = false;
                if (!string.IsNullOrEmpty(LblTicketNo.Text))
                {
                    _kuyruk.HasNotTicket();
                    ClearTicketInf();
                    TmrTicketProcessCounter.Stop();
                }

                _kuyruk.terminal.SetTerminalState(Terminaller.TerminalDurum.Molada);
            }
            else
            {
                _startCoffeeBreak.MolaBitis = DateTime.Now;
                _startCoffeeBreak.DoneCoffeeBreak();

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

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

                NotifiyCurrentState("idled...", Color.Red);
                BtnMola.BackColor = SystemColors.InactiveCaption;
                BtnMola.FlatAppearance.BorderColor        = SystemColors.ActiveCaption;
                BtnMola.FlatAppearance.MouseDownBackColor = Color.SkyBlue;
                BtnMola.FlatAppearance.MouseOverBackColor = SystemColors.GradientInactiveCaption;
                ToolTipForProcess.SetToolTip(BtnMola, "Start Break");

                TmrOtoTicketCall.Start();

                SetEnabledCommonControls(true);
                BtnOutOfService.BackColor = SystemColors.InactiveCaption;
                BtnOutOfService.Enabled   = true;
                DGVTicketLists.DataSource = GetAllTickets("");
            }
        }
Beispiel #7
0
        private void BtnOutOfService_Click(object sender, EventArgs e)
        {
            TmrOtoTicketCall.Stop();
            //TmrWaitingCountRefresh.Stop();
            if (_closeAndOpenService.ServisDisi)
            {
                _closeAndOpenService.ServisAcmaTarihi = DateTime.Now;
                _closeAndOpenService.OpenService();

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

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

                NotifiyCurrentState("Boşta...", Color.Red);
                BtnOutOfService.BackColor = SystemColors.InactiveCaption;
                BtnOutOfService.FlatAppearance.BorderColor        = SystemColors.ActiveCaption;
                BtnOutOfService.FlatAppearance.MouseDownBackColor = Color.SkyBlue;
                BtnOutOfService.FlatAppearance.MouseOverBackColor = SystemColors.GradientInactiveCaption;

                TmrOtoTicketCall.Start();
                SetEnabledCommonControls(true);
                BtnMola.BackColor         = SystemColors.InactiveCaption;
                BtnMola.Enabled           = true;
                DGVTicketLists.DataSource = GetAllTickets("");
                return;
            }


            string outOfReason          = string.Empty;
            WOutOfServiceReason outOfIT = new WOutOfServiceReason();

            if (outOfIT.ShowDialog() == DialogResult.OK)
            {
                _closeAndOpenService.KapatmaSebebi       = outOfIT.TxtBxReason.Text.Trim();
                _closeAndOpenService.ServisKapatmaTarihi = DateTime.Now;
                _closeAndOpenService.CloseService();


                TCPIPCommunicating.MakeLineOnDisplay(_kuyruk.terminal.ElTerminalID);
                if (Thread.CurrentThread.CurrentUICulture.Name == "tr-TR")
                {
                    NotifiyCurrentState("Servis Dışı...", Color.OrangeRed);
                }
                else
                {
                    NotifiyCurrentState("Out Of Order...", Color.OrangeRed);
                }
                BtnOutOfService.BackColor = Color.OrangeRed;
                BtnOutOfService.FlatAppearance.BorderColor        = SystemColors.InactiveBorder;
                BtnOutOfService.FlatAppearance.MouseDownBackColor = Color.Orange;
                BtnOutOfService.FlatAppearance.MouseOverBackColor = Color.DarkOrange;

                SetEnabledCommonControls(false);
                BtnMola.BackColor = SystemColors.InactiveBorder;
                BtnMola.Enabled   = false;

                if (!string.IsNullOrEmpty(LblTicketNo.Text))
                {
                    _kuyruk.HasNotTicket();
                    ClearTicketInf();
                    TmrTicketProcessCounter.Stop();
                }

                _kuyruk.terminal.SetTerminalState(Terminaller.TerminalDurum.ServisDisi);
            }
            else
            {
            }
        }
Beispiel #8
0
        private void FrmVirtualTerminal_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Alt && e.Control)
            {
                MenuStripTop.Visible = !MenuStripTop.Visible;
                return;
            }

            if (e.KeyCode == Keys.Right && e.Shift)
            {
                BtnNextTicket.PerformClick();
                return;
            }
            else if (e.KeyCode == Keys.R && e.Shift)
            {
                BtnReCallTicket.PerformClick();
            }
            else if (e.KeyCode == Keys.X && e.Shift)
            {
                TCPIPCommunicating.CloseDisplay(_kuyruk.terminal.ElTerminalID);
            }
            else if (e.KeyCode == Keys.Z && e.Shift)
            {
                TCPIPCommunicating.OpenDisplay(_kuyruk.terminal.ElTerminalID);
            }
            else if (e.KeyCode == Keys.L && e.Shift)
            {
                TCPIPCommunicating.MakeLineOnDisplay(_kuyruk.terminal.ElTerminalID);
            }
            else if (e.KeyCode == Keys.K && e.Shift)
            {
                DataTable         dtTempParking = ParkingTickets;
                FrmParkingTickets frmParking    = new FrmParkingTickets(ref dtTempParking);
                frmParking.ShowDialog();

                if (frmParking.IsCalledParkingTickets)
                {
                    ParkingTickets = null;
                    ParkingTickets = dtTempParking;

                    int             TicketID, TicketNo, GroupID;
                    bool            IsAssistGroup, IsMainGroup, IsTransferTicket, IsFiktifTicket;
                    DataGridViewRow drCalledTickets = frmParking.CalledTicket;
                    TicketID = int.Parse(drCalledTickets.Cells["BID"].Value.ToString());
                    TicketNo = int.Parse(drCalledTickets.Cells["BNo"].Value.ToString());
                    GroupID  = int.Parse(drCalledTickets.Cells["GRPID"].Value.ToString());

                    IsMainGroup = TerminalHasThisGroup(
                        drCalledTickets.Cells["GRPID"].Value.ToString(), out IsAssistGroup);
                    IsTransferOrFiktifTicket(TicketID, out IsTransferTicket, out IsFiktifTicket);

                    _kuyruk.KillTicket();
                    _kuyruk.CallTicketManuel(TicketNo, TicketID, GroupID, IsTransferTicket,
                                             IsFiktifTicket, IsAssistGroup, IsMainGroup);

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

                    SetWaitingLamb();
                    ParkingTickets.Rows.RemoveAt(frmParking.CalledIndex);
                }
            }
            else if (e.KeyCode == Keys.P)
            {
                if (LblTicketNo.Tag != null && !string.IsNullOrEmpty(LblTicketNo.Tag.ToString()))
                {
                    ParkingTickets.Rows.Add(
                        int.Parse(LblSisTar.Tag.ToString()), int.Parse(LblTicketGroupName.Tag.ToString()),
                        LblTicketNo.Text);
                    TmrOtoTicketCall.Start();
                    TmrTicketProcessCounter.Stop();
                    SetEnabledForTransferControls(false);
                    ClearTicketInf();
                    _kuyruk.terminal.SetActiveTicketID(0);

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

                    NotifiyCurrentState("idled...", Color.Red);
                }
            }
        }