コード例 #1
0
        public void Hotels()
        {
            HOTEL ht = new HOTEL();

            if (hchange.hotelname.SelectedIndex == 0 || hchange.hotelname.SelectedIndex == 4)
            {
                rate = 550;
            }
            else
            {
                rate = 350;
            }
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        public void Assignvalues()
        {
            HOTEL ht = new HOTEL();

            if (ht.hotelname.Text != "" && ht.roomtype.Text != "" && ht.roomsno.Value != 0 && ht.transport.Text != "" &&
                ht.days.Value != 0)
            {
                MessageBox.Show("Please fill all teh fields", "Fields Missing", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                hname     = hchange.hotelname.Text;
                roomtype  = hchange.roomtype.Text;
                rooms     = Convert.ToInt32(hchange.roomsno.Value);
                transport = hchange.transport.Text;
                days      = Convert.ToInt32(hchange.days.Value);
                if (hchange.hspecial.Checked == true)
                {
                    hbill += 50;
                }
                if (hchange.hvegan.Checked == true)
                {
                    hbill += 100;
                }
                else
                {
                    hchange.hregular.Checked = true; hbill += 20;
                }
                if (hchange.hundredmbs.Checked == true)
                {
                    hbill += 100;
                }
                else
                {
                    hchange.fiftymbs.Checked = true; hbill += 50;
                }
                int a = Convert.ToInt32(hchange.roomsno.Value) * rate;
                hbill += Convert.ToInt32(ht.days.Value) * a;
                MessageBox.Show(hname);
                DOperations dao = new DOperations();
                dao.bookhotel(hname, rooms, days, transport, roomtype);
                ShowInformation();
                ShowBill();
            }
        }