Exemple #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); }
 }
        public void passing()
        {
            TICKET tk = new TICKET();

            try
            {
                tkchange.tkfname.Text = CHANGE.vsfname.Text;
                tkchange.tklname.Text = CHANGE.vslname.Text;
                tkchange.tkage.Text   = Convert.ToString(CHANGE.vsageupdown.Value);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, "Exception Unhandled", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }
        public void dest(Int64 pp, string firstname, string lastname, string departured, string rd, string ff, string tf, string v, string op, string tr)
        {
            Airline air = new Airline();

            air.PassportNumber = pp;
            air.FirstName      = firstname;
            air.LastName       = lastname;
            air.depdate        = departured;
            air.returndate     = rd;
            ff = "KARACHI , KHI";
            air.arrivalairport = tf;
            air.via            = v;
            air.ope            = op;
            air.trclass        = tr;
            connec.Open();
            string     query = "insert into ticket values (@ppnumber,@fname,@lname,@Depdate,@returndate, @ff , @rf ,@via , @fo , @travelclass)";
            SqlCommand cmd   = new SqlCommand(query, connec);

            cmd.Parameters.AddWithValue("@ppnumber", air.PassportNumber);
            cmd.Parameters.AddWithValue("@fname", air.FirstName);
            cmd.Parameters.AddWithValue("@lname", air.LastName);
            cmd.Parameters.AddWithValue("@Depdate", air.depdate);
            cmd.Parameters.AddWithValue("@returndate", air.returndate);
            cmd.Parameters.AddWithValue("@ff", ff);
            cmd.Parameters.AddWithValue("@rf", air.arrivalairport);
            cmd.Parameters.AddWithValue("@via", air.via);
            cmd.Parameters.AddWithValue("@fo", air.ope);
            cmd.Parameters.AddWithValue("@travelclass", air.trclass);
            int a = cmd.ExecuteNonQuery();

            if (a > 0)
            {
                MessageBox.Show("Your Ticket has been booked , You can proceed towards hotel booking now .",
                                "Ticket Booked", MessageBoxButtons.OK, MessageBoxIcon.Information);
                air.ShowBill();
                HOTEL ht = new HOTEL();
                ht.Show();
                TICKET tk = new TICKET();
                tk.Hide();
            }
            else
            {
                MessageBox.Show(" Ticket Booking unsuccesful .", "Book Ticket", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            connec.Close();
        }
        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();
        }