public IHttpActionResult DanhSachKhachHangChungPhongDichVuPhong([FromUri] int id)
 {
     using (NhanVienBusiness nhanVien = new NhanVienBusiness())
     {
         return(Ok(nhanVien.DanhSachKhachHangChungPhongDichVuPhong(id)));
     }
 }
 public IHttpActionResult LayDanhSachDoanDatPhongThatBai()
 {
     using (NhanVienBusiness nhanVienBusiness = new NhanVienBusiness())
     {
         return(Ok(nhanVienBusiness.LayDanhSachDoanTheoTrangThaiDatPhong(-1)));
     }
 }
 public IHttpActionResult LayDanhSachKhachHangTheoMaDoan([FromUri] string id)
 {
     using (NhanVienBusiness khachHangBusiness = new NhanVienBusiness())
     {
         return(Ok(khachHangBusiness.LayDanhSachKhachHangTheoMaDoan(id)));
     }
 }
 public IHttpActionResult LayDanhSachDichVu()
 {
     using (NhanVienBusiness nhanVien = new NhanVienBusiness())
     {
         return(Ok(nhanVien.LayDanhSachDichVu()));
     }
 }
 public IHttpActionResult DatPhongChoNhieuDoan()
 {
     using (NhanVienBusiness nhanVienBusiness = new NhanVienBusiness())
     {
         return(Ok(nhanVienBusiness.DatPHongNhieuDoanKhachHang()));
     }
 }
 public IHttpActionResult LayDanhSachDoan()
 {
     using (NhanVienBusiness nhanvien = new NhanVienBusiness())
     {
         return(Ok(nhanvien.LayDanhSachDoanTheoTrangThaiDatPhong(0)));
     }
 }
 public IHttpActionResult XoaDoan([FromUri] string id)
 {
     using (NhanVienBusiness nhanVienBusiness = new NhanVienBusiness())
     {
         return(Ok(nhanVienBusiness.XoaDoan(id)));
     }
 }
示例#8
0
        public int SoLuongPhongTheoDieuKien()
        {
            DateTime         ngayNhan = new DateTime(2020, 8, 20);
            DateTime         ngayTra  = new DateTime(2020, 8, 20);
            NhanVienBusiness nhanvien = new NhanVienBusiness();

            return(nhanvien.LayDanhSachPhongTheoDieuKien(ngayNhan, ngayTra).Count);
        }
示例#9
0
 public Data_Test()
 {
     khachHang_MotDoanDTOs = models.KhachHangs.Where(kh => kh.MaDoan.Equals("1597352230776")).Select(kh => new KhachHangDTO
     {
         ID                   = kh.ID,
         HoVaTen              = kh.HoVaTen,
         SoDienThoai          = kh.SoDienThoai,
         Email                = kh.Email,
         DiaChi               = kh.DiaChi,
         Nhom                 = kh.Nhom,
         NguoiDaiDienCuaTreEm = kh.NguoiDaiDienCuaTreEm,
         ThoiGianNhan         = kh.ThoiGianNhan,
         ThoiGianTra          = kh.ThoiGianTra,
         MaDoan               = kh.MaDoan,
         GioiTinh             = kh.GioiTinh,
         LoaiKhachHang        = kh.LoaiKhachHang,
         TruongDoan           = kh.TruongDoan,
         IsDelete             = kh.IsDelete,
         TrangThaiDatPhong    = kh.TrangThaiDatPhong,
         IDPhong              = kh.IDPhong,
         TrangThaiXacNhan     = kh.TrangThaiXacNhan
     }).ToList();
     khachHangDTOs = models.KhachHangs.Where(kh => kh.TrangThaiDatPhong >= 0 && kh.IsDelete != true).Select(kh => new KhachHangDTO
     {
         ID                   = kh.ID,
         HoVaTen              = kh.HoVaTen,
         SoDienThoai          = kh.SoDienThoai,
         Email                = kh.Email,
         DiaChi               = kh.DiaChi,
         Nhom                 = kh.Nhom,
         NguoiDaiDienCuaTreEm = kh.NguoiDaiDienCuaTreEm,
         ThoiGianNhan         = kh.ThoiGianNhan,
         ThoiGianTra          = kh.ThoiGianTra,
         MaDoan               = kh.MaDoan,
         GioiTinh             = kh.GioiTinh,
         LoaiKhachHang        = kh.LoaiKhachHang,
         TruongDoan           = kh.TruongDoan,
         IsDelete             = kh.IsDelete,
         TrangThaiDatPhong    = kh.TrangThaiDatPhong,
         IDPhong              = kh.IDPhong,
         TrangThaiXacNhan     = kh.TrangThaiXacNhan
     }).ToList();
     phongDTOs = models.Phongs.Where(p => p.IsDelete != true).Select(p => new PhongDTO
     {
         ID        = p.ID,
         MaPhong   = p.MaPhong,
         SoPhong   = p.SoPhong,
         LoaiPhong = p.LoaiPhong,
         Gia       = p.Gia,
         TrangThai = p.TrangThai,
         IsDelete  = p.IsDelete
     }).ToList();
     idPhong   = 236;
     nhanvien  = new NhanVienBusiness();
     home      = new HomeBusiness();
     khachhang = new KhachHangBusiness();
 }
