private void cboMaKhachHang_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         KhachHang kh = new KhachHang();
         kh = khachHang.LayTTKhachHang(cboMaKhachHang.EditValue.ToString());
         txtTK.EditValue    = kh.SDT.ToString().Trim();
         txtEmail.EditValue = kh.Email.ToString().Trim();
     }
     catch (Exception ex)
     {
         string error = ex.ToString();
     }
 }
Пример #2
0
        private void LayThongTinDKThue(string ma)
        {
            BLL_KhachHang khachHang = new BLL_KhachHang();
            var           tt        = thueMB.LayThongTinDKThue(ma);

            if (tt != null)
            {
                maHD = tt.MaHD;
            }
            if (tt != null)
            {
                var      mb     = thueMB.LayThongTinMB(tt.MatBang);
                var      kh     = khachHang.LayTTKhachHang(tt.MaKhachHang);
                var      hoaDon = thueMB.HoaDon(tt.MaHD);
                DateTime ngayHetHan;
                DateTime ngayThue = (DateTime)tt.NgayMoCua;
                ngayHetHan                = ngayThue.AddYears(1);
                txtKhachHang.EditValue    = kh.MaKH;
                txtSDT.EditValue          = kh.SDT;
                txtTenKhachHang.EditValue = kh.HoTenKH;
            }
        }
        private void LayThongTinDKThue(string ma)
        {
            var tt = thueMB.LayThongTinDKThue(ma);

            if (tt != null)
            {
                var mb     = thueMB.LayThongTinMB(tt.MatBang);
                var kh     = khachHang.LayTTKhachHang(tt.MaKhachHang);
                var hoaDon = thueMB.HoaDon(ma);
                thoiHanThue = (int)tt.ThoiHanThue;
                txtThoiHanThue.EditValue = thoiHanThue;
                ngayThue                 = (DateTime)tt.NgayMoCua;
                ngayHetHan               = ngayThue.AddYears(int.Parse(txtThoiHanThue.EditValue.ToString()));
                txtNgayThue.EditValue    = tt.NgayMoCua;
                txtNgayHetHan.EditValue  = ngayHetHan;
                txtThoiHanThue.EditValue = tt.ThoiHanThue;
                if (hoaDon != null)
                {
                    txtTienCoc.EditValue = String.Format("{0:0,0 vnđ}", hoaDon.SoTien);
                    maHD    = hoaDon.MaHD;
                    tienCoc = (int)hoaDon.SoTien;
                }
                else
                {
                    txtTienCoc.EditValue = "";
                    AnHienButtonAddHoaDon(true);
                }
                txtPhiDV.EditValue       = string.Format("{0:0,0 vnđ/năm}", thueMB.PhiDichVu((int)mb.DienTich));
                txtMaMB.EditValue        = tt.MatBang;
                txtMaKhachHang.EditValue = kh.MaKH;
                txtViTri.EditValue       = mb.ViTri;
                txtDienTich.EditValue    = string.Format("{0:0 (m2)}", mb.DienTich);
                //tienCoc = (int)hoaDon.SoTien;

                phiDV = (int)thueMB.PhiDichVu((int)mb.DienTich);
            }
        }