static void Main() { if (Process.GetProcessesByName("VNSC").Length > 1) { Form_Notice frm = new Form_Notice("Chương trình HR-STG đang chạy!", false); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form_Main()); } }
private void LoadPic() { try { pbSuKien.Image = Image.FromFile(@"Resources\SuKien\icon_sukien_sukien.png"); pbLoaiHinh.Image = Image.FromFile(@"Resources\SuKien\icon_sukien_loaihinh.png"); pbNhomLoaiHinh.Image = Image.FromFile(@"Resources\SuKien\icon_sukien_khuvuc.png"); //pbID.Image = Image.FromFile(@"Resources\SuKien\icon_quanlyma.png"); } catch { this.Dispose(); Form_Notice frm_Notice = new Form_Notice("Kiểm tra thư mục Resource!", false); } }
private void LoadPic() { try { this.BackgroundImage = Image.FromFile(@"Resources\form_confirm.jpg"); pbHuy.Image = Image.FromFile(@"Resources\ChucNang\icon_cancel.png"); pbHoanTat.Image = Image.FromFile(@"Resources\ChucNang\icon_ok.png"); } catch { this.Dispose(); Form_Notice frm_Notice = new Form_Notice("Kiểm tra thư mục Resource!", false); } }
private void LoadPic() { try { this.BackgroundImage = Image.FromFile(@"Resources\database_def.jpg"); pbExit.Image = Image.FromFile(@"Resources\ChucNang\button_exit.png"); pbOk.Image = Image.FromFile(@"Resources\ChucNang\button_ok_disable.png"); } catch { this.Dispose(); Form_Notice frm_Notice = new Form_Notice("Kiểm tra thư mục Resource!", false); } }
private void LoadPic() { try { pbHuy.Image = Image.FromFile(@"Resources\ChucNang\icon_cancel.png"); pbHoanTat.Image = Image.FromFile(@"Resources\ChucNang\icon_ok.png"); pbTitle.Image = Image.FromFile(@"Resources\Export\export_title.png"); } catch { this.Dispose(); Form_Notice frm_Notice = new Form_Notice("Kiểm tra thư mục Resource!", false); } }
private void pbHoanTat_Click(object sender, EventArgs e) { string sPath = File_Function.SaveDialog("Excel File", "xls"); if (sPath != null) { if (Office_Function.ExportListViewData2Excel07("HR-STG", sPath, uc_ListViewEx.LvEx)) { pbHuy_Click(sender, e); } else { Form_Notice frm = new Form_Notice("Không thể xuất dữ liệu!", false); } } }
private void cbNhomLoaiHinh_SelectedIndexChanged(object sender, EventArgs e) { if (cbNhomLoaiHinh.Text.Length > 0) { cbLoaiHinh.Items.Clear(); if (!LayDSLoaiHinhTheoMaNhomLoaiHinh_ComboBox(cbLoaiHinh, list_NhomLoaiHinh[cbNhomLoaiHinh.SelectedIndex])) { Form_Notice frm_Notice = new Form_Notice("Chưa có Loai hình trong Nhóm loại hình này!", false); } else { cbLoaiHinh.Enabled = true; tbNganh.Text = ""; } } }
private void LoadPic() { try { pbTitle.Image = Image.FromFile(@"Resources\HeThong\title_system.png"); pbDatabase.Image = Image.FromFile(@"Resources\HeThong\system_dbmanager.png"); pbUser.Image = Image.FromFile(@"Resources\HeThong\system_usermanager.png"); pbPluginManager.Image = Image.FromFile(@"Resources\HeThong\system_pluginmanager.png"); } catch { this.Dispose(); Form_Notice frm_Notice = new Form_Notice("Kiểm tra thư mục Resource!", false); } }
private void cbDonViHanhChanh_SelectedIndexChanged(object sender, EventArgs e) { if (cbDonViHanhChanh.SelectedIndex >= 0) { cbTrachVuSuKien.Items.Clear(); if (!LayDSTrachVuSuKienTheoMaDonViHanhChanh_ComboBox(cbTrachVuSuKien, list_DonViHanhChanh[cbDonViHanhChanh.SelectedIndex])) { frm_Notice = new Form_Notice("Chưa có TVSK trong DVHC này!", false); } else { cbTrachVuSuKien.Enabled = true; } } lvThongTin_HSTD_SelectedIndexChanged(sender, e); SubFunction.ClearlvItem(lvThongTin_DP); }
private void LoadPic() { try { pbXoa.Image = Image.FromFile(@"Resources\ChucNang\icon_xoa_disable.png"); pbSua.Image = Image.FromFile(@"Resources\ChucNang\icon_sua_disable.png"); pbTitle.Image = Image.FromFile(@"Resources\HeThong\title_plugin.png"); pbBrowse.Image = Image.FromFile(@"Resources\ChucNang\icon_browse.png"); pbInstall.Image = Image.FromFile(@"Resources\HeThong\button_installplugin.png"); pbHuy.Image = Image.FromFile(@"Resources\ChucNang\icon_cancel.png"); pbHoanTat.Image = Image.FromFile(@"Resources\ChucNang\icon_ok.png"); } catch { this.Dispose(); Form_Notice frm_Notice = new Form_Notice("Kiểm tra thư mục Resource!", false); } }
private void pbTransfer_Click(object sender, EventArgs e) { if (lvThongTin_HSTD.Focused) { for (int i = 0; i < lvThongTin_HSTD.SelectedItems.Count; i++) { if (!KiemTraHoThamDuBiTrungHoSoDieuPhoi(lvThongTin_HSTD.SelectedItems[i].SubItems[0].Text)) { DieuPhoi dto_DP = new DieuPhoi(); dto_DP.MaDonViHanhChanh = list_DonViHanhChanh[cbDonViHanhChanh.SelectedIndex]; dto_DP.MaTrachVuSuKien = list_TrachVuSuKien[cbTrachVuSuKien.SelectedIndex]; dto_DP.MaSuKien_HoSo = lvThongTin_HSTD.SelectedItems[i].SubItems[0].Text; if (DieuPhoi_BUS.Insert(dto_DP)) { SuKien_DieuPhoi dto_Temp = new SuKien_DieuPhoi(); dto_Temp.MaSuKien = iMaSuKien; dto_Temp.MaDieuPhoi = dto_DP.Ma; if (SuKien_DieuPhoi_BUS.Insert(dto_Temp)) { cbTrachVuSuKien_SelectedIndexChanged(sender, e); } else { Form_Notice frm = new Form_Notice("Không thể tạo Hồ sơ điều phối!", false); } } else { Form_Notice frm = new Form_Notice("Không thể tạo Hồ sơ điều phối!", false); } } } } }
private bool KiemTraHoThamDuBiTrungHoSoDieuPhoi(string sMa) { for (int i = 0; i < list_dto_DP.Count; i++) { if (list_dto_DP[i].MaSuKien_HoSo == sMa) { Form_Notice frm = new Form_Notice("Kiểm tra Hồ sơ điều phối " + list_dto_DP[i].Ma + " bị trùng!", false); return true; } } return false; }
private void pbHoanTat_HL_Click(object sender, EventArgs e) { //Nhap vao CSDL if (sSelect == "THÊM") { NewSuKien_HoSo(); if (SuKien_HoSo_BUS.Insert(dto_SuKien_HoSo)) { if (!gbHuanLuyen.Visible) { gbHuanLuyen.Visible = true; } if (InsertSuKien_HuanLuyen(list_UC_HuanLuyen)) { SuKien_HoSoThamDu Temp = new SuKien_HoSoThamDu(); Temp.MaSuKien = iMaSuKien; Temp.MaSuKien_HoSo = sMaSuKien_HoSo; if (SuKien_HoSoThamDu_BUS.Insert(Temp)) { if (bNewAvatar) { if (!File_Function.savePic(list_FolderAvatar, setAvatarPath(sMaSuKien_HoSo, sNgayCapNhat), (Bitmap)pbAvatar.Image)) { frm_Notice = new Form_Notice("Kiểm tra Avatar của hồ sơ đang mở!", false); } } Cancel(); } else { Form_Notice frm = new Form_Notice("Không thể tạo Hồ Sơ!", false); } } else { Form_Notice frm = new Form_Notice("Không thể tạo Khóa Huấn Luyện!", false); } } else { Form_Notice frm = new Form_Notice("Không thể tạo Hồ Sơ!", false); } } if (sSelect == "SỬA") { sNgayCapNhatTruoc = dto_SuKien_HoSo.NgayCapNhat; NewSuKien_HoSo(); if (SuKien_HoSo_BUS.UpdateSuKien_HoSoInfo(dto_SuKien_HoSo)) { if (UpdateSuKien_HuanLuyen()) { if (bNewAvatar) { if (!File_Function.savePic(list_FolderAvatar, setAvatarPath(sMaSuKien_HoSo, sNgayCapNhat), (Bitmap)pbAvatar.Image)) { frm_Notice = new Form_Notice("Kiểm tra Avatar của hồ sơ đang mở!", false); } } setAvatarPath(sMaSuKien_HoSo, sNgayCapNhatTruoc); sAvatarPath = Path.Combine(File_Function.getFinalFolder(list_FolderAvatar), sAvatarPath); pbAvatar.Visible = false; if (File.Exists(sAvatarPath)) { //try //{ // imgAvatar.Dispose(); //} //catch //{ // //khong lam gi het //} //try //{ // imgZoom.Dispose(); //} //catch //{ // //khong lam gi het //} //try //{ // pbAvatar.Image.Dispose(); //} //catch //{ // //khong lam gi het //} try { File.Delete(sAvatarPath); } catch { MessageBox.Show("Error"); //khong lam gi het } } Cancel(); } else { Form_Notice frm = new Form_Notice("Không thể cập nhật Hồ Sơ!", false); } } else { Form_Notice frm = new Form_Notice("Không thể cập nhật Hồ Sơ!", false); } } }
private void LoadPic() { try { pbTiepTuc_LLCN.Image = Image.FromFile(@"Resources\ChucNang\forward_disable.png"); pbHuy_LLCN.Image = Image.FromFile(@"Resources\ChucNang\icon_cancel.png"); pbTiepTuc_LLHD.Image = Image.FromFile(@"Resources\ChucNang\forward.png"); pbTroVe_LLHD.Image = Image.FromFile(@"Resources\ChucNang\back.png"); pbHuy_LLHD.Image = Image.FromFile(@"Resources\ChucNang\icon_cancel.png"); pbTiepTuc_NNKN.Image = Image.FromFile(@"Resources\ChucNang\forward.png"); pbTroVe_NNKN.Image = Image.FromFile(@"Resources\ChucNang\back.png"); pbHuy_NNKN.Image = Image.FromFile(@"Resources\ChucNang\icon_cancel.png"); pbTroVe_HL.Image = Image.FromFile(@"Resources\ChucNang\back.png"); pbHuy_HL.Image = Image.FromFile(@"Resources\ChucNang\icon_cancel.png"); pbHoanTat_HL.Image = Image.FromFile(@"Resources\ChucNang\icon_ok.png"); pbAdd.Image = Image.FromFile(@"Resources\ChucNang\add.png"); pbBrowse.Image = Image.FromFile(@"Resources\ChucNang\icon_browse.png"); pbAvatar.Image = Image.FromFile(@"Resources\NhanSu\avatar.png"); } catch { this.Dispose(); frm_Notice = new Form_Notice("Kiểm tra thư mục Resource!", false); } }
private void pbApply_Click(object sender, EventArgs e) { dto_SuKien = SuKien_BUS.TraCuuSuKienTheoMa(iMaSuKien); if (String.Format("{0:tt}", DateTime.Now) == "AM") { sNgayCapNhat = String.Format("{0:dd/MM/yyyy}", DateTime.Now) + " - " + String.Format("{0:hh:mm:ss}", DateTime.Now) + " Sáng"; } else { sNgayCapNhat = String.Format("{0:dd/MM/yyyy}", DateTime.Now) + " - " + String.Format("{0:hh:mm:ss}", DateTime.Now) + " Chiều"; } if (!File_Function.savePic(list_FolderEvatar, setEvatarPath(dto_SuKien.IDS, sNgayCapNhat), (Bitmap)pbEvatar.Image)) { Form_Notice frm_Notice = new Form_Notice("Kiểm tra Evatar của hồ sơ đang mở!", false); } pbEvatar.Visible = false; if (dto_SuKien.NgayCapNhatEvatar != null) { iTime = 1; lbTest.Text = "Vui lòng đợi Apply"; lbTest.Visible = true; timer_Evatar.Start(); } else { dto_SuKien.NgayCapNhatEvatar = sNgayCapNhat; SuKien_BUS.UpdateSuKienInfo(dto_SuKien); sEvatarPath = Path.Combine(File_Function.getFinalFolder(list_FolderEvatar), setEvatarPath(dto_SuKien.IDS, dto_SuKien.NgayCapNhatEvatar)); if (File.Exists(sEvatarPath)) { string sImage = Convert_Function.ConvertByteArrayToString(Convert_Function.ConvertImageToByteArray(Image.FromFile(sEvatarPath))); pbEvatar.Image = Convert_Function.ConvertByteArrayToImage(Convert_Function.ConvertStringToByteArray(sImage)); } pbEvatar.Enabled = false; pbEvatar.Visible = true; lbTest.Visible = false; pbApply.Enabled = false; timer_Evatar.Stop(); } }
private bool KiemTraHoSoCaNhanBiTrungHoSoThamDu(HoSo dto_Temp) { List<SuKien_HoSo> list_Temp = SuKien_HoSo_BUS.TraCuuDSSuKien_HoSoTheoMaSuKien(iMaSuKien); for (int i = 0; i < list_Temp.Count; i++) { if (list_Temp[i].HoTen == dto_Temp.HoTen && list_Temp[i].NgaySinh == dto_Temp.NgaySinh && list_Temp[i].GioiTinh == dto_Temp.GioiTinh) { string[] sTen = dto_Temp.HoTen.Split(); Form_Notice frm = new Form_Notice("Kiểm tra Hồ sơ trùng lắp:", sTen[sTen.Length - 1], false); return true; } } return false; }
private bool LayDSTrachVuTheoMaNhomTrachVu_ComboBox(ComboBox cb, string sMaNhomTrachVu) { List<TrachVu> list_Temp = TrachVu_BUS.TraCuuDSTrachVuTheoMaNhomTrachVu(sMaNhomTrachVu); if (list_Temp != null) { list_TrachVu.Clear(); cb.Items.Clear(); for (int i = 0; i < list_Temp.Count; i++) { list_TrachVu.Add(list_Temp[i].Ma); cb.Items.Add(list_Temp[i].Ten); } return true; } else { Form_Notice frm = new Form_Notice("Kiểm tra Nhóm trách vụ bị trùng!", false); return false; } }
private void pbChucNangKhac_Click(object sender, EventArgs e) { CreateNTV_TVConfig(); string sPath = File_Function.SaveDialog("Config file", "cfg"); if (sPath != null) { string sContent = "<HR-STG Version=\"" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version + "\">"; string sConfig = InsertSuKien2String(); if (sConfig == null) { Form_Notice frm = new Form_Notice("Không thể tạo Config!", "Vui lòng kiểm tra lại.", false); return; } sContent += sConfig; sConfig = InsertIDV2String(); if (sConfig == null) { Form_Notice frm = new Form_Notice("Không thể tạo Config!", "Vui lòng kiểm tra lại.", false); return; } sContent += sConfig; sContent += "</HR-STG>"; if (Crypto.EncryptData(sContent, sPath)) { //Form_Notice frm = new Form_Notice("Tạo file thành công.", false); } else { Form_Notice frm = new Form_Notice("Tạo file thất bại!", "Vui lòng thử lại.", false); } } }
private void pbBrowse_Click(object sender, EventArgs e) { string sPath = File_Function.OpenDialog("JPG file", "jpg"); if (sPath != null) { try { imgAvatar = Image.FromFile(sPath); } catch { frm_Notice = new Form_Notice("Không thể mở hình!", "Vui lòng kiểm tra lại.", false); return; } if (imgAvatar.Width > 500 || imgAvatar.Height > 500) { imgZoom = Image_Function.resizeImage(imgAvatar, new Size(500, 500)); } else { imgZoom = imgAvatar; } if (imgAvatar.Width >= 90 && imgAvatar.Height >= 120) { pbAvatar.Cursor = Cursors.SizeAll; pbAvatar.Enabled = true; if (imgZoom.Width > imgZoom.Height) { iZoom = imgZoom.Width; } else { iZoom = imgZoom.Height; } point_Pic = new Point(imgZoom.Width / 2 - size_PicRec.Width / 2, imgZoom.Height / 2 - size_PicRec.Height / 2); point_PicBound = point_Pic; size_Pic.Width = imgZoom.Width; size_Pic.Height = imgZoom.Height; //pbAvatar.Image.Dispose(); pbAvatar.Image = Image_Function.CropImage(imgZoom, new Rectangle(point_PicBound, size_PicRec), pbAvatar.ClientRectangle); bNewAvatar = true; } else { Form_Notice frm = new Form_Notice("Kích thước ảnh quá nhỏ!", false); } } }
private void pbHoanTat_Click(object sender, EventArgs e) { if (lbSelect.Text == "THÊM") { NhomTrachVu dto = new NhomTrachVu(); dto.Ma = tbMa.Text; dto.Ten = tbTen.Text; dto.MoTa = tbMoTa.Text; if (NhomTrachVu_BUS.Insert(dto)) { pnQuanLy.Visible = true; pnSelect.Visible = true; pnInfo.Visible = false; NewInfo(); lbTitle.Text = "NHÓM TRÁCH VỤ"; lbSelect.Text = ""; refreshListView(); lvThongTin.SelectedItems.Clear(); } else { Form_Notice frm = new Form_Notice("Không thể tạo Nhóm trách vụ!", false); } } if (lbSelect.Text == "SỬA") { NhomTrachVu dto = NhomTrachVu_BUS.TraCuuNhomTrachVuTheoMa(tbMa.Text); dto.Ten = tbTen.Text; dto.MoTa = tbMoTa.Text; if (NhomTrachVu_BUS.UpdateNhomTrachVuInfo(dto)) { pnQuanLy.Visible = true; pnSelect.Visible = true; pnInfo.Visible = false; NewInfo(); lbTitle.Text = "NHÓM TRÁCH VỤ"; lbSelect.Text = ""; refreshListView(); } else { Form_Notice frm = new Form_Notice("Không thể cập nhật Nhóm trách vụ!", false); } } }
private void pbHuy_NNKN_Click(object sender, EventArgs e) { frm_Notice = new Form_Notice("Dữ liệu mới sẽ không được lưu lại!", "Bạn có muốn thoát?", true); if (frm_Notice.Yes) { Cancel(); } }
private void pbHuy_Click(object sender, EventArgs e) { Form_Notice frm_Notice = new Form_Notice("Dữ liệu mới sẽ không được lưu lại!", "Bạn có muốn thoát?", true); if (frm_Notice.Yes) { pnQuanLy.Visible = true; pnSelect.Visible = true; pnInfo.Visible = false; NewInfo(); lbTitle.Text = "NHÓM TRÁCH VỤ"; lbSelect.Text = ""; refreshListView(); lvThongTin.SelectedItems.Clear(); } }
private void Form_DieuPhoi_Load(object sender, EventArgs e) { list_DonViHanhChanh = new List<int>(); list_DonViHanhChanh.Add(-1); list_TrachVuSuKien = new List<int>(); if (!LayDSDonViHanhChanh_ComboBox(cbDonViHanhChanh)) { this.Visible = false; Form_Notice frm = new Form_Notice("Chưa khởi tạo Đơn vị hành chánh!", false); return; } else { this.Visible = true; } if (!LayDSTrachVuSuKien_ComboBox(cbTrachVuSuKien)) { this.Visible = false; Form_Notice frm = new Form_Notice("Chưa khởi tạo Trách vụ sự kiện!", false); return; } else { this.Visible = true; } LoaDPic(); lvThongTin_HSTD.LostFocus += new EventHandler(lvThongTin_HSTD_LostFocus); lvThongTin_DP.LostFocus += new EventHandler(lvThongTin_DP_LostFocus); list_FolderAvatar = new List<string>(); list_FolderAvatar.Add("DB"); list_FolderAvatar.Add("Avatar"); tbPage_HSTD.Location = new Point(pnPage.Left + 2, pnPage.Top - 1); tbPage_HSTD.LostFocus += new EventHandler(tbPage_HSTD_LostFocus); tbPage_DP.Location = new Point(pnPage.Left + 2, pnPage.Top - 1); tbPage_DP.LostFocus += new EventHandler(tbPage_DP_LostFocus); iRows_HSTD = 19; iRows_DP = 19; refreshListView_HSTD(); //refreshListView_DP(); }
private void pbXoa_Click(object sender, EventArgs e) { Form_Confirm frm_Confirm = new Form_Confirm("Đồng ý xóa " + lvThongTin.SelectedItems.Count + " dữ liệu?"); if (frm_Confirm.Yes) { for (int i = 0; i < lvThongTin.SelectedItems.Count; i++) { if (!NhomTrachVu_BUS.Delete(lvThongTin.SelectedItems[i].SubItems[0].Text)) { Form_Notice frm = new Form_Notice("Không thể xóa!", "Vẫn còn Trách vụ có Nhóm trách vụ này!", false); break; } } refreshListView(); } }
private bool LayDSTrachVuSuKienTheoMaDonViHanhChanh_ComboBox(ComboBox cb, int iMaDonViHanhChanh) { List<TrachVuSuKien> list_Temp = TrachVuSuKien_BUS.TraCuuDSTrachVuSuKienTheoMaDonViHanhChanh(iMaDonViHanhChanh); if (list_Temp != null) { list_TrachVuSuKien.Clear(); cb.Items.Clear(); for (int i = 0; i < list_Temp.Count; i++) { list_TrachVuSuKien.Add(list_Temp[i].Ma); cb.Items.Add(list_Temp[i].Ten); } return true; } else { Form_Notice frm = new Form_Notice("Kiểm tra Đơn vị hành chánh bị trùng!", false); return false; } }
private void LoadPic() { try { pbThem.Image = Image.FromFile(@"Resources\ChucNang\icon_them.png"); pbXoa.Image = Image.FromFile(@"Resources\ChucNang\icon_xoa_disable.png"); pbSua.Image = Image.FromFile(@"Resources\ChucNang\icon_sua_disable.png"); pbHuy.Image = Image.FromFile(@"Resources\ChucNang\icon_cancel.png"); pbHoanTat.Image = Image.FromFile(@"Resources\ChucNang\icon_ok.png"); pbTitle.Image = Image.FromFile(@"Resources\NhanSu\icon_qlhoso_doituong_title.png"); pbTraCuu.Image = Image.FromFile(@"Resources\ChucNang\icon_searchtextbox.png"); pbOk.Image = Image.FromFile(@"Resources\ChucNang\button_ok_disable.png"); pbTotalPage.Image = Image.FromFile(@"Resources\ChucNang\icon_totalpagenumber.png"); pbBackPage.Image = Image.FromFile(@"Resources\ChucNang\button_back_disable.png"); pbNextPage.Image = Image.FromFile(@"Resources\ChucNang\button_next_disable.png"); } catch { this.Dispose(); Form_Notice frm_Notice = new Form_Notice("Kiểm tra thư mục Resource!", false); } }
private void pbXoa_DP_Click(object sender, EventArgs e) { pbXoa_DP.Focus(); frm_Confirm = new Form_Confirm("Đồng ý xóa " + lvThongTin_DP.SelectedItems.Count + " dữ liệu?"); if (frm_Confirm.Yes) { for (int i = 0; i < lvThongTin_DP.SelectedItems.Count; i++) { if (SuKien_DieuPhoi_BUS.Delete(iMaSuKien, int.Parse(lvThongTin_DP.SelectedItems[i].SubItems[0].Text))) { if (!DieuPhoi_BUS.Delete(int.Parse(lvThongTin_DP.SelectedItems[i].SubItems[0].Text))) { SuKien_DieuPhoi dto_Temp = new SuKien_DieuPhoi(); dto_Temp.MaSuKien = iMaSuKien; dto_Temp.MaDieuPhoi = int.Parse(lvThongTin_DP.SelectedItems[i].SubItems[0].Text); SuKien_DieuPhoi_BUS.Insert(dto_Temp); frm_Notice = new Form_Notice("Không thể xóa Hồ Sơ " + lvThongTin_DP.SelectedItems[i].SubItems[0].Text + "!", false); break; } } else { frm_Notice = new Form_Notice("Không thể xóa Hồ Sơ " + lvThongTin_DP.SelectedItems[i].SubItems[0].Text + "!", false); break; } } refreshListView_DP(list_DonViHanhChanh[cbDonViHanhChanh.SelectedIndex], list_TrachVuSuKien[cbTrachVuSuKien.SelectedIndex]); } }
private void UC_SuKien_HoSoThamDu_Load(object sender, EventArgs e) { LoadPic(); list_IDV = new List<int>(); list_NhomTrachVu = new List<string>(); list_TrachVu = new List<string>(); cbIDV_LLCN.Items.Add(" "); LayDSIDV_ComboBox(cbIDV_LLCN); if (!LayDSNhomTrachVu_ComboBox(cbNhomTrachVu_LLCN)) { this.Visible = false; Form_Notice frm = new Form_Notice("Chưa khởi tạo Nhóm trách vụ!", false); return; } else { this.Visible = true; } if (!LayDSTrachVu_ComboBox(cbTrachVu_LLCN)) { this.Visible = false; Form_Notice frm = new Form_Notice("Chưa khởi tạo Trách vụ!", false); return; } else { this.Visible = true; } list_dto = new List<SuKien_HoSo>(); list_UC_HuanLuyen = new List<UC_HuanLuyen>(); list_UC_HuanLuyen_Insert = new List<UC_HuanLuyen>(); list_UC_HuanLuyen_Delete = new List<int>(); list_UC_HuanLuyen_Update = new List<UC_HuanLuyen>(); dto_HoSo = new HoSo(); dto_SuKien_HoSo = new SuKien_HoSo(); dto_SuKien_HuanLuyen = new SuKien_HuanLuyen(); dto_SuKien_HoSo_HuanLuyen = new SuKien_HoSo_HuanLuyen(); list_FolderAvatar = new List<string>(); list_FolderAvatar.Add("DB"); list_FolderAvatar.Add("Avatar"); if (String.Format("{0:tt}", DateTime.Now) == "AM") { sNgayCapNhat = String.Format("{0:dd/MM/yyyy}", DateTime.Now) + " - " + String.Format("{0:hh:mm:ss}", DateTime.Now) + " Sáng"; lbNgayCapNhat.Text = sNgayCapNhat.Substring(0, 18) + sNgayCapNhat.Substring(21); } else { sNgayCapNhat = String.Format("{0:dd/MM/yyyy}", DateTime.Now) + " - " + String.Format("{0:hh:mm:ss}", DateTime.Now) + " Chiều"; lbNgayCapNhat.Text = sNgayCapNhat.Substring(0, 18) + sNgayCapNhat.Substring(21); } if (sSelect == "SỬA") { setSuKien_HoSoTheoMaSuKien_HoSo(sMaSuKien_HoSo); } if (bCopyHoSoCaNhanToHoSoThamDu) { setSuKien_HoSoTheoMaHoSo(sMaHoSo); if (!KiemTraHoSoCaNhanBiTrungHoSoThamDu(dto_HoSo)) { pbHoanTat_HL_Click(sender, e); } else { this.Dispose(); } } if (bImportHoSoClientToHoSoThamDu) { setSuKien_HoSoImport(dto_SuKien_HoSo_Import, list_SuKien_HuanLuyen); if (!KiemTraHoSoCaNhanBiTrungHoSoThamDu(dto_HoSo)) { pbHoanTat_HL_Click(sender, e); } else { this.Dispose(); } } this.Size = new System.Drawing.Size(1024, 600); pnLyLich.Size = new System.Drawing.Size(550, 545); pnLyLich.Location = SubFunction.SetCenterLocation(this.Size, pnLyLich.Size); gbLyLichCaNhan.Size = new System.Drawing.Size(550, 545); gbLyLichCaNhan.Location = SubFunction.SetWidthCenter(pnLyLich.Size, gbLyLichCaNhan.Size, 0); gbLyLichHuongDao.Size = new System.Drawing.Size(550, 545); gbLyLichHuongDao.Location = SubFunction.SetWidthCenter(pnLyLich.Size, gbLyLichHuongDao.Size, 0); gbNgheNghiep_KiNang.Size = new System.Drawing.Size(550, 545); gbNgheNghiep_KiNang.Location = SubFunction.SetWidthCenter(pnLyLich.Size, gbNgheNghiep_KiNang.Size, 0); gbHuanLuyen.Size = new System.Drawing.Size(550, 545); gbHuanLuyen.Location = SubFunction.SetWidthCenter(pnLyLich.Size, gbHuanLuyen.Size, 0); pn_gbHuanLuyen.Size = new System.Drawing.Size(540, 430); pn_gbHuanLuyen.Location = SubFunction.SetWidthCenter(gbHuanLuyen.Size, pn_gbHuanLuyen.Size, 50); pnNgayCapNhat.Left = pnLyLich.Left; pnNgayCapNhat.Top = pnLyLich.Top - 22; size_PicRec.Width = 90; size_PicRec.Height = 120; pnAvatar.Left = pnLyLich.Right + 5; pnAvatar.Top = pnLyLich.Top + 10; }
private void tbPage_HSTD_KeyUp(object sender, KeyEventArgs e) { if (SubFunction.tbPass(e)) { if (tbPage_HSTD.Text.Length > 0) { if (SubFunction.TestInt(tbPage_HSTD.Text)) { if (int.Parse(tbPage_HSTD.Text) <= iTotalPage_HSTD) { tbPage_HSTD.Visible = false; lbPage_HSTD.Text = tbPage_HSTD.Text; } else { frm_Notice = new Form_Notice("Không có trang này!", "Vui lòng kiểm tra lại.", false); } } else { frm_Notice = new Form_Notice("Số trang không hợp lệ!", "Tắt bộ gõ dấu Tiếng Việt.", false); } } else { tbPage_HSTD.Visible = false; } } }
private void cbNhomTrachVu_LLCN_SelectedIndexChanged(object sender, EventArgs e) { if (cbNhomTrachVu_LLCN.Text.Length > 0) { cbTrachVu_LLCN.Items.Clear(); if (!LayDSTrachVuTheoMaNhomTrachVu_ComboBox(cbTrachVu_LLCN, list_NhomTrachVu[cbNhomTrachVu_LLCN.SelectedIndex])) { frm_Notice = new Form_Notice("Chưa có Trách Vụ trong Nhóm trách vụ này!", false); } else { cbTrachVu_LLCN.Enabled = true; } } if (cbTrachVu_LLCN.Text.Length > 0 && tbHoTen_LLCN.Text.Length > 0) { pbTiepTuc_LLCN.Enabled = true; pbTiepTuc_LLCN.Image = Image.FromFile(@"Resources\ChucNang\forward.png"); } else { pbTiepTuc_LLCN.Enabled = false; pbTiepTuc_LLCN.Image = Image.FromFile(@"Resources\ChucNang\forward_disable.png"); } }