///<summary> ///txtMakerKeyDown ///キー入力判定 ///作成者:大河内 ///作成日:2017/3/6 ///更新者:大河内 ///更新日:2017/3/7 ///カラム論理名 ///</summary> private void txtMakerKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F9) { MakerList makerlist = new MakerList(); makerlist.Left = 100; makerlist.StartPosition = FormStartPosition.Manual; makerlist.intFrmKind = CommonTeisu.FRM_MAKER; makerlist.Show(); } }
private void FilterInitialize() { // メーカー名フィルター初期化 MakerList.Clear(); foreach (var s in Filters.Select(p => p.Maker).Distinct()) { MakerList.Add(s); } // シリーズ名フィルター初期化 SeriesList.Clear(); var list = Filters.Select(p => p.Series).Distinct(); foreach (var s in list) { SeriesList.Add(s); } }
///<summary> ///showMakerList ///メーカーリストの表示 ///</summary> private void showMakerList() { //メーカーリストのインスタンス生成 MakerList makerlist = new MakerList(this); try { //メーカーリストの表示、画面IDを渡す makerlist.StartPosition = FormStartPosition.Manual; makerlist.intFrmKind = CommonTeisu.FRM_MAKER; makerlist.ShowDialog(); } catch (Exception ex) { //エラーロギング new CommonException(ex); return; } }
///<summary> ///judMakerEditKeyDown ///コード入力項目でのキー入力判定(編集メーカー) ///作成者:大河内 ///作成日:2017/3/16 ///更新者:大河内 ///更新日:2017/3/16 ///カラム論理名 ///</summary> private void judMakerEditKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F9) { if (String.IsNullOrWhiteSpace(txtDaibunrui.Text).Equals(true)) { return; } MakerList makerlist = new MakerList(); makerlist.Left = 100; makerlist.StartPosition = FormStartPosition.Manual; makerlist.intFrmKind = CommonTeisu.FRM_TANAOROSHI_EDIT; makerlist.strDaibunruiCode = txtDaibunrui.Text; makerlist.Show(); } else { setMoveOrder(sender, e); } }
///<summary> ///judMakerKeyDown ///コード入力項目でのキー入力判定(メーカー) ///</summary> private void judMakerKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F9) { if (this.Parent is GroupBox || this.Parent is Panel) { MakerList makerList = new MakerList(this.Parent.Parent, this, strDaibunCd); makerList.Show(); } else { MakerList makerList = new MakerList(this.Parent, this, strDaibunCd); makerList.Show(); } } else if (e.KeyCode == Keys.Enter) { //TABボタンと同じ効果 SendKeys.Send("{TAB}"); } }
///<summary> ///updTxtDaibunruiLeave ///code入力箇所からフォーカスが外れた時の処理 ///</summary> public void setTxtDaibunruiLeave() { //データ渡し用 List <string> lstStringSQL = new List <string>(); DataTable dtSetCd; //情報を投げる必須項目になるため空の情報を作成 object sender = null; EventArgs e = null; //空白、文字数3以上の場合 if (this.CodeTxtText == "" || String.IsNullOrWhiteSpace(this.CodeTxtText).Equals(true) || this.CodeTxtText.Length > 2) { this.ValueLabelText = ""; this.AppendLabelText = ""; return; } //前後の空白を取り除く this.CodeTxtText = this.CodeTxtText.Trim(); // 禁止文字チェックと数値チェック if (StringUtl.JudBanSQL(this.CodeTxtText) == false || StringUtl.JudBanSelect(this.CodeTxtText, CommonTeisu.NUMBER_ONLY) == false) { //Parent 内のすべてのコントロールを列挙する foreach (Control cControl in Parent.Controls) { //列挙したコントロールにコントロールが含まれている場合は再帰呼び出しする if (cControl is BaseButton) { if (cControl.Text == "F12:戻る") { //フォーカスがボタンを指している場合 Control ctrlParent = ParentForm.ActiveControl; if (ctrlParent.Name == "btnF12") { //全てのフォームの中から foreach (System.Windows.Forms.Form frm in Application.OpenForms) { //商品のフォームを探す if (frm.Name == Parent.Name) { //中分類リストの場合 if (frm.Name == "ChubunruiList") { //データを連れてくるため、newをしないこと ChubunruiList chubunlist = (ChubunruiList)frm; chubunlist.btnEndClick(sender, e); return; } //メーカーリストの場合 else if (frm.Name == "MakerList") { //データを連れてくるため、newをしないこと MakerList makerlist = (MakerList)frm; makerlist.btnEndClick(sender, e); return; } } } } } } } //グループボックスかパネル内にいる場合 if (this.Parent is GroupBox || this.Parent is Panel) { //メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(Parent.Parent, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); } else { //メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(Parent, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); } this.ValueLabelText = ""; this.AppendLabelText = ""; this.CodeTxtText = ""; //エラーメッセージを表示された blMessageOn = true; return; } if (this.CodeTxtText.Length == 1) { CodeTxtText = CodeTxtText.ToString().PadLeft(2, '0'); } //データ渡し用 lstStringSQL.Add("Common"); lstStringSQL.Add("C_LIST_Daibun_SELECT_LEAVE"); OpenSQL opensql = new OpenSQL(); try { string strSQLInput = opensql.setOpenSQL(lstStringSQL); if (strSQLInput == "") { return; } strSQLInput = string.Format(strSQLInput, this.CodeTxtText); //SQLのインスタンス作成 DBConnective dbconnective = new DBConnective(); //SQL文を直書き(+戻り値を受け取る) dtSetCd = dbconnective.ReadSql(strSQLInput); if (dtSetCd.Rows.Count != 0) { this.CodeTxtText = dtSetCd.Rows[0]["大分類コード"].ToString(); this.ValueLabelText = dtSetCd.Rows[0]["大分類名"].ToString(); blMessageOn = false; } else { this.ValueLabelText = ""; //グループボックスかパネル内にいる場合 if (this.Parent is GroupBox || this.Parent is Panel) { //メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(Parent.Parent, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); } else { //メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(Parent, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); } this.ValueLabelText = ""; this.AppendLabelText = ""; this.CodeTxtText = ""; //エラーメッセージを表示された blMessageOn = true; return; } //中分類のプロパティが空でない場合 if (lschubundata != null) { lschubundata.strDaibunCd = dtSetCd.Rows[0]["大分類コード"].ToString(); } if (lsSubchubundata != null) { lsSubchubundata.strDaibunCd = dtSetCd.Rows[0]["大分類コード"].ToString(); } //メーカーのプロパティが空でない場合 if (lsmakerdata != null) { lsmakerdata.strDaibunCd = dtSetCd.Rows[0]["大分類コード"].ToString(); } if (lsSubmakerdata != null) { lsSubmakerdata.strDaibunCd = dtSetCd.Rows[0]["大分類コード"].ToString(); } return; } catch (Exception ex) { //データロギング new CommonException(ex); //グループボックスかパネル内にいる場合 if (this.Parent is GroupBox || this.Parent is Panel) { //例外発生メッセージ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent.Parent, CommonTeisu.TEXT_ERROR, CommonTeisu.LABEL_ERROR_MESSAGE, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); return; } else { //例外発生メッセージ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent, CommonTeisu.TEXT_ERROR, CommonTeisu.LABEL_ERROR_MESSAGE, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); return; } } }