示例#10
0
        //Update thông tin thiết lập, thông tin nhân viên hiển thị trên giao diện main
        private void UpdateThongTin()
        {
            //Update thông tin nhân viên
            _NhanVien = NhanVienBusiness.Lay1NhanVien(_NhanVien.MaNV_NV);
            HienThiNhanVien();

            //Update thông tin thiết lập hiển thị
            _thietLap = ThietLapHeThongBusiness.LayThietLapHeThong();
            HienThiCuaHang();
        }
        public IHttpActionResult LayDanhSachPhongTheoDieuKien([FromBody] dynamic dynamic)
        {
            if (dynamic == null)
            {
                return(BadRequest());
            }
            ThoiGianDatPhongDTO thoiGianDatPhong = JsonConvert.DeserializeObject <ThoiGianDatPhongDTO>(dynamic.ToString());

            using (NhanVienBusiness nhanVienBusiness = new NhanVienBusiness())
            {
                return(Ok(nhanVienBusiness.LayDanhSachPhongTheoDieuKien(thoiGianDatPhong.NgayNhan, thoiGianDatPhong.NgayTra)));
            }
        }
 public IHttpActionResult LayThongTinChiPhiPhong([FromUri] int id)
 {
     using (NhanVienBusiness nhanVien = new NhanVienBusiness())
     {
         if (nhanVien.LayThongTinChiPhiPhong(id) == null)
         {
             return(BadRequest("Khách hàng không gọi dịch vụ!"));
         }
         else
         {
             return(Ok(nhanVien.LayThongTinChiPhiPhong(id)));
         }
     }
 }
 public IHttpActionResult XoaDichVuPhong([FromUri] int id)
 {
     using (NhanVienBusiness nhanVien = new NhanVienBusiness())
     {
         string status = nhanVien.XoaDichVuPhong(id);
         if (status.Equals("ok"))
         {
             return(Ok("Xóa thành công!"));
         }
         else
         {
             return(BadRequest("Xóa thất bại!"));
         }
     }
 }
示例#14
0
        //LOAD DATA TO DATAGRID
        void LoadDataToDataGrid()
        {
            _dtNV = NhanVienBusiness.DsNhanVien().Tables[0];
            for (int i = 0; i < _dtNV.Rows.Count; i++)
            {
                //Get path Img
                string _imgName = _dtNV.Rows[i]["Anh_NV"].ToString();
                if (!String.IsNullOrEmpty(_imgName))
                {
                    _dtNV.Rows[i]["Anh_NV"] = GetPathImageStaff(_imgName);
                }
            }

            dgNhanVien.ItemsSource = _dtNV.DefaultView;
        }
        public IHttpActionResult ThemMoiDichVuPhong([FromBody] dynamic dynamic)
        {
            LichSuDichVuDTO lichSuDichVuDTO = JsonConvert.DeserializeObject <LichSuDichVuDTO>(dynamic.ToString());

            using (NhanVienBusiness nhanVien = new NhanVienBusiness())
            {
                if (nhanVien.ThemMoiDichVuPhong(lichSuDichVuDTO))
                {
                    return(Ok("Thêm mới thành công!!!"));
                }
                else
                {
                    return(BadRequest("Thêm mới thất bại!!!"));
                }
            }
        }
        public IHttpActionResult KhachHangTraPhong([FromBody] dynamic dynamic)
        {
            string cmnd = dynamic.CMND.ToString();

            using (NhanVienBusiness nhanVien = new NhanVienBusiness())
            {
                string status = nhanVien.KhachHangTraPhong(cmnd);
                if (status.Equals("ok"))
                {
                    return(Ok("Trả phòng thành công!"));
                }
                else
                {
                    return(BadRequest(status));
                }
            }
        }
        public IHttpActionResult KhachHangNhanPhong([FromBody] dynamic dynamic)
        {
            KhachHangNhanPhongDTO khachHang = JsonConvert.DeserializeObject <KhachHangNhanPhongDTO>(dynamic.ToString());

            using (NhanVienBusiness nhanVien = new NhanVienBusiness())
            {
                string status = nhanVien.KhachHangNhanPhong(khachHang.IDPhong, khachHang.HoVaTen, khachHang.CMND);
                if (status.Equals("ok"))
                {
                    return(Ok("Nhận phòng thành công!"));
                }
                else
                {
                    return(BadRequest(status));
                }
            }
        }
        public IHttpActionResult DatPhongChoTungDoan([FromUri] string id)
        {
            string result = "";

            using (NhanVienBusiness nhanVienBusiness = new NhanVienBusiness())
            {
                result = nhanVienBusiness.DatPhongChoMotDoan(id);
                if (result.Equals("ok"))
                {
                    return(Ok(result));
                }
                else
                {
                    return(BadRequest(result));
                }
            }
        }
