예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {

            revision r = new revision();
            r.lbl_name.Text = user_content.name;
            r.lbl_idtrain.Text = arr[0];
            r.lbl_statues.Text = "ذهاب";
            r.lbl_class.Text = Booking.Class;
            r.lbl_from.Text = arr[1];
            r.lbl_to.Text = arr[3];
            r.lbl_price.Text = arr[5];
            r.lbl_date.Text = Booking.date;
            r.lbl_trtype.Text = arr[6];



            if (Booking.statues)
            {
                r.label17.Text = user_content.name;
                r.label23.Text = brr[0];
                r.label14.Text = Booking.date2;
                r.label19.Text = "عوده";
                r.label22.Text = Booking.Class2;
                r.label21.Text = brr[1];
                r.label20.Text = brr[3];
                r.label18.Text = brr[5];
                r.label5.Text = brr[6];



            }
            if (Booking.statues)
            {
                if (!(r.lbl_idtrain.Text == "A" && r.label23.Text == "A"))
                {
                    r.Show();
                    this.Hide();
                }
                else MessageBox.Show("الرجاء تحديد القطارات");
            }
            else
            {
                if (!(r.lbl_idtrain.Text == "A"))
                {
                    r.Show();
                    this.Hide();
                }
                else MessageBox.Show("الرجاء تحديد القطار");
            }
        }
예제 #2
0
        public static void reverse2(string CLASS, int indt, int inds, int fromm, int too, string uu, string from, string to)
        {
            flag  = false;
            carr  = 0;
            seatt = 0;
            if (CLASS == "one")
            {
                for (int car = 0; car < 3; car++)
                {
                    for (int seat = 0; seat < 45; seat++)
                    {
                        if (arrd[inds].arr[indt].one[car, seat] == false)
                        {
                            arrd[inds].arr[indt].one[car, seat] = true;
                            seatt = seat + 1;
                            carr  = car + 1;
                            flag  = true;
                            break;
                        }
                    }
                    if (flag)
                    {
                        break;
                    }
                }
            }

            else
            {
                for (int car = 0; car < 6; car++)
                {
                    for (int seat = 0; seat < 60; seat++)
                    {
                        if (arrd[inds].arr[indt].two[car, seat] == false)
                        {
                            arrd[inds].arr[indt].two[car, seat] = true;
                            seatt = seat + 1;
                            carr  = car + 1 + 3;
                            flag  = true;
                            break;
                        }
                    }
                    if (flag)
                    {
                        break;
                    }
                }
            }
            if (!flag)
            {
                MessageBox.Show(" .  لا يوجد قطار متاحه الرجاء تغيير القطار او الدرجه ");

                /*Booking f2 = new Booking();
                 * f2.Show();*/
            }
            else
            {
                string dd = DateTime.Today.ToString("yyyy-MM-dd");
                try
                {
                    revision r = new revision();
                    idticket1 = new Random().Next(1000000, 9000000);
                    if (uu == "go")
                    {
                        tickets.insert(idticket1.ToString(), user_content.name, seatt.ToString(),
                                       Booking.date, to, from,
                                       Login.username, Train_chooser.arr[0], carr.ToString(), dd);
                        MessageBox.Show("تم الحجز بنجاح");
                    }
                    else
                    {
                        tickets.insert(idticket1.ToString(), user_content.name, seatt.ToString(),
                                       Booking.date2, to, from,
                                       Login.username, Train_chooser.brr[0], carr.ToString(), dd);
                        MessageBox.Show("تم الحجز بنجاح");
                    }
                }
                catch (Exception)
                {
                }
            }
        }