Exemplo n.º 1
0
        private void frmRooms_Load(object sender, EventArgs e)
        {
            roomTypeDataTable = roomTypeBUS.GetAllRoomType();
            //Binding data
            lkRoomTypeName.Properties.DataSource = roomTypeDataTable;
            lkRoomTypeName.Properties.DisplayMember = "RoomTypeName";
            lkRoomTypeName.Properties.ValueMember = "RoomTypeID";
            //
            statusDataTable = statusBUS.GetAllStatus();
            lkStatus.Properties.DataSource = statusDataTable;
            lkStatus.Properties.DisplayMember = "StatusName";
            lkStatus.Properties.ValueMember = "StatusID";
            //
            roomDataTable = roomBUS.GetAllRoomWithDate();
            grdListRooms.DataSource = roomDataTable;

            // -------------------------- search -------------------------- --------------

            // tag range

            //search engine init
            _GridFilter = new GridFilter(grdvListRooms);
            _GridFilter.AddTextbox("RoomID", txtRoomId);
            _GridFilter.AddTextbox("RoomName", txtRoomName);
            _GridFilter.AddTextbox("RoomTypeID", lkRoomTypeName, true, false);
            _GridFilter.AddTextbox("StatusID", lkStatus, true, false);
            _GridFilter.AddTextbox("NumberOfBeds", txtNumberOfBeds, true, false);
            _GridFilter.AddDateControl("StartDate", dateFrom, true, false);
            _GridFilter.AddDateControl("EndDate", dateTo, true, false);

            dateFrom.DateTime = DateTime.Now;
            dateTo.DateTime = DateTime.Now;

            InitForSeachForm init = new InitForSeachForm();
            init.Init(this, _GridFilter, txtSearchDelay, rgrSearAfter);

            init.SearchWhenTextChanged(lkRoomTypeName);
            init.SearchWhenTextChanged(dateFrom);
            init.SearchWhenTextChanged(dateTo);
            init.SearchWhenTextChanged(lkStatus);
            init.SearchWhenTextChanged(txtNumberOfBeds);
            init.SearchWhenTextChanged(txtRoomName);
            // assign
        }
Exemplo n.º 2
0
        private void frmCustomer_Load(object sender, EventArgs e)
        {
            customerDataTable = customerBUS.GetAllCustomer();
            grdListCustomer.DataSource = customerDataTable;
            //
            minAge = Int32.Parse(ruleBUS.GetRuleByLabel("DoTuoiNhanVienToiThieu"));
            maxAge = Int32.Parse(ruleBUS.GetRuleByLabel("DoTuoiNhanVienToiDa"));

            // -------------------------- search -------------------------- --------------

            // tag
            dateBirthDay.Tag = dateBirthDayMax;

            //search engine init
            _GridFilter = new GridFilter(grdvListCustomer);
            _GridFilter.AddTextbox("CustomerID", txtCustomerId);
            _GridFilter.AddTextbox("CustomerName", txtCustomerName);
            _GridFilter.AddTextbox("Gender", cmbCustomerGender, false);
            _GridFilter.AddDateControl("DateOfBirth", dateBirthDay);
            _GridFilter.AddTextbox("Address", txtCustomerAddress);
            _GridFilter.AddTextbox("PhoneNumber", txtCustomerPhone);
            _GridFilter.AddTextbox("Email", txtCustomerEmail);
            _GridFilter.AddTextbox("IDNumber", txtCMND);

            // assign
            dateBirthDayMax.DateTime = DateTime.Now.AddYears(-15);
            dateBirthDay.DateTime = dateBirthDayMax.DateTime.AddYears(-50);

            //event
            InitForSeachForm init = new InitForSeachForm();
            init.Init(this, _GridFilter, txtSearchDelay, rgrSearAfter);
            init.SearchWhenTextChanged(dateBirthDay);
            init.SearchWhenTextChanged(dateBirthDayMax);
            init.SearchWhenTextChanged(cmbCustomerGender);
        }
Exemplo n.º 3
0
        private void frmStaff_Load(object sender, EventArgs e)
        {
            //
            rolePermissionDataTable = rolePermissionBUS.GetAllRolePermission();
            lkStaffCharge.Properties.DataSource = rolePermissionDataTable;
            lkStaffCharge.Properties.DisplayMember = "RolePermissionName";
            lkStaffCharge.Properties.ValueMember = "RolePermissionID";
            //
            _StaffDT = staffBUS.GetAllStaff();
            grdListStaff.DataSource = _StaffDT;
            //
            minAge = Int32.Parse(ruleBUS.GetRuleByLabel("DoTuoiNhanVienToiThieu"));
            maxAge = Int32.Parse(ruleBUS.GetRuleByLabel("DoTuoiNhanVienToiDa"));

            // -------------------------- search -------------------------- --------------

            // tag
            dateBirthDay.Tag = dateBirthDayMax;

            dateToWork.Tag = dateToWorkMax;

            //search engine init
            _GridFilter = new GridFilter(grdvListStaff);
            _GridFilter.AddTextbox("StaffID", txtStaffId);
            _GridFilter.AddTextbox("StaffName", txtStaffName);
            _GridFilter.AddTextbox("Sex", cmbStaffGender, true, false);
            _GridFilter.AddDateControl("DateOfBirth", dateBirthDay);
            _GridFilter.AddTextbox("Address", txtStaffAddress);
            _GridFilter.AddTextbox("PhoneNumber", txtStaffPhone);
            _GridFilter.AddTextbox("Email", txtStaffEmail);
            _GridFilter.AddDateControl("DateCreated", dateToWork);
            _GridFilter.AddTextbox("RolePermissionID", lkStaffCharge, true, false);

            // assign
            dateToWorkMax.DateTime = DateTime.Now;
            dateToWork.DateTime = dateToWorkMax.DateTime.AddMonths(-3);
            dateBirthDayMax.DateTime = DateTime.Now.AddYears(-15);
            dateBirthDay.DateTime = dateBirthDayMax.DateTime.AddYears(-50);

            //event
            InitForSeachForm init = new InitForSeachForm();
            init.Init(this, _GridFilter, txtSearchDelay, rgrSearAfter);
            init.SearchWhenTextChanged(dateBirthDay);
            init.SearchWhenTextChanged(dateBirthDayMax);
            init.SearchWhenTextChanged(dateToWork);
            init.SearchWhenTextChanged(dateToWorkMax);
            init.SearchWhenTextChanged(lkStaffCharge);
            init.SearchWhenTextChanged(cmbStaffGender);
        }