Esempio n. 1
0
        private void GetLogin()
        {
            var TrungTam   = BioNet_Bus.GetThongTinTrungTam();
            var NgayServer = BioNet_Bus.GetDateTime();

            DLLLicensePS.Reponse res = DLLLicensePS.DECRYPT.CheckLisences(TrungTam.ID, string.Empty, TrungTam.LicenseKey, NgayServer.Date.ToString("dd/MM/yyyy"), DateTime.Now.Date.ToString("dd/MM/yyy"));

            if (!res.Result)
            {
                XtraMessageBox.Show("Bản quyền phần mềm hết hạn,vui lòng liên hệ với nhà cung cấp! \r\n Thông tin chi tiết : " + res.ResultString, "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            else
            {
                if (res.TimeRemind < 7)
                {
                    string str = @"Bản quyền phần mềm chỉ còn {0} ngày. 
Vui lòng liên hệ mua bản quyền để sử dụng phần mềm không bị gián đoạn!";
                    string mes = string.Format(str, res.TimeRemind);
                    XtraMessageBox.Show(mes, "BioNet - Chương trình sàng lọc sơ sinh!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                DiaglogFrm.FrmLogin frm = new DiaglogFrm.FrmLogin();
                frm.ShowDialog();
                if (!frm.cancel)
                {
                    this.empCode = frm._EmployeeCode;
                    List <PSMenuSecurity> lstMenuSecurity = new List <PSMenuSecurity>();
                    lstMenuSecurity = BioBLL.ListMenuSecurity(empCode);
                    foreach (var item in lstMenuSecurity)
                    {
                        this.SetMenu(item.MenuCode);
                    }
                }
            }
        }
 private void LoadNgayServer()
 {
     try
     {
         this.NgayServer = BioNet_Bus.GetDateTime();
     }
     catch { }
 }
Esempio n. 3
0
        private void CheckPhieu(string maPhieu, string maDonVi) //kiểm tra mã phiếu đã nằm trong lstTiepNhan hay chưa?
        {
            try
            {
                if (this.searchLookUpDonViCoSoTiepNhan.EditValue == null && !(string.IsNullOrEmpty(maDonVi)))
                {
                    this.searchLookUpDonViCoSoTiepNhan.EditValue = maDonVi;
                }
            }
            catch (Exception ex) { }
            bool isTonTaiTrongDB = BioNet_Bus.KiemTraThongTinPhieuDaDuocTiepNhan(maPhieu);

            if (isTonTaiTrongDB)
            {
                XtraMessageBox.Show("Phiếu này đã được nhập rồi,vui lòng chọn phiếu mới", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.txtMaPhieuMoi.ResetText();
                return;
            }
            var ph = this.lstPhieu.FirstOrDefault(p => p.maPhieu == maPhieu);

            if (ph != null) //lấy dữ liệu từ lstPhieu qua nếu mã thẻ có tồn tại trong lstPhieu
            {
                PSTiepNhan tNhan = new PSTiepNhan();
                if (!(string.IsNullOrEmpty(maDonVi)))
                {
                    if (!maDonVi.Equals(ph.maDonViCoSo))
                    {
                        if (XtraMessageBox.Show("Thông tin phiếu nhập mới tồn tại trong danh sách chờ nhưng khác đơn vị \r\n Bạn bạn đã chọn sai đơn vị đúng không?", "BioNet - Chương trình sàng lọc sơ sinh", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                        {
                            tNhan.MaDonVi = ph.maDonViCoSo;
                        }
                        else
                        {
                            tNhan.MaDonVi = maDonVi;
                        }
                    }
                    else
                    {
                        tNhan.MaDonVi = ph.maDonViCoSo;
                    }
                }
                else
                {
                    tNhan.MaDonVi = ph.maDonViCoSo;
                }
                tNhan.MaNVTiepNhan  = this.MaNhanVienDangNhap; ///"Gán mã user đăng nhập vô đây"
                tNhan.MaPhieu       = ph.maPhieu;
                tNhan.NgayTiepNhan  = DateTime.Now;            //lấy theo phiên đăng nhập
                tNhan.isDaDanhGia   = false;
                tNhan.RowIDTiepNhan = 0;
                tNhan.isDaNhapLieu  = true;
                ThemMoiPhieuVaoDanhSachTiepNhan(tNhan);
                this.lstPhieu.Remove(ph);
                this.LoadGCPhieuCho();
            }
            else //thêm phiếu mới vào lstTiepNhan, mã đơn vị = mã đơn vị được người dùng chọn trên combobox
            {
                PSTiepNhan tNhan = new PSTiepNhan();
                if (!(string.IsNullOrEmpty(maDonVi)))
                {
                    tNhan.MaDonVi = maDonVi;
                }
                else
                {
                    tNhan.MaDonVi = searchLookUpDonViCoSoTiepNhan.EditValue.ToString();
                }
                tNhan.MaNVTiepNhan  = this.MaNhanVienDangNhap;///"Gán mã user đăng nhập vô đây"
                tNhan.MaPhieu       = maPhieu;
                tNhan.isDaNhapLieu  = false;
                tNhan.isDaDanhGia   = false;
                tNhan.NgayTiepNhan  = BioNet_Bus.GetDateTime(); //lấy theo phiên đăng nhập
                tNhan.RowIDTiepNhan = 0;
                ThemMoiPhieuVaoDanhSachTiepNhan(tNhan);
            }
        }