Esempio n. 1
0
        private void frm_AllMain_Load(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    var asm = Assembly.LoadFrom("VIETBAIT.LIS.HISConnectivity.dll");
                    var obj = (UserControl)asm.CreateInstance("VIETBAIT.LIS.HISConnectivity.Usc_KetNoi_XetNghiem");
                    if (obj != null)
                    {
                        obj.Dock = DockStyle.Fill;
                        obj.Visible = true;
                        tabHISLIS.TabVisible = true;
                        tabHISLIS.Controls.Add(obj);
                        //obj.BringToFront();
                    }
                }
                catch (Exception ex)
                {

                }
                try
                {
                    var asm = Assembly.LoadFrom("VIETBAIT.LIS.HISConnectivity.dll");
                    var obj = (UserControl)asm.CreateInstance("VIETBAIT.LIS.HISConnectivity.Usc_HisLis_Gtvt");
                    if (obj != null)
                    {
                        obj.Dock = DockStyle.Fill;
                        obj.Visible = true;
                        tabHISLIS.TabVisible = true;
                        tabHISLIS.Controls.Add(obj);
                        //obj.BringToFront();
                    }
                }
                catch (Exception ex)
                {
                    // Utility.ShowMsg("Lỗi ko load form HISConnectivity" + ex.ToString());
                }
                // Load tab HIS-LIS
                try
                {
                    var asm = Assembly.LoadFrom("VIETBAIT.LIS.HISConnectivity2.dll");
                    var obj = (UserControl) asm.CreateInstance("VIETBAIT.LIS.HISConnectivity.Uc_HisLis_NoiTiet");
                    if (obj != null)
                    {
                        obj.Dock = DockStyle.Fill;
                        obj.Visible = true;
                        tabHISLIS.TabVisible = true;
                        tabHISLIS.Controls.Add(obj);
                        //obj.BringToFront();
                    }
                }
                catch (Exception ex)
                {
                    //   Utility.ShowMsg("Lỗi ko load form HISConnectivity" + ex.ToString());
                }

                try
                {
                    if(_myProperties.TabCapNhapKetQua ==false)
                    {
                         var x = new Uc_QuickInputResult();
                    x.Dock = DockStyle.Fill;
                    x.Visible = true;
                    tabQuickInput.TabVisible = true;
                    tabQuickInput.Controls.Add(x);
                    }

                }
                catch (Exception ex)
                {
                    //  Utility.ShowMsg("Lỗi ko load form Uc_QuickInputResult" + ex.ToString());
                }
                try
                {
                    if (_myProperties.TabXulyDL == false)
                    {
                        tabDataMonitor.TabVisible = true;
                    }

                }
                catch (Exception ex)
                {
                    //  Utility.ShowMsg("Lỗi ko load form Uc_QuickInputResult" + ex.ToString());
                }

                SetEventColumnHeaderColor();

                if (!File.Exists(_autoLoadRegListFile))
                {
                    _autoLoadRegList = false;
                    File.WriteAllText(_autoLoadRegListFile, "0");
                }
                else
                {
                    var tempStr = File.ReadAllText(_autoLoadRegListFile);
                    _autoLoadRegList = tempStr.Contains("1");
                }

                ControlUtilities controlUtilities = new ControlUtilities();
                controlUtilities.FormName = this.Name;
                controlUtilities.Control = this;
                controlUtilities.SetChildWindowsFormProperties();

                ResetTabKey resetTabKey = new ResetTabKey();
                resetTabKey.ArrControl = new Control[] {grdTestInfoModification, grdResultModification};
                resetTabKey.Implement();

                _bw.DoWork += BwPerformSearch;
                _bw.RunWorkerCompleted += BwRunWorkerCompleted;

              //  btnExpandPanelText = btnExpandPanel.Text;
                LoadTestType();
                LoadDepartment();
                LoadObjectType();
                LoadSexCombo();
                LoadDevice();
                //cboDate.SelectedIndex = 0;
                grdPatients.CheckAllRecords();
                if (cmsResultDetail.Items["tsmEditResult"].Enabled == false)
                {
                    grdResultDetail.RootTable.Columns["Test_Result"].EditType = EditType.NoEdit;
                    grdResultDetail.RootTable.Columns["Test_Result"].CellStyle.BackColor = colorNoEditResult;
                }

                // Gán sự kiện cho các nút lọc đã in và chưa in
                rbtTatCa.CheckedChanged += rbtPrint_Checked_Changed;
                rbtChuaIn.CheckedChanged += rbtPrint_Checked_Changed;
                rbtDaIn.CheckedChanged += rbtPrint_Checked_Changed;
                tabTestInfo.SelectedIndex = 1;
                cmdSearch.PerformClick();
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi:" + ex.Message);
                Dispose();
            }
        }