private void comboBox_TextChanged(object sender, EventArgs e) { if (iniPro) { return; } ComboBox cbx = ( ComboBox )sender; Conv.OfficeAndDepartZ(comboBoxOffice, comboBoxDepart); switch (cbx.Name) { case "comboBoxOffice": create_cbDepart(); ListFormDataOp lo = new ListFormDataOp(); cmd = lo.SelectCostDataInitialF(Conv.OfficeCode); tcd = lo.SelectTaskCodeNameData(Conv.OfficeCode); break; case "comboBoxDepart": break; default: break; } selectPaymentData(dataGridView1, dateTimePickerEx1.Value.EndOfMonth(), Conv.OfficeCode, Conv.DepartCode); }
// [Ctrl]と組み合わせたTextBoxの操作用Short-Cut Key // 前提:コントロールがTextBoxにある時 private void textBox_KeyDown(object sender, KeyEventArgs e) { labelMessage.Text = ""; if (iniPro) { return; } TextBox tb = ( TextBox )sender; if (e.KeyCode == Keys.Enter) { switch (tb.Name) { case "textBoxItem": if (!selectCostMaster(textBoxItem.Text)) { MessageBox.Show("指定された原価コードのデータはありません"); return; } break; default: break; } } if ((e.Modifiers & Keys.Control) != Keys.Control) { return; // Ctrlキーが押下された時のみ以下処理 } if (e.KeyCode == Keys.A) { ListFormDataOp lo = new ListFormDataOp(); cmd = lo.SelectCostDataInitialF(hp.OfficeCode); chooseCostData(); iSelPro[0] = false; iSelPro[1] = false; checkBoxTSelAll.Checked = false; checkBoxCSelAll.Checked = false; } if (textBoxItem.Text == "") { labelItemCode.Text = ""; return; } else { dispTaskCodeNameList(Convert.ToString(comboBoxOffice.SelectedValue), Convert.ToString(comboBoxDepart.SelectedValue)); dispCostList(Convert.ToString(comboBoxOffice.SelectedValue)); } }
//----------------------------------------------------------------------------// // Property // //----------------------------------------------------------------------------// //----------------------------------------------------------------------------// // Method // //----------------------------------------------------------------------------// private void FormOsPayment_Load(object sender, EventArgs e) { create_cbOffice(); comboBoxOffice.Text = hp.OfficeCode; // 初期値 create_cbDepart(); comboBoxDepart.Text = hp.Department; // 初期値 this.clsArray = new DateTime[] { hp.CloseHDate, hp.CloseKDate, hp.CloseSDate, hp.CloseTDate }; // 現在の締日リスト dataGridView1.Rows.Add(iniRCnt); UiHandling ui = new UiHandling(dataGridView1); ui.DgvReadyNoRHeader(); readyDateTimePicker(); dateTimePickerEx1.Value = clsArray[Conv.oList.IndexOf(hp.OfficeCode)].AddMonths(1); // 初期表示開始月(締月の翌月) preReportDate = dateTimePickerEx1.Value.EndOfMonth(); labelACheckDate.Text = ""; labelDCheckDate.Text = ""; labelPCheckDate.Text = ""; labelMsg.Text = ""; readyCheckBox(); buttonEnabled(); buttonCost.Enabled = false; // 取引先マスタより外注先一覧作成 Conv.OfficeAndDepartZ(comboBoxOffice, comboBoxDepart); ListFormDataOp lo = new ListFormDataOp(); psd = lo.SelectPartnersScData(); tcd = lo.SelectTaskCodeNameData(Conv.OfficeCode); cmd = lo.SelectCostDataInitialF(Conv.OfficeCode); selectPaymentData(dataGridView1, dateTimePickerEx1.Value.EndOfMonth(), Conv.OfficeCode, Conv.DepartCode); }