Exemple #1
0
        void LoadDevice()
        {
            try
            {
                clsUser objtemp = new clsUser();

                DataTable dtDevice = new ModalityController().GetAllData(false).Tables[0];
                if (dtDevice != null)
                {
                    cboDevice.DataSource = dtDevice.DefaultView;
                    cboDevice.DisplayMember = "MODALITY_NAME";
                    cboDevice.ValueMember = "MODALITY_ID";


                    cboDeviceLogin.DataSource = dtDevice.DefaultView;
                    cboDeviceLogin.DisplayMember = "MODALITY_NAME";
                    cboDeviceLogin.ValueMember = "MODALITY_ID";
                    cboDevice_SelectedValueChanged(cboDeviceLogin, new EventArgs());


                    cboFPD1.DataSource = dtDevice.Select("1=1").CopyToDataTable().DefaultView;
                    cboFPD1.DisplayMember = "MODALITY_NAME";
                    cboFPD1.ValueMember = "MODALITY_ID";


                    cboFPD2.DataSource = dtDevice.Select("1=1").CopyToDataTable().DefaultView;
                    cboFPD2.DisplayMember = "MODALITY_NAME";
                    cboFPD2.ValueMember = "MODALITY_ID";

                    if (cboDeviceLogin.Items.Count > 0)
                    {
                        cboDeviceLogin.SelectedIndex = 0;
                        modName = ((DataRowView)cboDeviceLogin.SelectedItem)["MODALITY_NAME"].ToString();
                        modTypeCode = ((DataRowView)cboDeviceLogin.SelectedItem)["MOD_TYPE_CODE"].ToString();
                        modTypeName = ((DataRowView)cboDeviceLogin.SelectedItem)["Mod_Type_Name"].ToString();
                        modCode = ((DataRowView)cboDeviceLogin.SelectedItem)["MODALITY_CODE"].ToString();
                        m_intCurrDevice1 = Convert.ToInt32(((DataRowView)cboDeviceLogin.SelectedItem)["MODALITY_ID"].ToString());
                        LoadDeviceInfor();

                    }

                }
            }
            catch
            {
            }
            finally
            {
                if (globalVariables.OleDbConnection.State == ConnectionState.Closed)
                {
                    Application.Exit();

                }
                else if (cboDevice.Items.Count <= 0)
                {
                    Utility.ShowMsg("Bạn phải khởi tạo danh mục tấm chụp trước khi thực hiện các nghiệp vụ. Nhấn OK để bắt đầu.");
                    frm_Modalities newForm = new frm_Modalities();
                    newForm.m_blnCallFromMenu = false;
                    newForm.ShowDialog();
                    LoadDevice();

                }
                cmdTest.Enabled = cboDevice.Items.Count > 0;
            }
        }
Exemple #2
0
 private void cmdDeviceList_Click_1(object sender, EventArgs e)
 {
     //using (frm_adSec _adSec = new frm_adSec())
     //{
     //    if (_adSec.ShowDialog() != DialogResult.OK)
     //        return;
     //}
     frm_Modalities newForm = new frm_Modalities();
     newForm.ShowDialog();
     LoadDevice();
     cboDevice.SelectedIndex = Utility.GetSelectedIndex(cboDevice, m_intCurrDevice1.ToString());
 }