Ejemplo n.º 1
0
        private void TaoTextBox_ThongTinKhachHang(CPhieuThuePhong PhieuThue)
        {
            panelKhachThuePhong.Controls.Clear();
            TextBox txtbKH_Ten, txtbKH_CMND;

            KH_Ten_Width  = (int)(0.6 * panelKhachThuePhong.Width);
            KH_CMND_Width = panelKhachThuePhong.Width - KH_Ten_Width - 5;

            int vitri = 0;

            foreach (CThongTinKhachHang ThongTin in PhieuThue.DSKhachHang)
            {
                txtbKH_CMND = TheHien.TaoTextBox(new Size(KH_CMND_Width, KH_CMND_Height), KH_Ten_Width + 5, vitri * (KH_Ten_Height + 5));
                txtbKH_Ten  = TheHien.TaoTextBox(new Size(KH_Ten_Width, KH_Ten_Height), 0, vitri * (KH_Ten_Height + 5));

                txtbKH_Ten.Tag      = "0";
                txtbKH_Ten.Name     = string.Format("txtbTenKh_{0}", 0);
                txtbKH_Ten.TabIndex = 50 + 0;

                txtbKH_Ten.Text      = ThongTin.HoTen;
                txtbKH_CMND.Text     = ThongTin.CMND;
                txtbKH_Ten.ReadOnly  = true;
                txtbKH_CMND.ReadOnly = true;
                txtbKH_Ten.Enabled   = false;
                txtbKH_CMND.Enabled  = false;

                panelKhachThuePhong.Controls.Add(txtbKH_Ten);
                panelKhachThuePhong.Controls.Add(txtbKH_CMND);

                vitri++;
            }
        }
Ejemplo n.º 2
0
        private List <CPhieuThuePhong> Chuyen_XML_Thanh_Phieu_Thue_Phong(string chuoiXml)
        {
            //MessageBox.Show(chuoiXml);
            List <CPhieuThuePhong> KQ      = new List <CPhieuThuePhong>();
            XmlDocument            TaiLieu = new XmlDocument();

            TaiLieu.LoadXml(chuoiXml);
            XmlElement Goc = TaiLieu.DocumentElement;

            foreach (XmlElement DoiTuong in Goc.ChildNodes)
            {
                CPhieuThuePhong PhieuThue = new CPhieuThuePhong();
                PhieuThue.ID            = Int32.Parse(DoiTuong.GetAttribute("ID"));
                PhieuThue.TenPhong      = DoiTuong.GetAttribute("TenPhong");
                PhieuThue.NgayBatDau    = ChuanHoaChuoiNgayThangNam(DoiTuong.GetAttribute("NgayBatDau"));
                PhieuThue.NgayDuKienTra = ChuanHoaChuoiNgayThangNam(DoiTuong.GetAttribute("NgayDuKienTra"));
                PhieuThue.NgayTra       = ChuanHoaChuoiNgayThangNam(DoiTuong.GetAttribute("NgayTra"));
                PhieuThue.MaPhong       = Int32.Parse(DoiTuong.GetAttribute("ID_Phong"));

                //Chỉ những phiếu thuê đã trả phồng mới có số tiền thuê
                if (PhieuThue.NgayTra.Length != 0)
                {
                    PhieuThue.TienThuePhong = Int32.Parse("0" + DoiTuong.GetAttribute("SoTien"));
                }
                CThongTinKhachHang ThongTin = new CThongTinKhachHang();

                string   DS_TenKhachHang = DoiTuong.GetAttribute("DS_TenKhachHang");
                string[] ChuoiTen        = DS_TenKhachHang.Split(new Char[] { '|' });

                string   DS_CMND   = DoiTuong.GetAttribute("DS_CMND");
                string[] ChuoiCMND = DS_CMND.Split(new Char[] { '|' });


                for (int i = 0; i < ChuoiTen.Count(); i++)
                {
                    if (ChuoiTen[i].Trim() != "")
                    {
                        ThongTin       = new CThongTinKhachHang();
                        ThongTin.HoTen = ChuoiTen[i];
                        ThongTin.CMND  = ChuoiCMND[i];

                        PhieuThue.DSKhachHang.Add(ThongTin);
                    }
                }


                PhieuThue.LoaiPhong = DoiTuong.GetAttribute("LoaiPhong");
                KQ.Add(PhieuThue);
            }


            return(KQ);
        }
Ejemplo n.º 3
0
        private void HienThongTin_PhieuThuePhong(CPhieuThuePhong Phieu_)
        {
            TheHien.Xuat_Chuoi(Phieu_.TenPhong, labelTenPhong);
            TheHien.Xuat_Chuoi(Phieu_.LoaiPhong, labelLoaiPhong);
            TheHien.Xuat_Chuoi(Phieu_.NgayBatDau, labelNgayBatDau);
            TheHien.Xuat_Chuoi(Phieu_.NgayDuKienTra, labelNgayDuKienTra);
            TheHien.Xuat_Chuoi(Phieu_.NgayTra, labelNgayTra);
            TheHien.Xuat_Chuoi(Phieu_.TienThuePhong + "", labelTienThuePhong);

            //Hiển thị danh sách khách hàng
            TaoTextBox_ThongTinKhachHang(Phieu_);
        }