private bool checkData() { //if (dateBirthDay.DateTime < DateTime.Now && dateToWork.DateTime <= DateTime.Now) //{ // if (!staffBUS.checkAge(dateBirthDay.DateTime, dateToWork.DateTime)) // { // dateBirthDay.Focus(); // dateToWork.EditValue = null; // dateBirthDay.EditValue = null; // XtraCustomMessageBox.Show("Độ tuổi không phù hợp với quy định!\nXin vui lòng kiểm tra lại!", "Lỗi", true); // return false; // } //} //else //{ // XtraCustomMessageBox.Show("Ngày sinh hoặc ngày vào làm không thể lớn hơn ngày hiện tại", "Lỗi", true); // return false; //} if (CheckInformationEntered.checkDataInput(txtStaffName, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtStaffAddress, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtStaffEmail, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtStaffPhone, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(dateBirthDay, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(cmbStaffGender, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(dateToWork, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(lkStaffCharge, "Dữ liệu không thể để trống", ref dxErrorProvider)) { return(true); } return(false); }
private bool checkData() { if (dateBirthDay.DateTime < DateTime.Now && dateToWork.DateTime <= DateTime.Now) { if (!m_EmployeeExecute.checkAge(dateBirthDay.DateTime, dateToWork.DateTime)) { dateBirthDay.Focus(); dateToWork.EditValue = null; dateBirthDay.EditValue = null; XtraCustomMessageBox.Show("Độ tuổi không phù hợp với quy định!\nXin vui lòng kiểm tra lại!", "Lỗi", true); return(false); } } else { XtraCustomMessageBox.Show("Ngày sinh hoặc ngày vào làm không thể lớn hơn ngày hiện tại", "Lỗi", true); return(false); } if (CheckInformationEntered.checkDataInput(txtEmployeeName, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtEmployeeAddress, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtEmployeeEmail, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtEmployeePhone, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(dateBirthDay, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(cmbEmployeeGender, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(dateToWork, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(lkEmployeeCharge, "Dữ liệu không thể để trống", ref dxErrorProvider)) { return(true); } return(false); }
private void txtContentSearch_KeyPress(object sender, KeyPressEventArgs e) { if (m_flag) { CheckInformationEntered.checkCharacterInput(e, !m_flag); } }
private bool checkData() { if (CheckInformationEntered.checkDataInput(txtAuthorName, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtAuthorAddress, "Dữ liệu không thể để trống", ref dxErrorProvider)) { return(true); } return(false); }
private bool checkData() { if (CheckInformationEntered.checkDataInput(txtUnitName, Utils.errorMessage, ref dxErrorProvider)) { return(true); } else { return(false); } }
private void txtStaffEmail_Leave(object sender, EventArgs e) { if (!CheckInformationEntered.isEmail(txtStaffEmail.Text.Trim())) { dxErrorProvider.SetError(txtStaffEmail, "Email không đúng định dạng!"); } else { dxErrorProvider.ClearErrors(); } }
private void dateStart_EditValueChanged(object sender, EventArgs e) { if (!CheckInformationEntered.checkDate(dateStart.DateTime, DateTime.Now)) { if (dateStart.EditValue != null) { dateStart.EditValue = DateTime.Now; XtraCustomMessageBox.Show("Ngày đến không được nhỏ hơn ngày hiện tại! \nXin vui lòng nhập lại", "Thông báo", true, 4); } } }
private bool checkData() { if (CheckInformationEntered.checkDataInput(lkBookGenreName, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(chkCmbAuthorName, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtBookTitlesName, "Dữ liệu không thể để trống", ref dxErrorProvider)) { return(true); } else { return(false); } }
private void btnSave_Click(object sender, EventArgs e) { if (!CheckInformationEntered.checkDataInput(txtBookGenreName, "Dữ liệu không thể để trống !", ref dxEPBookGenre)) { txtBookGenreName.Focus(); return; } try { DataRow _rowValue = m_bookGenreData.AsEnumerable().FirstOrDefault(tt => tt.Field <string>("TenTL") == txtBookGenreName.Text); if (_rowValue != null) { XtraCustomMessageBox.Show("Dữ liệu đã tồn tại", "Thông báo", true); return; } if (!m_IsAdd) { m_bookGenre = new CBookGenreDTO(txtBookGenreName.Text); m_bookGenre.maTheLoai = txtBookGenreId.Text; if (!m_bookGenreBus.UpdateBookGenreToDatabase(m_bookGenre)) { XtraCustomMessageBox.Show("Cập nhật dữ liệu thất bại!", "Lỗi", true); } else { XtraCustomMessageBox.Show("Cập nhật dữ liệu thành công!", "Thông báo", true); } } else { m_bookGenre = new CBookGenreDTO("TL0000000", txtBookGenreName.Text); if (!m_bookGenreBus.AddBookGenreToDatabase(m_bookGenre)) { XtraCustomMessageBox.Show("Thêm dữ liệu thất bại!", "Lỗi", true); } else { XtraCustomMessageBox.Show("Thêm dữ liệu thành công!", "Thông báo", true); } } } catch (System.Exception) { XtraCustomMessageBox.Show("Không thể lưu!\n", "Thông báo", true); } finally { updateEnableButtonAndResetValueOfControl(ref btnSave); } }
private bool checkData() { if (CheckInformationEntered.checkDataInput(lkCustomer, Utils.errorMessage, ref dxErrorProvider) && CheckInformationEntered.checkDataInput(dateStart, Utils.errorMessage, ref this.dxErrorProvider) && CheckInformationEntered.checkDataInput(dateEnd, Utils.errorMessage, ref this.dxErrorProvider) && CheckInformationEntered.checkDataInput(dateStart, Utils.errorMessage, ref this.dxErrorProvider)) { return(true); } else { return(false); } }
private bool checkData() { if (CheckInformationEntered.checkDataInput(txtCustomerName, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtCustomerAddress, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtCustomerEmail, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtCustomerPhone, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(dateBirthDay, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtCMND, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(cmbCustomerGender, "Dữ liệu không thể để trống", ref dxErrorProvider)) { return(true); } return(false); }
private void btnSave_Click(object sender, EventArgs e) { if (!CheckInformationEntered.checkDataInput(txtChargeName, "Không thể để trống dữ liệu!", ref dxErrorProvider)) { return; } try { if (m_IsAdd) { m_Charge = new CChargeDTO("CV0000000", txtChargeName.Text); if (m_ChargeBus.AddChargeToDatabase(m_Charge)) { XtraCustomMessageBox.Show("Thêm dữ liệu thành công!", "Thông báo", true); } else { XtraCustomMessageBox.Show("Thêm dữ liệu thất bại!", "Lỗi", true); } } else { m_Charge = new CChargeDTO(txtChargeId.Text, txtChargeName.Text); m_Charge.maChucVu = txtChargeId.Text; if (m_ChargeBus.UpdateChargeToDatabase(m_Charge)) { XtraCustomMessageBox.Show("Cập nhật dữ liệu thành công!", "Thông báo", true); } else { XtraCustomMessageBox.Show("Cập nhật dữ liệu thất bại!", "Lỗi", true); } } } catch (System.Exception) { XtraCustomMessageBox.Show("Lưu thất bại", "Lỗi", true); } finally { updateEnableButtonAndResetValueOfControl(ref btnSave); } }
private bool checkData() { if (dateBirthDay.DateTime >= DateTime.Now) { XtraCustomMessageBox.Show("Ngày sinh không thể lớn hơn ngày hiện tại", "Lỗi", true); dateBirthDay.Focus(); return(false); } if (CheckInformationEntered.checkDataInput(txtCustomerName, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtCustomerAddress, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtCustomerEmail, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtCustomerPhone, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(dateBirthDay, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(cmbCustomerGender, "Dữ liệu không thể để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(spCustomerDebit, "Dữ liệu không thể để trống", ref dxErrorProvider)) { return(true); } return(false); }
private bool checkData() { try { if (int.Parse(txtBookRealeaseYear.Text) > DateTime.Now.Year) { XtraCustomMessageBox.Show("Năm xuất bản không thể lớn hơn năm hiện tại", "Lỗi", true); txtBookRealeaseYear.ResetText(); txtBookRealeaseYear.Focus(); return(false); } } catch (System.Exception) { } if (CheckInformationEntered.checkDataInput(lkBookTitlesName, "Dữ liệu không được để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(lkPublisherName, "Dữ liệu không được để trống", ref dxErrorProvider) && CheckInformationEntered.checkDataInput(txtBookRealeaseYear, "Dữ liệu không được để trống", ref dxErrorProvider)) { return(true); } return(false); }
private void txtStaffPhone_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, 1); }
private void txtBookRealeaseYear_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, false); }
private void onlyNumberic_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, 1); }
private void txtAuthorNameLA_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, false); }
private void txtEmployeeNameLA_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, true); }
private void txtPaymentWord_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, true); }
private void txtBookTitlesName_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, true); }
private void txtunitName_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, 2); }
private void txtCustomerNameLA_KeyPress(object sender, KeyPressEventArgs e) { CheckInformationEntered.checkCharacterInput(e, 0); }