void ReLoadDevice4FPD() { try { clsUser objtemp = new clsUser(); DataTable dtDevice = new ModalityController().GetAllData(false).Tables[0]; if (dtDevice != null) { 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"; } } catch { } finally { AutoSetFPDModebyLoginInfo(); } }
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; } }
void LoadDualDevice(int deviceid1, int deviceid2) { try { lblFPD1.Text = "Tấm cảm biến 1"; lblFPD2.Text = "Tấm cảm biến 2"; clsUser objtemp = new clsUser(); DataTable dtDevice = new ModalityController().GetAllData(false).Tables[0]; if (dtDevice != null) { 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"; DataRow[] arrDR = dtDevice.Select("MODALITY_ID=" + deviceid2); if (arrDR.Length <= 0) return; cboDeviceLogin2.DataSource = arrDR.CopyToDataTable().DefaultView; cboDeviceLogin2.DisplayMember = "MODALITY_NAME"; cboDeviceLogin2.ValueMember = "MODALITY_ID"; arrDR = dtDevice.Select("MODALITY_ID=" + deviceid1); if (arrDR.Length <= 0) return; cboDeviceLogin.DataSource = arrDR.CopyToDataTable().DefaultView; cboDeviceLogin.DisplayMember = "MODALITY_NAME"; cboDeviceLogin.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(); } if (cboDeviceLogin2.Items.Count > 0) { cboDeviceLogin2.SelectedIndex = 0; modName2 = ((DataRowView)cboDeviceLogin2.SelectedItem)["MODALITY_NAME"].ToString(); modTypeCode2 = ((DataRowView)cboDeviceLogin2.SelectedItem)["MOD_TYPE_CODE"].ToString(); modTypeName2 = ((DataRowView)cboDeviceLogin2.SelectedItem)["Mod_Type_Name"].ToString(); modCode2 = ((DataRowView)cboDeviceLogin2.SelectedItem)["MODALITY_CODE"].ToString(); m_intCurrDevice2 = Convert.ToInt32(((DataRowView)cboDeviceLogin2.SelectedItem)["MODALITY_ID"].ToString()); LoadDeviceInfor2(); } } } catch { } finally { } }