Exemple #1
0
        void Main()
        {
            var tenPhim = LayTenPhim();

            if (tenPhim != null)
            {
                var thoiGian = LayThoiGian();
                if (thoiGian != null)
                {
                    var phong = LayPhong();
                    if (phong != null)
                    {
                        var ghe = LayGhe();
                        if (ghe.Count > 0)
                        {
                            if (!string.IsNullOrWhiteSpace(txtSDT.Text) || !string.IsNullOrWhiteSpace(txtTenKhachHang.Text))
                            {
                                var x  = new VeXemPhim(tenPhim, thoiGian, phong, txtTenKhachHang.Text, txtSDT.Text, ghe);
                                var xd = new XacNhan(x);
                                xd.ShowDialog();
                            }
                            else
                            {
                                MessageBox.Show("không được để sdt,tên khách hàng trống");
                            }
                        }
                        else
                        {
                            MessageBox.Show("vui lòng chọn ghế xem");
                        }
                    }
                }
            }
        }
 void CapNhat(VeXemPhim x)
 {
     txtTenPhim.Text      = x.TenPhim;
     txtThoiGian.Text     = x.ThoiGian;
     txtPhong.Text        = x.Phong;
     txtSdt.Text          = x.SDT;
     txtTenKhachHang.Text = x.TenKh;
     foreach (var item in x.Ghe)
     {
         txtSoGhe.Text += item + ",";
     }
     txtTien.Text = (x.Ghe.Count * 70000).ToString();
 }
 public XacNhan(VeXemPhim x) : this()
 {
     CapNhat(x);
 }