Ejemplo n.º 1
0
 protected override void OnFirstLoad()
 {
     backgroundWorker.RunWorkerAsync();
     txtNhanVien.Text = clsXuLy.MANV.ToString();
     BUS.BUSPHONG _busPhong = new BUS.BUSPHONG();
     BUS.BUSNHANVIEN _busNhanVien = new BUS.BUSNHANVIEN();
     BUS.BUSKHACHHANG _busKhachHang = new BUS.BUSKHACHHANG();
     BUS.BUSKIEUPHONG _busKieuPhong = new BUS.BUSKIEUPHONG();
     BUS.BUSLOAIPHONG _busLoaiPhong = new BUS.BUSLOAIPHONG();
     BUS.BUSBANGGIA _busBangGia = new BUS.BUSBANGGIA();
     BUS.BUSTINHTRANG _busTinhTrang = new BUS.BUSTINHTRANG();
     lstTinhTrang = _busTinhTrang.LayTatCaTINHTRANG();
     lstBangGia = _busBangGia.LayTatCaBANGGIA();
     lstLoaiPhong = _busLoaiPhong.LayTatCaLOAIPHONG();
     lstKieuPhong = _busKieuPhong.LayTatCaKIEUPHONG();
     lstPhong = _busPhong.LayTatCaPHONG();
     lstNhanVien = _busNhanVien.LayTatCaNHANVIEN();
     lstKhachHang = _busKhachHang.LayTatCaKHACHHANG();
     glkKhachHang.Properties.DataSource = lstKhachHang;
     glkKhachHang.Properties.DisplayMember = "HOTEN";
     glkKhachHang.Properties.ValueMember = "MAKH";
     txtNhanVien.Text = clsXuLy.MANV.ToString();
     ccbeMaPhong.Properties.DataSource = lstPhong;
     ccbeMaPhong.Properties.DisplayMember = "MAPHONG";
     ccbeMaPhong.Properties.ValueMember = "MAPHONG";
     scheControl.OptionsCustomization.AllowInplaceEditor = UsedAppointmentType.None;
     scheControl.OptionsCustomization.AllowAppointmentDrag = UsedAppointmentType.None;
     scheControl.OptionsCustomization.AllowAppointmentResize = UsedAppointmentType.None;
     scheControl.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.None;
     schedulerStrorage.Resources.DataSource = lstPhong;
     schedulerStrorage.Resources.Mappings.Caption = "MAPHONG";
     schedulerStrorage.Resources.Mappings.Id = "MAPHONG";
     scheControl.GroupType = SchedulerGroupType.Resource;
     scheControl.GoToToday();
 }
Ejemplo n.º 2
0
 private void LoadKhachHang()
 {
     busPhieuNhanPhong = new BUS.BUSPHIEUNHANPHONG();
     busKhachHang = new BUS.BUSKHACHHANG();
     busLoaiKhachHang = new BUS.BUSLOAIKH();
     var _KH = (from b in busPhieuNhanPhong.LayTheoMaPHIEUNHANPHONG((int)glkvPhong.GetRowCellValue(glkvPhong.FocusedRowHandle, colMaPhieu))
               join a in busKhachHang.LayTatCaKHACHHANG() on b.MAKH equals a.MAKH
               join c in busLoaiKhachHang.LayTatCaLOAIKH() on a.MALOAIKH equals c.MALOAIKH
                select new
               {
                   MaKH = a.MAKH,
                   HoTen = a.HOTEN,
                   CMND = a.CMND,
                   DiaChi = a.DIACHI,
                   Email = a.EMAIL,
                   GioiTinh = a.GIOITINH,
                   LoaiKH = c.TENLOAIKH
               }).Last();
     txtMaKH.Text = _KH.MaKH.ToString();
     txtLKH.Text = _KH.LoaiKH;
     txtHoTen.Text = _KH.HoTen;
     txtCMND.Text = _KH.CMND;
     txtEmail.Text = _KH.Email;
     if (_KH.GioiTinh)
         txtGioiTinh.Text = "Nam";
     else
         txtGioiTinh.Text = "Nữ";
 }