Пример #1
0
        private void btnDatNgay_Click(object sender, EventArgs e)
        {
            GUI_DatTour giaodien = new GUI_DatTour(tour);

            this.Hide();
            giaodien.ShowDialog();
        }
Пример #2
0
        void them(string picturebox, string lbTenTour, string lbthoigiantour, string lbNgayKhoiHanh, string lbGia, string btnchitiet, string btndatngay, int x, int y, DTO_Tour tour)
        {
            System.Windows.Forms.GroupBox   groupBox          = new GroupBox();
            System.Windows.Forms.PictureBox pic               = new PictureBox();
            System.Windows.Forms.Label      LabelGia          = new Label();
            System.Windows.Forms.Label      LabelNgayKhoiHanh = new Label();
            System.Windows.Forms.Label      Labelthoigiantour = new Label();
            System.Windows.Forms.Label      LabelTenTour      = new Label();
            System.Windows.Forms.Button     buttonchitiet     = new Button();
            System.Windows.Forms.Button     buttondatngay     = new Button();

            this.panelDSTour.Controls.Add(groupBox);
            groupBox.Controls.Add(pic);
            groupBox.Controls.Add(LabelTenTour);
            groupBox.Controls.Add(Labelthoigiantour);
            groupBox.Controls.Add(LabelNgayKhoiHanh);
            groupBox.Controls.Add(LabelGia);
            groupBox.Controls.Add(buttonchitiet);
            groupBox.Controls.Add(buttondatngay);

            groupBox.Location = new System.Drawing.Point(x, y);
            groupBox.Size     = new System.Drawing.Size(450, 187);

            pic.Location = new System.Drawing.Point(6, 13);
            pic.Name     = picturebox;
            pic.Size     = new System.Drawing.Size(211, 168);
            pic.Image    = System.Drawing.Image.FromFile(tour.LinkAnh.Trim());
            pic.SizeMode = PictureBoxSizeMode.StretchImage;

            LabelTenTour.AutoSize = true;
            LabelTenTour.Location = new System.Drawing.Point(223, 18);
            LabelTenTour.Name     = lbTenTour;
            LabelTenTour.Size     = new System.Drawing.Size(53, 17);
            LabelTenTour.Text     = tour.TenTour.Trim();

            Labelthoigiantour.AutoSize = true;
            Labelthoigiantour.Location = new System.Drawing.Point(223, 51);
            Labelthoigiantour.Name     = lbthoigiantour;
            Labelthoigiantour.Size     = new System.Drawing.Size(130, 17);
            Labelthoigiantour.Text     = tour.ThoiGianTour.Trim();

            LabelNgayKhoiHanh.AutoSize = true;
            LabelNgayKhoiHanh.Location = new System.Drawing.Point(223, 84);
            LabelNgayKhoiHanh.Name     = lbNgayKhoiHanh;
            LabelNgayKhoiHanh.Size     = new System.Drawing.Size(109, 17);
            LabelNgayKhoiHanh.Text     = "Ngày Khởi Hành: " + tour.NgayKhoiHanh.Trim();

            LabelGia.AutoSize = true;
            LabelGia.Location = new System.Drawing.Point(223, 117);
            LabelGia.Name     = lbGia;
            LabelGia.Size     = new System.Drawing.Size(30, 17);
            LabelGia.Text     = tour.GiaTour.ToString().Trim() + " / cho 1 vé";

            buttonchitiet.Location = new System.Drawing.Point(226, 143);
            buttonchitiet.Name     = btnchitiet;
            buttonchitiet.Size     = new System.Drawing.Size(75, 38);
            buttonchitiet.Text     = "Chi Tiết";
            buttonchitiet.Click   += Buttonchitiet_Click;

            buttondatngay.Location = new System.Drawing.Point(307, 143);
            buttondatngay.Name     = btndatngay;
            buttondatngay.Size     = new System.Drawing.Size(99, 38);
            buttondatngay.Text     = "Đặt Ngay";
            buttondatngay.Click   += Buttondatngay_Click;

            void Buttondatngay_Click(object sender, EventArgs e)
            {
                //buttondatngay = sender as Button;
                GUI_DatTour giaodien = new GUI_DatTour(tour);

                this.Hide();
                giaodien.ShowDialog();
            }

            void Buttonchitiet_Click(object sender, EventArgs e)
            {
                //buttonchitiet = sender as Button;
                GUI_ChiTietTour giaodien = new GUI_ChiTietTour(tour);

                this.Hide();
                giaodien.ShowDialog();
            }
        }