예제 #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         TICKET tk = new TICKET();
         tk.Show();
         this.Hide();
         Airline air = new Airline();
         air.AssignValues();
     }
     catch (Exception ex) { MessageBox.Show(ex.Message, "Exception Unhandled", MessageBoxButtons.OK, MessageBoxIcon.Error); }
 }
예제 #2
0
        public void ApplyVisa(string ab, string b, int c, string d, Int64 e, string f, string g, string h)
        {
            Visa vs = new Visa();

            this.FirstName      = ab;
            this.LastName       = b;
            this.Age            = c;
            this.nationality    = d;
            this.PassportNumber = e;
            this.email          = f;
            this.residency      = g;
            vs.visatype         = h;
            connec.Open();
            string     query   = "insert into VISAAPPLICATIONS values (@fname,@lname,@age,@nationality,@ppnumber,@email,@residency,@visatype,@photo)";
            SqlCommand command = new SqlCommand(query, connec);

            command.Parameters.AddWithValue("@fname", FirstName);;
            command.Parameters.AddWithValue("@lname", LastName);
            command.Parameters.AddWithValue("@age", Age);
            command.Parameters.AddWithValue("@nationality", nationality);
            command.Parameters.AddWithValue("@ppnumber", PassportNumber);
            command.Parameters.AddWithValue("@email", email);
            command.Parameters.AddWithValue("@residency", residency);
            command.Parameters.AddWithValue("@visatype", vs.visatype);
            command.Parameters.AddWithValue("@photo", vs.SaveImage());
            int a = command.ExecuteNonQuery();

            if (a > 0)
            {
                MessageBox.Show("Your Visa application has been submitted , You can proceed towards ticket booking now .",
                                "Visa Succesfully Applied", MessageBoxButtons.OK, MessageBoxIcon.Information);
                vs.ShowBill();
                TICKET tk = new TICKET();
                tk.Show();
                VISA VS = new VISA();
                VS.Hide();
            }
            else
            {
                MessageBox.Show("Visa Application submission unsuccesful .", "Apply Visa", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            connec.Close();
        }