示例#19
0
        //Nút xóa
        private void btnXoa_Click(object sender, RoutedEventArgs e)
        {
            DataRowView _drv   = (DataRowView)dgNhanVien.SelectedItem;
            string      _MaNV  = _drv["MaNV_NV"].ToString();
            string      _TenNV = _drv["HoTen_NV"].ToString();

            if (NhanVienBusiness.DeleteStaff(_MaNV))
            {
                lbWarning.Visibility = System.Windows.Visibility.Visible;
                lbWarning.Content    = "Xóa nhân viên " + _TenNV + " thành công!";
                ucNhanVien_Loaded(sender, e);
            }
            else
            {
                lbWarning.Visibility = System.Windows.Visibility.Visible;
                lbWarning.Content    = "Xóa nhân viên thất bại. Không thể xóa nhân viên " + _TenNV;
            }
        }
示例#20
0
        //PHƯƠNG THỨC THÊM MỚI
        void ThemNhanVien(object sender, EventArgs e)
        {
            #region 1. Lấy thông tin
            NhanVienThemPresentation wpf = (NhanVienThemPresentation)sender;
            NhanVienPublic           _nv = wpf._nv;
            _nv.Anh_NV = CoppyAnhNV(_nv.Anh_NV, _nv.MaNV_NV);
            #endregion

            #region 2. Lưu vào csdl
            if (NhanVienBusiness.ThemNhanVien(_nv))
            {
                LoadDataToDataGrid();
            }
            else
            {
                MessageBox.Show("Thêm nhân viên thất bại");
            }
            #endregion
        }
        public IHttpActionResult DatPhongThuNghiem([FromBody] dynamic dynamic)
        {
            if (dynamic == null)
            {
                return(BadRequest());
            }
            List <KhachHangDTO> lstKhachHang = JsonConvert.DeserializeObject <List <KhachHangDTO> >(dynamic.ToString());

            using (NhanVienBusiness nhanVienBusiness = new NhanVienBusiness())
            {
                string result = nhanVienBusiness.DatPhongThuNghiem(lstKhachHang);
                if (result.Equals("ok"))
                {
                    return(Ok(result));
                }
                else
                {
                    return(BadRequest(result));
                }
            }
        }
示例#22
0
        //METHOD UPDATE STAFF
        void UpdateStaff(object sender, EventArgs e)
        {
            #region 1. Get new staff
            NhanVienSuaPresentation wpf    = (NhanVienSuaPresentation)sender;
            NhanVienPublic          _staff = wpf._staff;
            _staff.Anh_NV = CoppyAnhNV(_staff.Anh_NV, _staff.MaNV_NV);
            #endregion

            #region 2. Update to database
            if (NhanVienBusiness.UpdateStaff(_staff))
            {
                LoadDataToDataGrid();
                EventHandler _eh = _CapNhatHienThi;
                if (_eh != null)
                {
                    _eh(this, e);
                }
            }
            else
            {
                MessageBox.Show("Sửa thông tin nhân viên thất bại");
            }
            #endregion
        }
示例#23
0
 public NhanVien_UnitTest()
 {
     data_test  = new Data_Test();
     controller = new NhanVienController();
     business   = new NhanVienBusiness();
 }