/// <summary> /// hàm thực hiện việc đăng nhập thông tin của khi đăng nhập Login /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frm_Login_Load(object sender, EventArgs e) { try { globalVariables.StringLicense = GetRequestLicenseCode() + THU_VIEN_CHUNG.GetMACAddress(); DataTable dtKhoaphong = THU_VIEN_CHUNG.Laydanhmuckhoa("ALL", 0); DataBinding.BindDataCombobox(cboKhoaKCB, dtKhoaphong, DmucKhoaphong.Columns.MaKhoaphong, DmucKhoaphong.Columns.TenKhoaphong, "---Khoa làm việc---", false); PropertyLib._AppProperties = PropertyLib.GetAppPropertiess(); PropertyLib._ConfigProperties = PropertyLib.GetConfigProperties(); cbogiaodien.SelectedIndex = PropertyLib._AppProperties.MenuStype; txtUserName.Text = PropertyLib._AppProperties.UID; _oldUid = txtUserName.Text; chkRemember.Checked = PropertyLib._AppProperties.REM; lblMsg.Text = ""; cboKhoaKCB.SelectedIndex = Utility.GetSelectedIndex(cboKhoaKCB, PropertyLib._ConfigProperties.MaKhoa); if (cboKhoaKCB.SelectedIndex <= 0) { cboKhoaKCB.SelectedIndex = Utility.GetSelectedIndex(cboKhoaKCB, PropertyLib._AppProperties.Makhoathien); } if (PropertyLib._AppProperties.AutoLogin) { txtPassWord.Text = PropertyLib._AppProperties.PWD; cmdLogin_Click(cmdLogin, e); } } catch (Exception ex) { Utility.ShowMsg("Lỗi:" + ex); } }
public void LoadList() { try { Try2SaveXML(); UIAction.SetTextStatus(lblMsg, "Nạp thông tin cấu hình...", false); Utility.LoadProperties(); globalVariables.gv_dtDangbaoche = SPs.DmucLaydmucDangbaochethuoc().GetDataSet().Tables[0]; globalVariables.gv_dtDmucChung = new Select().From(DmucChung.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtDmucLoaibenh = THU_VIEN_CHUNG.LayDulieuDanhmucChung(new List <string> { "LOAIBENH" }, false); UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu thuốc...", false); globalVariables.gv_dtQheDoituongThuoc = new Select().From(QheDoituongThuoc.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu hệ thống khác...", false); globalVariables.gv_dtSysparams = new Select().From(SysSystemParameter.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtSysTieude = new Select().From(SysTieude.Schema).ExecuteDataSet().Tables[0]; globalVariables.IdKhoaNhanvien = (Int16)THU_VIEN_CHUNG.LayIDPhongbanTheoUser(globalVariables.UserName); globalVariables.idKhoatheoMay = (Int16)THU_VIEN_CHUNG.LayIDPhongbanTheoMay(globalVariables.MA_KHOA_THIEN); globalVariablesPrivate.objKhoaphong = DmucKhoaphong.FetchByID(globalVariables.idKhoatheoMay); globalVariablesPrivate.objNhanvien = new Select().From(DmucNhanvien.Schema).Where(DmucNhanvien.Columns.UserName).IsEqualTo(globalVariables.UserName).ExecuteSingle <DmucNhanvien>(); if (globalVariablesPrivate.objNhanvien != null) { globalVariablesPrivate.objKhoaphongNhanvien = DmucKhoaphong.FetchByID(globalVariablesPrivate.objNhanvien.IdKhoa); } globalVariables.gv_dtDanhmucchung = new Select().From(DmucChung.Schema).ExecuteDataSet().Tables[0]; globalVariables.g_dtMeasureUnit = THU_VIEN_CHUNG.LayDulieuDanhmucChung(new List <string> { "DONVITINH" }, false); globalVariables.gv_dtDmucPhongban = new Select().From(DmucKhoaphong.Schema).ExecuteDataSet().Tables[0]; globalVariables.SysDate = THU_VIEN_CHUNG.GetSysDateTime(); globalVariables.gv_dtDmucNhanvien = new Select().From(VDmucNhanvien.Schema).ExecuteDataSet().Tables[0]; Utility.LoadImageLogo(); } catch (Exception ex) { Utility.CatchException(ex); } finally { THU_VIEN_CHUNG.GetIP4Address(); THU_VIEN_CHUNG.GetMACAddress(); THU_VIEN_CHUNG.LoadThamSoHeThong(); } }
public void LoadList() { try { Try2SaveXML(); UIAction.SetTextStatus(lblMsg, "Nạp thông tin cấu hình...", false); Utility.LoadProperties(); UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục dạng bào chế...", false); globalVariables.gv_dtDangbaoche = SPs.DmucLaydmucDangbaochethuoc().GetDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục thuốc...", false); globalVariables.gv_dtDanhMucThuoc = new Select().From(VDmucThuoc.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục loại thuốc...", false); globalVariables.gv_dtLoaiThuoc = new Select().From(DmucLoaithuoc.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục chung...", false); globalVariables.gv_dtDmucChung = new Select().From(DmucChung.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục quan hệ giá thuốc...", false); globalVariables.gv_dtQheDoituongThuoc = new Select().From(QheDoituongThuoc.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục bệnh...", false); globalVariables.gv_dtDmucLoaibenh = THU_VIEN_CHUNG.LayDulieuDanhmucChung(new List <string> { "LOAIBENH" }, false); UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục bệnh án...", false); globalVariables.gv_danhmucbenhan = new Select().From(DmucBenhan.Schema).Where(DmucBenhan.Columns.Trangthai).IsEqualTo(1).OrderAsc(DmucBenhan.Columns.SttHienthi).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục bệnh...", false); globalVariables.gv_dtDmucBenh = new Select().From(VDanhmucbenh.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục địa chính...", false); globalVariables.gv_dtDmucDiachinh = new Select().From(VDmucDiachinh.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục bệnh viện...", false); globalVariables.gv_dtDmucBenhVien = new Select().From(DmucBenhvien.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Ghép dữ liệu địa chính...", false); Utility.AutoCompeleteAddress(globalVariables.gv_dtDmucDiachinh); UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục nơi KCBBĐ...", false); globalVariables.gv_dtDmucNoiKCBBD = new Select().From(VDmucNoiKCBBD.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu dịch vụ cấm kê chỉ định...", false); globalVariables.gv_dtDmucQheCamCLSChungPhieu = new Select().From(QheCamchidinhChungphieu.Schema).Where(QheCamchidinhChungphieu.Columns.Loai).IsEqualTo(0).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu dịch vụ cận lâm sàng...", false); globalVariables.gv_dtDmucDichvuCls = new Select().From(VDmucDichvucl.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu dịch vụ cận lâm sàng chi tiết...", false); globalVariables.gv_dtDmucDichvuClsChitiet = new Select().From(VDmucDichvuclsChitiet.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu dịch vụ nhóm cận lâm sàng...", false); globalVariables.gv_dtNhomDichVuCLS = new Select().From(DmucNhomcanlamsang.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu quan hệ giá cận lâm sàngt...", false); globalVariables.gv_dtQheDoituongDichvu = new Select().From(QheDoituongDichvucl.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu cấu hình webservices ...", false); SysWebServicePath objServicePath = new Select().From(SysWebServicePath.Schema) .Where(SysWebServicePath.Columns.WebPathCode) .IsEqualTo(globalVariables.BhxhWebCode).ExecuteSingle <SysWebServicePath>(); if (objServicePath != null) { globalVariables.BhxhWebPath = objServicePath.WebPathName; } SysWebServicePath objServicePathInvoice = new Select().From(SysWebServicePath.Schema) .Where(SysWebServicePath.Columns.WebPathCode) .IsEqualTo(globalVariables.InvoiceWebCode).ExecuteSingle <SysWebServicePath>(); if (objServicePathInvoice != null) { globalVariables.InvoiceWebPath = objServicePathInvoice.WebPathName; } UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu hệ thống khác...", false); globalVariables.gv_dtSysparams = new Select().From(SysSystemParameter.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtSysTieude = new Select().From(SysTieude.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtNhomInCLS = (from p in globalVariables.gv_dtDmucChung.AsEnumerable() where p.Field <string>(DmucChung.Columns.Loai) == "NHOM_INPHIEU_CLS" select p).CopyToDataTable(); globalVariables.IdKhoaNhanvien = (Int16)THU_VIEN_CHUNG.LayIDPhongbanTheoUser(globalVariables.UserName); globalVariables.gv_dtDoituong = new Select().From(DmucDoituongkcb.Schema) .OrderAsc(DmucDoituongkcb.Columns.SttHthi) .ExecuteDataSet() .Tables[0]; globalVariables.idKhoatheoMay = (Int16)THU_VIEN_CHUNG.LayIdPhongbanTheoMay(globalVariables.MA_KHOA_THIEN); globalVariablesPrivate.objKhoaphong = DmucKhoaphong.FetchByID(globalVariables.idKhoatheoMay); globalVariablesPrivate.objNhanvien = new Select().From(DmucNhanvien.Schema) .Where(DmucNhanvien.Columns.UserName) .IsEqualTo(globalVariables.UserName) .ExecuteSingle <DmucNhanvien>(); if (globalVariablesPrivate.objNhanvien != null) { globalVariablesPrivate.objKhoaphongNhanvien = DmucKhoaphong.FetchByID(globalVariablesPrivate.objNhanvien.IdKhoa); globalVariables.qh_NhanVienPhongKham = new Select().From(QheBacsiKhoaphong.Schema) .Where(QheBacsiKhoaphong.IdBacsiColumn).IsEqualTo(globalVariablesPrivate.objNhanvien.IdNhanvien) .ExecuteDataSet().Tables[0]; globalVariables.IdPhongNhanvien = globalVariablesPrivate.objNhanvien.IdPhong; } //globalVariables.gv_dtKhoaPhongNgoaiTru = // SPs.DmucLaydanhsachCacphongkhamTheoBacsi(globalVariables.UserName, globalVariables.idKhoatheoMay, // Utility.Bool2byte( globalVariables.IsAdmin), 0).GetDataSet().Tables[0]; globalVariables.g_dtMeasureUnit = THU_VIEN_CHUNG.LayDulieuDanhmucChung(new List <string> { "DONVITINH" }, false); globalVariables.gv_dtDmucPhongban = new Select().From(DmucKhoaphong.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtDantoc = new Select().From(DmucChung.Schema) .Where(DmucChung.Columns.Loai) .IsEqualTo("DAN_TOC") .ExecuteDataSet() .Tables[0]; globalVariables.SysDate = THU_VIEN_CHUNG.GetSysDateTime(); globalVariables.gv_dtDmucNhanvien = new Select().From(VDmucNhanvien.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Kiểm tra phiên bản người dùng ......", false); //if (PropertyLib._ConfigProperties.HIS_AppMode == AppEnum.AppMode.Demo) //{ // SqlQuery sql = new Select().Top("500").From(KcbLuotkham.Schema); // if (sql.GetRecordCount() >= 500) // { // UIAction.SetTextStatus(lblMsg, "Phiên bản demo đã hết hiệu lực.......", false); // Thread.Sleep(4000); // Application.Exit(); // } //} Utility.LoadImageLogo(); } catch (Exception ex) { Utility.ShowMsg(ex.Message); } finally { THU_VIEN_CHUNG.GetIP4Address(); THU_VIEN_CHUNG.GetMACAddress(); THU_VIEN_CHUNG.LoadThamSoHeThong(); } }
public void LoadList() { try { Try2SaveXML(); UIAction.SetTextStatus(lblMsg, "Nạp thông tin cấu hình...", false); Utility.LoadProperties(); UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục thuốc...", false); globalVariables.gv_dtDangbaoche = SPs.DmucLaydmucDangbaochethuoc().GetDataSet().Tables[0]; globalVariables.gv_dtDanhMucThuoc = new Select().From(VDmucThuoc.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtLoaiThuoc = new Select().From(DmucLoaithuoc.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtDmucChung = new Select().From(DmucChung.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtQheDoituongThuoc = new Select().From(QheDoituongThuoc.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục bệnh...", false); globalVariables.gv_dtDmucLoaibenh = THU_VIEN_CHUNG.LayDulieuDanhmucChung(new List <string> { "LOAIBENH" }, false); globalVariables.gv_dtDmucBenh = new Select().From(VDanhmucbenh.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục địa chính...", false); globalVariables.gv_dtDmucDiachinh = new Select().From(VDmucDiachinh.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtDmucBenhVien = new Select().From(DmucBenhvien.Schema).ExecuteDataSet().Tables[0]; Utility.AutoCompeleteAddress(globalVariables.gv_dtDmucDiachinh); UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục nơi KCBBĐ...", false); globalVariables.gv_dtDmucNoiKCBBD = new Select().From(VDmucNoiKCBBD.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu dịch vụ CLS...", false); globalVariables.gv_dtDmucQheCamCLSChungPhieu = new Select().From(QheCamchidinhChungphieu.Schema).Where(QheCamchidinhChungphieu.Columns.Loai). IsEqualTo(0).ExecuteDataSet().Tables[0]; globalVariables.gv_dtDmucDichvuCls = new Select().From(VDmucDichvucl.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtDmucDichvuClsChitiet = new Select().From(VDmucDichvuclsChitiet.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtNhomDichVuCLS = new Select().From(DmucNhomcanlamsang.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtQheDoituongDichvu = new Select().From(QheDoituongDichvucl.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu hệ thống khác...", false); globalVariables.gv_dtSysparams = new Select().From(SysSystemParameter.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtSysTieude = new Select().From(SysTieude.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtNhomInCLS = (from p in globalVariables.gv_dtDmucChung.AsEnumerable() where p.Field <string>(DmucChung.Columns.Loai) == "NHOM_INPHIEU_CLS" select p).CopyToDataTable(); globalVariables.IdKhoaNhanvien = (Int16)THU_VIEN_CHUNG.LayIDPhongbanTheoUser(globalVariables.UserName); globalVariables.gv_dtDoituong = new Select().From(DmucDoituongkcb.Schema) .OrderAsc(DmucDoituongkcb.Columns.SttHthi) .ExecuteDataSet() .Tables[0]; globalVariables.idKhoatheoMay = (Int16)THU_VIEN_CHUNG.LayIdPhongbanTheoMay(globalVariables.MA_KHOA_THIEN); globalVariablesPrivate.objKhoaphong = DmucKhoaphong.FetchByID(globalVariables.idKhoatheoMay); globalVariablesPrivate.objNhanvien = new Select().From(DmucNhanvien.Schema) .Where(DmucNhanvien.Columns.UserName) .IsEqualTo(globalVariables.UserName) .ExecuteSingle <DmucNhanvien>(); if (globalVariablesPrivate.objNhanvien != null) { globalVariablesPrivate.objKhoaphongNhanvien = DmucKhoaphong.FetchByID(globalVariablesPrivate.objNhanvien.IdKhoa); } globalVariables.gv_dtKhoaPhongNgoaiTru = SPs.DmucLaydanhsachCacphongkhamTheoBacsi(globalVariables.UserName, globalVariables.idKhoatheoMay, Utility.Bool2byte( globalVariables.IsAdmin), 0).GetDataSet().Tables[0]; globalVariables.g_dtMeasureUnit = THU_VIEN_CHUNG.LayDulieuDanhmucChung(new List <string> { "DONVITINH" }, false); globalVariables.gv_dtDmucPhongban = new Select().From(DmucKhoaphong.Schema).ExecuteDataSet().Tables[0]; globalVariables.gv_dtDantoc = new Select().From(DmucChung.Schema) .Where(DmucChung.Columns.Loai) .IsEqualTo("DAN_TOC") .ExecuteDataSet() .Tables[0]; globalVariables.SysDate = THU_VIEN_CHUNG.GetSysDateTime(); globalVariables.gv_dtDmucNhanvien = new Select().From(VDmucNhanvien.Schema).ExecuteDataSet().Tables[0]; Utility.LoadImageLogo(); } catch (Exception ex) { Utility.CatchException(ex); } finally { THU_VIEN_CHUNG.GetIP4Address(); THU_VIEN_CHUNG.GetMACAddress(); THU_VIEN_CHUNG.LoadThamSoHeThong(); } }
public void LoadList() { try { Try2SaveXML(); UIAction.SetTextStatus(lblMsg, "Nạp thông tin cấu hình...", false); Utility.LoadProperties(); UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục bệnh...", false); // globalVariables.gv_dtDmucChung = new Select().From(DmucChung.Schema).ExecuteDataSet().Tables[0]; // globalVariables.gv_dtDmucLoaibenh = THU_VIEN_CHUNG.LayDulieuDanhmucChung(new List<string> { "LOAIBENH" }, false); // globalVariables.gv_dtDmucBenh = new Select().From(VDanhmucbenh.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục địa chính...", false); // globalVariables.gv_dtDmucDiachinh = new Select().From(VDmucDiachinh.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu danh mục nơi KCBBĐ...", false); // globalVariables.gv_dtDmucNoiKCBBD = new Select().From(VDmucNoiKCBBD.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu dịch vụ CLS...", false); // globalVariables.gv_dtDmucDichvuCls = new Select().From(VDmucDichvucl.Schema).ExecuteDataSet().Tables[0]; // globalVariables.gv_dtDmucDichvuClsChitiet = new Select().From(VDmucDichvuclsChitiet.Schema).ExecuteDataSet().Tables[0]; //globalVariables.gv_dtQheDoituongDichvu = // new Select().From(QheDoituongDichvucl.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu thuốc...", false); // globalVariables.gv_dtQheDoituongThuoc = new Select().From(QheDoituongThuoc.Schema).ExecuteDataSet().Tables[0]; UIAction.SetTextStatus(lblMsg, "Nạp dữ liệu hệ thống khác...", false); globalVariables.gv_dtSysparams = new Select().From(SysSystemParameter.Schema).ExecuteDataSet().Tables[0]; // globalVariables.gv_dtSysTieude = new Select().From(SysTieude.Schema).ExecuteDataSet().Tables[0]; // globalVariables.IdKhoaNhanvien = (Int16)THU_VIEN_CHUNG.LayIDPhongbanTheoUser(globalVariables.UserName); // globalVariables.idKhoatheoMay = (Int16)THU_VIEN_CHUNG.LayIDPhongbanTheoMay(globalVariables.MA_KHOA_THIEN); // globalVariables.objKhoaphong = DmucKhoaphong.FetchByID(globalVariables.idKhoatheoMay); // globalVariables.objNhanvien = new Select().From(DmucNhanvien.Schema).Where(DmucNhanvien.Columns.UserName).IsEqualTo(globalVariables.UserName).ExecuteSingle<DmucNhanvien>(); // globalVariables.gv_dtDanhmucchung = new Select().From(DmucChung.Schema).ExecuteDataSet().Tables[0]; // globalVariables.g_dtMeasureUnit = THU_VIEN_CHUNG.LayDulieuDanhmucChung(new List<string> { "DONVITINH" }, false); // globalVariables.gv_dtDmucPhongban = new Select().From(DmucKhoaphong.Schema).ExecuteDataSet().Tables[0]; globalVariables.SysDate = THU_VIEN_CHUNG.GetSysDateTime(); //var query = from o in Directory.GetFiles(Application.StartupPath + @"/Hislink_log", "*.*", //SearchOption.AllDirectories) // let x = new FileInfo(o) // where x.CreationTime <= THU_VIEN_CHUNG.GetSysDateTime().AddMonths(-6) // select o; //foreach (var item in query) //{ // File.Delete(item); //} // globalVariables.gv_dtDmucNhanvien = new Select().From(VDmucNhanvien.Schema).ExecuteDataSet().Tables[0]; Utility.LoadImageLogo(); }// globalVariables.b_LISConnectionState = HIS_LIS.isLISConnectionState() catch (Exception ex) { } finally { THU_VIEN_CHUNG.GetIP4Address(); THU_VIEN_CHUNG.GetMACAddress(); THU_VIEN_CHUNG.LoadThamSoHeThong(); } }