コード例 #1
0
        public void RefreshDataBinding_ReadOnly(ThuePhongDTO thuePhong)
        {
            this.thuePhong = thuePhong;

            txtGioVao.Time = thuePhong.GioThuePhong;
            txtGioRa.Time  = (thuePhong.GioTraPhong == DateTime.MinValue) ? DateTime.Now : thuePhong.GioTraPhong;
            txtTienGio.Properties.NullText = thuePhong.TienGio.ToString("###,###,##0 VNĐ");
            TongTienGio = thuePhong.TienGio;

            txtTienGio.ReadOnly = true;
            gridView1.OptionsBehavior.ReadOnly = true;

            dichVuPhong = DichVuPhongBUS.LayTatCaDichVuPhong_DichVu(thuePhong);
            dichVuPhong.Columns.Add(new DataColumn("colType"));
            foreach (DataRow row in dichVuPhong.Rows)
            {
                if ((int)row["MaLDV"] == 3)
                {
                    row["colType"] = "Khuyến mãi";
                }
                else
                {
                    row["colType"] = "Dịch vụ";
                }
            }

            gridControl1.DataSource = dichVuPhong;
        }
コード例 #2
0
        void RefreshDataBindingDichVuPhong()
        {
            dichVuPhong             = DichVuPhongBUS.LayTatCaDichVuPhong_DichVu(thuePhong);
            gridControl1.DataSource = dichVuPhong;

            if (gridView1.RowCount == 0)
            {
                wbntQuanlyphong.Buttons["Xóa Dịch Vụ"].Properties.Visible = false;
            }
            else
            {
                wbntQuanlyphong.Buttons["Xóa Dịch Vụ"].Properties.Visible = true;
            }
        }
コード例 #3
0
        void RefreshDataBindingDichVuPhong()
        {
            dichVuPhong = DichVuPhongBUS.LayTatCaDichVuPhong_DichVu(thuePhong);
            dichVuPhong.Columns.Add(new DataColumn("colType"));
            foreach (DataRow row in dichVuPhong.Rows)
            {
                row["colType"] = "Dịch vụ";
            }

            foreach (DichVuPhongDTO khuyenMai in listKhuyenMai.Values)
            {
                DataRow dr = dichVuPhong.NewRow();

                dr["MaDVP"]       = khuyenMai.MaDVP;
                dr["MaThuePhong"] = khuyenMai.MaThuePhong;
                dr["MaDV"]        = khuyenMai.MaDV;
                dr["ThoiGian"]    = khuyenMai.ThoiGian;
                dr["SoLuong"]     = khuyenMai.SoLuong;
                dr["Gia"]         = khuyenMai.DonGia;

                DichVuDTO thongTinDichVu = DichVuBUS.LayThongTinDichVu(khuyenMai.MaDV);
                dr["TenDV"]   = thongTinDichVu.TenDV;
                dr["DonVi"]   = thongTinDichVu.DonVi;
                dr["MaLDV"]   = thongTinDichVu.MaLoaiDV;
                dr["TenLDV"]  = "Khuyến mãi";
                dr["colType"] = "Khuyến mãi";

                dichVuPhong.Rows.Add(dr);
            }

            gridControl1.DataSource = dichVuPhong;



            gridView1.ExpandAllGroups();
        }