Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 private void txtContentSearch_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (m_flag)
     {
         CheckInformationEntered.checkCharacterInput(e, !m_flag);
     }
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 private bool checkData()
 {
     if (CheckInformationEntered.checkDataInput(txtUnitName, Utils.errorMessage, ref dxErrorProvider))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 6
0
 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();
     }
 }
Esempio n. 7
0
 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);
         }
     }
 }
Esempio n. 8
0
 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);
     }
 }
Esempio n. 10
0
 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);
     }
 }
Esempio n. 11
0
 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);
 }
Esempio n. 12
0
 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);
     }
 }
Esempio n. 13
0
 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);
 }
Esempio n. 14
0
 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);
 }
Esempio n. 15
0
 private void txtStaffPhone_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, 1);
 }
Esempio n. 16
0
 private void txtBookRealeaseYear_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, false);
 }
Esempio n. 17
0
 private void onlyNumberic_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, 1);
 }
Esempio n. 18
0
 private void txtAuthorNameLA_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, false);
 }
Esempio n. 19
0
 private void txtEmployeeNameLA_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, true);
 }
 private void txtPaymentWord_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, true);
 }
Esempio n. 21
0
 private void txtBookTitlesName_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, true);
 }
Esempio n. 22
0
 private void txtunitName_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, 2);
 }
Esempio n. 23
0
 private void txtCustomerNameLA_KeyPress(object sender, KeyPressEventArgs e)
 {
     CheckInformationEntered.checkCharacterInput(e, 0);
 }