// サブプロシージャ: バッチコンボボックスの設定 private void setBatchComboBox() { string sql = "select content from t_criteria where criteria = 'BATCH' order by content"; TfSQL tf = new TfSQL(); tf.getComboBoxData(sql, ref cmbBatch); }
// サブプロシージャ: バッチコンボボックスの設定 private void setShiftComboBox() { string sql = "select content from t_criteria where criteria = 'BIN_SHIFT' order by content"; TfSQL tf = new TfSQL(); tf.getComboBoxData(sql, ref cmbBinShift); }
private void LoginForm_Load(object sender, EventArgs e) { string cmd = "select distinct user_cd from m_mes_user order by user_cd"; SQL.getComboBoxData(cmd, ref cmbUserCD, true); cmbUserCD.Focus(); }
public void getComboListFromDB(ref ComboBox cmb) { string sql_model = "select model from tbl_model_dbplace order by model"; System.Diagnostics.Debug.Print(sql_model); TfSQL tf = new TfSQL(); tf.getComboBoxData(sql_model, ref cmb); if (cmbModel.Items.Count > 0) { cmbModel.SelectedIndex = 0; } }
// コンボボックス項目選択時の処理(モデルNO) private void cmbModelNo_SelectedIndexChanged(object sender, EventArgs e) { string sql; TfSQL tf = new TfSQL(); string model = cmbModelNo.Text; sql = "select model_name FROM t_model_sub_assy where model_no ='" + model + "'"; System.Diagnostics.Debug.Print(sql); txtModelName.Text = tf.sqlExecuteScalarString(sql); // コンボボックスへ候補をセットする(サブ組NO) sql = "select sub_assy_no FROM t_model_sub_assy where model_no ='" + model + "'"; System.Diagnostics.Debug.Print(sql); tf.getComboBoxData(sql, ref cmbSubAssy); cmbSubAssy.Enabled = true; // コンボボックスへ候補をセットする(ライン) sql = "select line FROM t_model_line where model_no ='" + model + "'"; System.Diagnostics.Debug.Print(sql); tf.getComboBoxData(sql, ref cmbLine); cmbLine.Enabled = true; }
// 部署コンボボックス選択時、ユーザーIDコンボボックスにDBリストを追加し、メニューコンボボックスにもリストを追加 private void cmbDept_SelectedIndexChanged(object sender, EventArgs e) { cmbUserId.Text = string.Empty; txtUserName.Text = string.Empty; // 2016.08.03 FUJIKI MFG にも PACK を許可させる // 2017.07.21 MFGはTrayしかできないにさせる(呉) string[] aryTray = new string[] { "MFG", "QA", "PC" }; string[] aryPack = new string[] { "MFG", "PC" }; string[] aryCart = new string[] { "PC" }; string[] aryPalt = new string[] { "PC" }; cmbMenu.Items.Clear(); if (0 <= Array.IndexOf(aryTray, cmbDept.Text)) { cmbMenu.Items.Add("1. Tray"); } if (0 <= Array.IndexOf(aryPack, cmbDept.Text)) { cmbMenu.Items.Add("2. Pack"); } if (0 <= Array.IndexOf(aryCart, cmbDept.Text)) { cmbMenu.Items.Add("3. Carton"); } if (0 <= Array.IndexOf(aryPalt, cmbDept.Text)) { cmbMenu.Items.Add("4. Pallet"); } cmbMenu.Enabled = true; cmbMenu.SelectedIndex = 0; // 2016.08.03 FUJIKI MFG にも PACK を許可させる TfSQL tf = new TfSQL(); string sql = "select distinct user_id from t_user where dept ='" + cmbDept.Text + "' order by user_id"; System.Diagnostics.Debug.Print(sql); tf.getComboBoxData(sql, ref cmbUserId); cmbUserId.Enabled = true; // 2016.08.03 FUJIKI MFG にも PACK を許可させる cmbMenu.SelectedIndex = (cmbMenu.Enabled ? cmbMenu.SelectedIndex : 1); cmbMenu.Enabled = (cmbMenu.Items.Count > 1); // if (cmbDept.Text == "PC") cmbMenu.Enabled = true; // else { cmbMenu.Enabled = false; cmbMenu.SelectedIndex = 0; } // 2016.08.03 FUJIKI MFG にも PACK を許可させる }
private void Login_Load(object sender, EventArgs e) { sql.getComboBoxData("select distinct userid from user_tbl", ref cmbUserID); }
private void EndplayCheckMainForm_Load(object sender, EventArgs e) { sql.getComboBoxData("select distinct model from processtbl order by model asc", ref cmbModel); }