コード例 #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (fromWhere.Equals("bart"))
     {
         BarTable otherform = new BarTable();
         otherform.Show();
         this.Close();
     }
     else if (fromWhere.Equals("bari"))
     {
         BarInteraction otherform2 = new BarInteraction();
         otherform2.Show();
         this.Close();
     }
     else if (fromWhere.Equals("user"))
     {
         MessageBox.Show("Δεν πραγματοποιήθηκε κράτηση στο  μπαρ!");
         File.WriteAllText(Application.StartupPath + "/barres.txt", "no");
         this.Close();
     }
     else
     {
         MessageBox.Show("Δεν πραγματοποιήθηκε κράτηση στο  μπαρ!");
         File.WriteAllText(Application.StartupPath + "/barres.txt", "no");
         ConfirmAsVisitor c = new ConfirmAsVisitor();
         c.Show();
         this.Close();
     }
 }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            long ccnum;
            int  pin;

            if (comboBox1.SelectedIndex == -1)
            {
                MessageBox.Show("Παρακαλώ επιλέξτε την ώρα προβολής.");
            }
            else if (numericUpDown1.Value == 0)
            {
                MessageBox.Show("Παρακαλώ επιλέξτε τον αριθμό των εισητηρίων\nπου θέλετε να υποβάλλετε σε κράτηση.");
            }
            else if (String.IsNullOrEmpty(textBox1.Text) || String.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("Παρακαλώ εισάγετε τα στοιχεία πληρωμής!");
            }
            else if (seatsSelected == numericUpDown1.Value)
            {
                string booker = System.IO.File.ReadAllText("loggedin.txt");
                if (!String.IsNullOrEmpty(booker))
                {
                    File.WriteAllText(Application.StartupPath + "/hasres.txt", "yes");
                    if (checkBox1.Checked)
                    {
                        MenuView menu = new MenuView();
                        menu.fromWhere = "user";
                        menu.Show();
                    }
                    this.Close();
                }
                else
                {
                    if (checkBox1.Checked)
                    {
                        MenuView menu = new MenuView();
                        menu.fromWhere = "guest";
                        menu.Show();
                        this.Close();
                    }
                    else
                    {
                        ConfirmAsVisitor form = new ConfirmAsVisitor();
                        form.Show();
                        this.Close();
                    }
                }
            }
            else
            {
                MessageBox.Show("Ο αριθμός των εισητηρίων δεν αντιστοιχεί στον αριθμό \nτων κρατήσεων στο πλαίσιο των θέσεων");
            }
        }
コード例 #3
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (fromWhere.Equals("bart"))
     {
         BarTable otherform = new BarTable();
         otherform.Show();
         otherform.label1.Text     = "Το σύνολο σας είναι " + Price.ToString() + " ευρώ. ";
         otherform.button3.Visible = true;
         otherform.button7.Visible = false;
         this.Close();
     }
     else if (fromWhere.Equals("bari"))
     {
         BarInteraction otherform2 = new BarInteraction();
         otherform2.Show();
         otherform2.label1.Text     = "Το σύνολο σας είναι " + Price.ToString() + " ευρώ.";
         otherform2.button1.Visible = true;
         otherform2.button2.Visible = true;
         otherform2.label2.Visible  = true;
         otherform2.button4.Visible = false;
         otherform2.button6.Visible = false;
         this.Close();
     }
     else if (fromWhere.Equals("user"))
     {
         MessageBox.Show("Επιτυχής καταχώρηση κράτησης εισητηρίων και παραγγελίας!");
         File.WriteAllText(Application.StartupPath + "/barres.txt", "yes");
         this.Close();
     }
     else
     {
         MessageBox.Show("Επιτυχής καταχώρηση κράτησης στο μπαρ!");
         File.WriteAllText(Application.StartupPath + "/barres.txt", "yes");
         ConfirmAsVisitor c = new ConfirmAsVisitor();
         c.Show();
         this.Close();
     }
 }