Exemple #1
0
        private void InitializeThongTinChung()
        {
            PhieuCheckIn_WCFClient pci_wcf = new PhieuCheckIn_WCFClient();
            NhanVien_WCFClient     nv_wcf  = new NhanVien_WCFClient();

            txtIdPhieu.Text = (pci_wcf.GetPhieuCheckIns()[pci_wcf.GetPhieuCheckIns().Length - 1].Id_phieu_checkin + 1).ToString();
            txtHoTenNV.Text = (nv_wcf.GetHoTen_NhanVien(ID_NV));
        }
Exemple #2
0
        private void btnReaload_Click(object sender, EventArgs e)
        {
            PhieuCheckIn_WCFClient  p_wcf = new PhieuCheckIn_WCFClient();
            List <PhieuCheckIn_Ent> list  = new List <PhieuCheckIn_Ent>();

            list = p_wcf.GetPhieuCheckIns().ToList();

            Loading_DSP(DataTable_DSP(list));
            Custom_DataGridView(dgv_DSPhieuCheckIn);
        }
Exemple #3
0
        private void frmThongKe_Load(object sender, EventArgs e)
        {
            PhieuCheckIn_WCFClient  p_wcf = new PhieuCheckIn_WCFClient();
            List <PhieuCheckIn_Ent> list  = new List <PhieuCheckIn_Ent>();

            list = p_wcf.GetPhieuCheckIns().ToList();

            Loading_BaoCao(DataTable_DSP(list));
            Custom_DataGridView(dgv_BaoCao);
        }
Exemple #4
0
        private void frmDatPhong_Load(object sender, EventArgs e)
        {
            PhieuCheckIn_WCFClient  p_wcf = new PhieuCheckIn_WCFClient();
            List <PhieuCheckIn_Ent> list  = new List <PhieuCheckIn_Ent>();

            list = p_wcf.GetPhieuCheckIns().ToList();

            InitializeThongTinChung();

            //Khởi Tao Dữ Liệu Ban Đầu
            string[] LoaiPhong = { "", "Phòng Standard", "Phòng Deluxe", "Phòng Express View", "Phòng VIP" };
            cbx_LoaiPhong.DataSource = LoaiPhong;
            txtThue.Text             = "10";
            txtPhuThu.Text           = "0";
            txtGiamGia.Text          = "0";
            txtTimKiem.Text          = "123456789";

            Loading_DSP(DataTable_DSP(list));
            Custom_DataGridView(dgv_DSPhieuCheckIn);
        }
Exemple #5
0
        private void txtSoPhong_TextChanged(object sender, EventArgs e)
        {
            Phong_WCFClient        p_wcf   = new Phong_WCFClient();
            PhieuCheckIn_WCFClient pck_wcf = new PhieuCheckIn_WCFClient();
            KhachHang_WCFClient    kh_wcf  = new KhachHang_WCFClient();

            int idKhach = 0;

            int idPhong = p_wcf.GetIDPhong_by_SoPhong(txtSoPhong.Text.Trim());

            foreach (var item in pck_wcf.GetPhieuCheckIns())
            {
                if (item.Id_Phong == idPhong && item.TrangThaiHoaDon == 0)
                {
                    idKhach = item.Id_khach;
                    break;
                }
            }

            txtHoTenKH.Text = kh_wcf.getHoKhacHang_byID(idKhach) + " " + kh_wcf.getTenKhacHang_byID(idKhach);
        }
Exemple #6
0
        private void btnThanhToan_Click(object sender, EventArgs e)
        {
            DichVu_WCFClient       dv_wcf   = new DichVu_WCFClient();
            Phong_WCFClient        p_wcf    = new Phong_WCFClient();
            PhieuCheckIn_WCFClient pck_wcf  = new PhieuCheckIn_WCFClient();
            KhachHang_WCFClient    kh_wcf   = new KhachHang_WCFClient();
            PhieuCheckIn_Ent       p_dv_ent = new PhieuCheckIn_Ent();
            int idPhong = p_wcf.GetIDPhong_by_SoPhong(txtSoPhong.Text.Trim());

            if (txtSoPhong.Text.Trim().Equals(""))
            {
                MessageBox.Show("Nhập Số Phòng", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            int idKhach = 0;

            foreach (var item in pck_wcf.GetPhieuCheckIns())
            {
                if (item.Id_Phong == idPhong && item.TrangThaiHoaDon == 0)
                {
                    idKhach = item.Id_khach;
                }
            }

            PhieuCheckIn_Ent p_ent = new PhieuCheckIn_Ent();

            foreach (var item in pck_wcf.GetPhieuCheckIns().ToList())
            {
                if (item.Id_khach == idKhach)
                {
                    p_ent.Ngay_check_in  = item.Ngay_check_in;
                    p_ent.Gio_check_in   = item.Gio_check_in;
                    p_ent.Ngay_check_out = item.Ngay_check_out;
                    p_ent.Gio_check_out  = item.Gio_check_out;
                    p_ent.Giam_gia       = item.Giam_gia;
                    p_ent.SoLuongKhach   = item.SoLuongKhach;
                }
            }

            int checkLoi = 0;

            for (int i = 0; i < dgvCTDV.Rows.Count - 1; i++)
            {
                p_dv_ent.Id_Phong        = idPhong;
                p_dv_ent.Id_khach        = Convert.ToInt32(idKhach);
                p_dv_ent.Id_NhanVien     = idNhanVien;
                p_dv_ent.Id_DichVu       = dv_wcf.GetIDDichVu_byTenDV(dgvCTDV.Rows[i].Cells[0].Value.ToString());
                p_dv_ent.SoLuongDichVu   = Convert.ToInt32(dgvCTDV.Rows[i].Cells[1].Value);
                p_dv_ent.Ngay_check_in   = (DateTime)p_ent.Ngay_check_in;
                p_dv_ent.Gio_check_in    = p_ent.Gio_check_in;
                p_dv_ent.Ngay_check_out  = p_ent.Ngay_check_out;
                p_dv_ent.Gio_check_out   = p_ent.Gio_check_out;
                p_dv_ent.Giam_gia        = p_ent.Giam_gia;
                p_dv_ent.SoLuongKhach    = p_ent.SoLuongKhach;
                p_dv_ent.TrangThaiHoaDon = 1;
                p_dv_ent.SoLuongDichVu   = Convert.ToInt32(dgvCTDV.Rows[i].Cells[1].Value.ToString().Trim());

                if (!pck_wcf.ThemPhieuCheckIn_DichVu(p_dv_ent))
                {
                    checkLoi = 1;
                    MessageBox.Show("Có Lỗi Xảy Ra!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            if (checkLoi == 0)
            {
                MessageBox.Show("Lưu Thành Công", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
        }