public bool CheckInput(TextBoxX tendichvu, ComboBoxEx cmb) { if (tendichvu.Text == "") { MessageBox.Show("Chưa nhập tên dịch vụ bưu chính viễn thông !", "Chú ý", MessageBoxButtons.OK); tendichvu.Focus(); return(false); } else { if (tendichvu.Text.Length > 200) { MessageBox.Show("Nhập tên dịch vụ bưu chính viễn thông không quá 50 ký tự ", "Chú ý", MessageBoxButtons.OK); tendichvu.Focus(); return(false); } } if (cmb.SelectedIndex < 0) { cmb.Focus(); MessageBox.Show("Chưa chọn Doanh Nghiệp !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
public bool KiemTra(TextBoxX user, TextBoxX pass) { if (user.Text != "") { if (user.Text.Contains("'")) { MessageBox.Show("Tên đăng nhập không hợp lệ !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); user.Focus(); return(false); } } else { MessageBox.Show("Chưa nhập tên người dùng !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Information); user.Focus(); return(false); } if (pass.Text != "") { if (pass.Text.Contains("'")) { MessageBox.Show("Mật khẩu không hợp lệ !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); pass.Focus(); return(false); } } else { MessageBox.Show("Chưa nhập mật khẩu !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Information); pass.Focus(); return(false); } return(true); }
// public bool Kiemtra(TextBoxX tenBDVHX, ComboBoxEx cmbhuyen, ComboBoxEx cmbxa, TextBoxX diachi, ComboBoxEx cmbDN) { if (tenBDVHX.Text == "") { MessageBox.Show("Chưa nhập tên điểm bưu điện văn hóa xã !", "Chú ý", MessageBoxButtons.OK); tenBDVHX.Focus(); return(false); } else { if (tenBDVHX.Text.Length > 50) { MessageBox.Show("Nhập tên điểm bưu điện văn hóa xã không quá 50 ký tự !", "Chú ý", MessageBoxButtons.OK); tenBDVHX.Focus(); return(false); } } if (cmbhuyen.SelectedIndex < 0) { cmbhuyen.Focus(); MessageBox.Show("Chưa chọn Huyện !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (cmbxa.SelectedIndex < 0) { cmbxa.Focus(); MessageBox.Show("Chưa chọn Xã !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (diachi.Text == "") { MessageBox.Show("Chưa nhập địa chỉ !", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } else { if (diachi.Text.Length > 50) { MessageBox.Show("Nhập địa chỉ không quá 50 ký tự !", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } } if (cmbDN.SelectedIndex < 0) { cmbDN.Focus(); MessageBox.Show("Chưa chọn Doanh nghiệp !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
// public bool Kiemtra(TextBoxX tendaily, ComboBoxEx cmbhuyen, ComboBoxEx cmbxa, TextBoxX diachi, ComboBoxEx cmbDn) { if (tendaily.Text == "") { MessageBox.Show("Chưa nhập tên chủ đại lý !", "Chú ý", MessageBoxButtons.OK); tendaily.Focus(); return(false); } else { if (tendaily.Text.Length > 50) { MessageBox.Show("Nhập tên chủ đại lý không quá 255 ký tự !", "Chú ý", MessageBoxButtons.OK); tendaily.Focus(); return(false); } } if (cmbhuyen.SelectedIndex < 0) { cmbhuyen.Focus(); MessageBox.Show("Chưa chọn Huyện !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (cmbxa.SelectedIndex < 0) { cmbxa.Focus(); MessageBox.Show("Chưa chọn Xã !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (diachi.Text == "") { MessageBox.Show("Chưa nhập địa chỉ !", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } else { if (diachi.Text.Length > 50) { MessageBox.Show("Nhập địa chỉ không quá 50 ký tự ", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } } if (cmbDn.SelectedIndex < 0) { cmbxa.Focus(); MessageBox.Show("Chưa chọn Doanh Nghiệp !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
public bool CheckInput(TextBoxX tenloaiduan, TextBoxX diadiem, TextBoxX thoigian, TextBoxX nangluc, TextBoxX tongvon) { if (tenloaiduan.Text == "") { MessageBox.Show("Chưa nhập tên dự án !", "Chú ý", MessageBoxButtons.OK); tenloaiduan.Focus(); return(false); } else { if (tenloaiduan.Text.Length > 200) { MessageBox.Show("Nhập tên loại dự án không quá 50 ký tự ", "Chú ý", MessageBoxButtons.OK); tenloaiduan.Focus(); return(false); } } if (diadiem.Text == "") { MessageBox.Show("Chưa nhập địa điểm xây dựng !", "Chú ý", MessageBoxButtons.OK); diadiem.Focus(); return(false); } if (nangluc.Text == "") { MessageBox.Show("Chưa nhập năng lực thiết kế !", "Chú ý", MessageBoxButtons.OK); nangluc.Focus(); return(false); } if (thoigian.Text == "") { MessageBox.Show("Chưa nhập thời gian từ lúc khởi công đến lúc hoàn thành !", "Chú ý", MessageBoxButtons.OK); thoigian.Focus(); return(false); } if (tongvon.Text == "") { MessageBox.Show("Chưa nhập tổng mức vốn đầu tư được phê duyệt !", "Chú ý", MessageBoxButtons.OK); tongvon.Focus(); return(false); } return(true); }
public bool CheckInput(TextBoxX tendaily, ComboBoxEx cmbxa, TextBoxX diachi, TextBox sohieu) { if (tendaily.Text == "") { MessageBox.Show("Chưa nhập tên đại lý !", "Chú ý", MessageBoxButtons.OK); tendaily.Focus(); return(false); } else { if (tendaily.Text.Length > 50) { MessageBox.Show("Nhập tên đại lý không quá 50 ký tự !", "Chú ý", MessageBoxButtons.OK); tendaily.Focus(); return(false); } } if (cmbxa.SelectedIndex < 0) { cmbxa.Focus(); MessageBox.Show("Chưa chọn Xã !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (diachi.Text == "") { MessageBox.Show("Chưa nhập địa chỉ !", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } else { if (diachi.Text.Length > 50) { MessageBox.Show("Nhập địa chỉ không quá 50 ký tự ", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } return(true); } if (sohieu.Text == "") { MessageBox.Show("Chưa nhập số hiệu!", "chú ý", MessageBoxButtons.OK); sohieu.Focus(); return(false); } }
private bool KiemTra(LabelX maktx, DateTimePicker ngay, ComboBoxEx hoatdong, TextBoxX ghichu) { if (maktx.Text == "") { MessageBox.Show("Mã KTX không hợp lệ", "ky Luat"); return(false); } if (ngay.Value > DateTime.Now) { MessageBox.Show("Ngày không hợp lệ", "ky Luat"); ngay.Value = DateTime.Now; ngay.Focus(); return(false); } if (hoatdong.SelectedIndex < 0) { MessageBox.Show("Chưa chọn Hoạt động", "ky Luat"); hoatdong.Focus(); return(false); } if (ghichu.Text == "") { MessageBox.Show("Chưa nhập Lý do kỹ luật", "ky Luat"); ghichu.Focus(); return(false); } return(true); }
private void ButtonLimpiar_Click(object sender, EventArgs e) { TextBoxX.Clear(); TextBoxY.Clear(); TextBoxX.Focus(); PictureBoxPizarra.Image = null; }
public bool KT(ComboBoxEx cmb, TextBoxX text, string ThongBao) { if (cmb.SelectedIndex >= 0) { if (cmb.SelectedItem.ToString() != "None") { if (text.Text == "" || text == null) { MessageBox.Show("Chưa nhập " + ThongBao); text.Focus(); return(false); } else { return(true); } } } else { MessageBox.Show("Chưa chọn " + ThongBao); cmb.Focus(); return(false); } return(true); }
public void login(CheckBoxX ckb_ghinho, TextBoxX txt_id, TextBoxX txt_password, Form login, Form main) { if (string.IsNullOrEmpty(txt_id.Text.Trim())) { MessageBox.Show("Không được bỏ trống ID" + txt_id.Text.ToLower(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); txt_id.Focus(); return; } if (string.IsNullOrEmpty(txt_password.Text)) { MessageBox.Show("Không được bỏ trống PassWord" + txt_password.Text.ToLower(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); txt_password.Focus(); return; } if (DAO_QL_NguoiDung.Instances.Check_Config() == 0) { ProcessLogin(ckb_ghinho, txt_id, txt_password, login, main);// Cấu hình phù hợp xử lý đăng nhập } if (DAO_QL_NguoiDung.Instances.Check_Config() == 1) { MessageBox.Show("Chuỗi cấu hình không tồn tại");// Xử lý cấu hình } if (DAO_QL_NguoiDung.Instances.Check_Config() == 2) { MessageBox.Show("Chuỗi cấu hình không phù hợp");// Xử lý cấu hình } }
//bao cao public bool CheckInput(TextBoxX congtrinh) { if (congtrinh.Text == "") { MessageBox.Show("Chưa nhập Loại công trình !", "Chú ý", MessageBoxButtons.OK); congtrinh.Focus(); return(false); } else { if (congtrinh.Text.Length > 200) { MessageBox.Show("Nhập tên loại công trình không quá 200 ký tự ", "Chú ý", MessageBoxButtons.OK); congtrinh.Focus(); return(false); } } return(true); }
public bool CheckInput(TextBoxX ten) { if (ten.Text == "") { MessageBox.Show("Chưa nhập thuê bao !", "Chú ý", MessageBoxButtons.OK); ten.Focus(); return(false); } else { if (ten.Text.Length > 50) { MessageBox.Show("Thuê bao không quá 50 kí tự !", "Chú ý", MessageBoxButtons.OK); ten.Focus(); return(false); } } return(true); }
public bool CheckInput(TextBoxX ten, TextBoxX user, TextBoxX pass, TextBoxX repass, ComboBoxEx cmbquyen) { if (ten.Text == "") { MessageBox.Show("Chưa nhập họ tên người đăng nhập !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); ten.Focus(); return(false); } else { if (ten.Text.Length > 50) { MessageBox.Show("Họ tên không thể lớn hơn 50 ký tự !", "Chú ý", MessageBoxButtons.OK); ten.Focus(); return(false); } } if (pass.Text != "") { if (pass.Text != repass.Text) { MessageBox.Show("Mật khẩu không trùng nhau !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); pass.Focus(); return(false); } } else { MessageBox.Show("Chưa nhập mật khẩu !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); pass.Focus(); return(false); } if (cmbquyen.SelectedIndex < 0) { cmbquyen.Focus(); MessageBox.Show("Chưa chọn quyền đăng nhập !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
public bool CheckInput(TextBoxX tenmaubaocaoInt) { if (tenmaubaocaoInt.Text == "") { MessageBox.Show("Chưa nhập tên mẫu báo cáo !", "Chú ý", MessageBoxButtons.OK); tenmaubaocaoInt.Focus(); return(false); } else { if (tenmaubaocaoInt.Text.Length > 200) { MessageBox.Show("Nhập tên mẫu báo cáo không quá 200 ký tự ", "Chú ý", MessageBoxButtons.OK); tenmaubaocaoInt.Focus(); return(false); } } return(true); }
public bool CheckInput(TextBoxX soluong) { if (soluong.Text == "") { MessageBox.Show("Chưa nhập số lượng của công trình !", "Chú ý", MessageBoxButtons.OK); soluong.Focus(); return(false); } return(true); }
public bool CheckInput(TextBoxX tendichvu) { if (tendichvu.Text == "") { MessageBox.Show("Chưa nhập tên dịch vụ bưu chính viễn thông !", "Chú ý", MessageBoxButtons.OK); tendichvu.Focus(); return(false); } else { if (tendichvu.Text.Length > 200) { MessageBox.Show("Nhập tên dịch vụ bưu chính viễn thông không quá 50 ký tự ", "Chú ý", MessageBoxButtons.OK); tendichvu.Focus(); return(false); } } return(true); }
public bool CheckInput(TextBoxX dienthoai) { if (dienthoai.Text == "") { MessageBox.Show("Chưa nhập điện thoai !", "Chú ý", MessageBoxButtons.OK); dienthoai.Focus(); return(false); } return(true); }
private void setLabel(TextBoxX tb, LabelX lbl, TextBoxX tb1 = null) { if (isEdit) { if (!tb.Focus()) { tb.Focus(); } if (tb.Text.Trim() == "") { tb.Text = lbl.Text; if (tb1 != null) { tb1.Text = lbl.Name; } } else { if (tb1 != null) { if (!tb1.Text.Contains(lbl.Name)) { tb.Text += "," + lbl.Text; tb1.Text += "," + lbl.Name; } } else { if (!tb.Text.Contains(lbl.Text)) { tb.Text += "," + lbl.Text; } } } } }
public bool CheckInput(TextBoxX diachi, TextBoxX daitanso) { if (diachi.Text == "") { MessageBox.Show("Chưa nhập địa chỉ công trình !", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } if (daitanso.Text == "") { MessageBox.Show("Chưa nhập dải tần số và công suất máy phát vô tuyến của công trình !", "Chú ý", MessageBoxButtons.OK); daitanso.Focus(); return(false); } return(true); }
private bool KiemTra(LabelX maktx, DateTimePicker ngay, TextBoxX quyetdinhso, ComboBoxEx kl, ComboBoxEx cap, ComboBoxEx cb, TextBoxX lydo) { if (maktx.Text == "") { MessageBox.Show("Mã KTX không hợp lệ", "ky Luat"); return(false); } if (ngay.Value > DateTime.Now) { MessageBox.Show("Ngày không hợp lệ", "ky Luat"); ngay.Value = DateTime.Now; ngay.Focus(); return(false); } if (quyetdinhso.Text == "") { MessageBox.Show("Chưa nhập số quyết định kỹ luật", "ky Luat"); quyetdinhso.Focus(); return(false); } if (kl.SelectedIndex < 0) { MessageBox.Show("Chưa chọn hình thức kỹ luật", "ky Luat"); kl.Focus(); return(false); } if (cap.SelectedIndex < 0) { MessageBox.Show("Chưa chọn cấp kỹ luật", "ky Luat"); cap.Focus(); return(false); } if (cb.SelectedIndex < 0) { MessageBox.Show("Chưa chọn Bán bộ", "ky Luat"); cb.Focus(); return(false); } if (lydo.Text == "") { MessageBox.Show("Chưa nhập Lý do kỹ luật", "ky Luat"); lydo.Focus(); return(false); } return(true); }
public bool CheckInput(TextBoxX vanban, TextBoxX doanhnghiep) { if (vanban.Text == "") { MessageBox.Show("Chưa nhập tên văn bản công bố !", "Chú ý", MessageBoxButtons.OK); vanban.Focus(); return(false); } if (doanhnghiep.Text == "") { MessageBox.Show("Chưa nhập tên doanh nghiệp ban hành văn bản công bố!", "Chú ý", MessageBoxButtons.OK); doanhnghiep.Focus(); return(false); } return(true); }
public bool CheckInput(TextBoxX von, TextBoxX luyke) { if (von.Text == "") { MessageBox.Show("Chưa nhập mức vốn đầu tư thực hiện !", "Chú ý", MessageBoxButtons.OK); von.Focus(); return(false); } if (luyke.Text == "") { MessageBox.Show("Chưa nhập lũy kế vốn đầu tư thực hiện từ khi khởi công đến cuối quý báo cáo!", "Chú ý", MessageBoxButtons.OK); luyke.Focus(); return(false); } return(true); }
private void ButtonEdit_Click(object sender, EventArgs e) { TextBoxSerialNumber.Enabled = true; TextBoxX.Enabled = true; TextBoxY.Enabled = true; ComboBoxStatus.Enabled = true; TextBoxHCN.Enabled = true; DateTimePickerInstallationDate.Enabled = true; DateTimePickerMaintenanceDate.Enabled = true; ComboBoxMeterGateway.Enabled = true; ComboBoxMeterType.Enabled = true; ComboBoxMeterSize.Enabled = true; ComboBoxMeterProtocol.Enabled = true; ComboBoxDMZ.Enabled = true; ComboBoxCity.Enabled = true; ButtonNew.Enabled = false; ButtonEdit.Enabled = true; ButtonSave.Enabled = true; ButtonDelete.Enabled = false; _save = false; TextBoxX.Focus(); }
public bool KiemTra(ComboBoxEx danhgia, TextBoxX tichcuc, TextBoxX tieucuc, TextBoxX ghichu) { if (danhgia.SelectedIndex < 0) { MessageBox.Show("Chưa chọn đánh giá", "Loi", MessageBoxButtons.OK, MessageBoxIcon.Error); danhgia.Focus(); return(false); } if (tichcuc.Text == "") { DialogResult re = MessageBox.Show("Bạn chưa nhập \"tích cực\" của sinh viên\nBạn có muốn nhập không?", "Danh gia", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (re == DialogResult.Yes) { tichcuc.Focus(); return(false); } } if (tieucuc.Text == "") { DialogResult re = MessageBox.Show("Bạn chưa nhập \"tiêu cực\" của sinh viên\nBạn có muốn nhập không?", "Danh gia", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (re == DialogResult.Yes) { tieucuc.Focus(); return(false); } } if (ghichu.Text == "") { DialogResult re = MessageBox.Show("Bạn chưa nhập \"Ghi chú\" của sinh viên\nBạn có muốn nhập không?", "Danh gia", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (re == DialogResult.Yes) { ghichu.Focus(); return(false); } } return(true); }
// public bool Kiemtra(TextBoxX ten, TextBoxX diachi, TextBoxX dienthoai, TextBoxX fax, TextBoxX email, TextBoxX trangweb, ComboBoxEx cmbhuyen, ComboBoxEx cmbxa) { if (ten.Text == "") { MessageBox.Show("Chưa nhập tên doanh nghiệp !", "Chú ý", MessageBoxButtons.OK); ten.Focus(); return(false); } else { if (ten.Text.Length > 255) { MessageBox.Show("Tên Doanh nghiệp đã quá chiều dài quy định !", "Chú ý", MessageBoxButtons.OK); ten.Focus(); return(false); } } if (diachi.Text == "") { MessageBox.Show("Chưa nhập địa chỉ !", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } else { if (diachi.Text.Length > 50) { MessageBox.Show("Địa chỉ không quá 50 kí tự !", "Chú ý", MessageBoxButtons.OK); diachi.Focus(); return(false); } } if (dienthoai.Text != "") { if (dienthoai.Text.Length != 10 && dienthoai.Text.Length != 11 && dienthoai.Text.Length != 6 && dienthoai.Text.Length != 9) { MessageBox.Show("Số điện thoại không hợp lệ !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); dienthoai.Focus(); return(false); } else { char[] arr = dienthoai.Text.ToCharArray(); string s = "0123456789"; foreach (char c in arr) { if (!s.Contains(c.ToString())) { MessageBox.Show("Số điện thoại không được có ký tự !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); dienthoai.Focus(); return(false); } } } } else { dienthoai.Focus(); MessageBox.Show("Chưa nhập số điện thoại !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (cmbhuyen.SelectedIndex < 0) { cmbhuyen.Focus(); MessageBox.Show("Chưa chọn Huyện !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (cmbxa.SelectedIndex < 0) { cmbxa.Focus(); MessageBox.Show("Chưa chọn Xã !", "Chú ý", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }
public bool KiemTra(TextBoxX hoten, DateTimePicker ngaysinh, TextBoxX diachi, TextBoxX mssv, TextBoxX cmnd, TextBoxX dienthoai, ComboBoxEx qt, ComboBoxEx dt, ComboBoxEx tg) { if (hoten.Text != "") { if (hoten.Text.Length > 30) { MessageBox.Show("Tên không quá 30 ký tự", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); hoten.Focus(); return(false); } } else { hoten.Focus(); MessageBox.Show("Chưa nhập tên", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if ((DateTime.Now.Year - ngaysinh.Value.Year) < 17) { MessageBox.Show("Tuổi phải lớn hơn 16 (tính theo năm)", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); ngaysinh.Focus(); return(false); } if (diachi.Text != "") { if (diachi.Text.Length > 100) { MessageBox.Show("chiều dài Địa chỉ không quá 100 ký tự", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); diachi.Focus(); return(false); } } else { diachi.Focus(); MessageBox.Show("Chưa nhập địa chỉ", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (mssv.Text != "") { if (mssv.Text.Length > 9) { MessageBox.Show("Mã số Sinh viên không quá 9 ký tự", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); mssv.Focus(); return(false); } } else { mssv.Focus(); MessageBox.Show("Chưa nhập MSSV", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (cmnd.Text != "") { if (cmnd.Text.Length != 9) { MessageBox.Show("Chứng minh nhân phải là 9 số", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); cmnd.Focus(); return(false); } else { char[] arr = cmnd.Text.ToCharArray(); string s = "0123456789"; foreach (char c in arr) { if (!s.Contains(c.ToString())) { MessageBox.Show("Chứng minh nhân dân không được có ký tự", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); cmnd.Focus(); return(false); } } } } else { cmnd.Focus(); MessageBox.Show("Chưa nhập số chứng minh nhân dân", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (dienthoai.Text != "") { if (dienthoai.Text.Length != 10 && dienthoai.Text.Length != 6 && dienthoai.Text.Length != 9) { MessageBox.Show("Số điện thoại không thích hợp", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); dienthoai.Focus(); return(false); } else { char[] arr = cmnd.Text.ToCharArray(); string s = "0123456789"; foreach (char c in arr) { if (!s.Contains(c.ToString())) { MessageBox.Show("Số điện thoại không được có ký tự", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); cmnd.Focus(); return(false); } } } } else { dienthoai.Focus(); MessageBox.Show("Chưa nhập số điện thoại", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); // có the khong có } if (qt.SelectedIndex < 0) { qt.Focus(); MessageBox.Show("Chưa chọn Quốc tịch", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (dt.SelectedIndex < 0) { dt.Focus(); MessageBox.Show("Chưa chọn Dân tộc", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (tg.SelectedIndex < 0) { tg.Focus(); MessageBox.Show("Chưa chọn Tôn giáo", "Sinh vien", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } return(true); }