private void BTN_OK_Click(object sender, EventArgs e) { if (string.Empty.Equals(TXT_PASSPORT_NAME.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_PASSPORT_NAME"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PASSPORT_NAME.Focus(); return; } if (string.Empty.Equals(TXT_PASSPORT_NO.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_PASSPORT_NO"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PASSPORT_NO.Focus(); return; } if (string.Empty.Equals(COM_PASSPORT_NAT.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("COM_PASSPORT_NAT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); COM_PASSPORT_NAT.Focus(); return; } if (string.Empty.Equals(COM_PASSPORT_SEX.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("COM_PASSPORT_SEX"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); COM_PASSPORT_SEX.Focus(); return; } if (string.Empty.Equals(TXT_PASSPORT_BIRTH.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_PASSPORT_BIRTH"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PASSPORT_BIRTH.Focus(); return; } if (string.Empty.Equals(TXT_PASSPORT_EXP.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_PASSPORT_EXP"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PASSPORT_EXP.Focus(); return; } TXT_PASSPORT_NAME.Text = TXT_PASSPORT_NAME.Text.Replace("<", "").Replace(" ", ""); this.DialogResult = DialogResult.OK; this.Close(); }
private void BTN_OK_Click(object sender, EventArgs e) { if (COM_PASSPORT_TYPE.SelectedIndex == 0) { if (COM_PASSPORT_RES.SelectedIndex == 27) { MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT_TYPE"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); COM_PASSPORT_RES.Focus(); return; } } else { if (COM_PASSPORT_RES.SelectedIndex != 27) { MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT_TYPE"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); COM_PASSPORT_RES.Focus(); return; } } if (COM_PASSPORT_TYPE.SelectedIndex == 0) { if (string.Empty.Equals(TXT_PASSPORT_NO.Text) || TXT_PASSPORT_NO.Text.Length > 11) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_PASSPORT_NO"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PASSPORT_NO.Focus(); return; } if (string.Empty.Equals(TXT_PASSPORT_EXP.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_PASSPORT_EXP"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PASSPORT_EXP.Focus(); return; } } else { if (string.Empty.Equals(TXT_PERMIT_NO.Text) || TXT_PERMIT_NO.Text.Length > 15) { MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PERMIT_NO"), "Permit_no", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PERMIT_NO.Focus(); return; } } if (string.Empty.Equals(TXT_PASSPORT_NAME.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_PASSPORT_NAME"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PASSPORT_NAME.Focus(); return; } if (string.Empty.Equals(COM_PASSPORT_NAT.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("COM_PASSPORT_NAT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); COM_PASSPORT_NAT.Focus(); return; } if (string.Empty.Equals(COM_PASSPORT_SEX.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("COM_PASSPORT_SEX"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); COM_PASSPORT_SEX.Focus(); return; } if (string.Empty.Equals(TXT_PASSPORT_BIRTH.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_PASSPORT_BIRTH"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_PASSPORT_BIRTH.Focus(); return; } if (string.Empty.Equals(COM_PASSPORT_TYPE.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("COM_PASSPORT_TYPE"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); COM_PASSPORT_TYPE.Focus(); return; } if (string.Empty.Equals(COM_PASSPORT_RES.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("COM_PASSPORT_RES"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); COM_PASSPORT_RES.Focus(); return; } if (string.Empty.Equals(TXT_DATE_LAND.Text)) { //MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("TXT_DATE_LAND"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); MetroFramework.MetroMessageBox.Show(this, Constants.getMessage("ERROR_PASSPORT"), "Passport", MessageBoxButtons.OK, MessageBoxIcon.Warning); TXT_DATE_LAND.Focus(); return; } this.DialogResult = DialogResult.OK; this.Close(); }