/// <summary> /// setShiharaiList /// 支払リストに移動 /// </summary> private void setShiharaiList() { ShiharaiList shiharailist = new ShiharaiList(this); try { // 支払リストの表示 shiharailist.bmDenpyo = txtDenpyoNo; shiharailist.radListInput = radSet_chkListDataInput; shiharailist.ShowDialog(); //リストからデータを取り出した場合 if (radSet_chkListDataInput.radbtn1.Checked == true) { //伝票データを入れる setDenpyoData(); dateCheck(); } } catch (Exception ex) { // エラーロギング new CommonException(ex); // 例外発生メッセージ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_ERROR, CommonTeisu.LABEL_ERROR_MESSAGE, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); return; } }
///<summary> ///updTxtTokuisakiLeave ///code入力箇所からフォーカスが外れた時 ///</summary> public void updTxtTokuisakiLeave(object sender, EventArgs e) { //データ渡し用 List <string> lstStringSQL = new List <string>(); DataTable dtSetCd; if (this.CodeTxtText == "" || String.IsNullOrWhiteSpace(this.CodeTxtText).Equals(true)) { this.ValueLabelText = ""; this.AppendLabelText = ""; return; } //禁止文字チェック if (StringUtl.JudBanSQL(this.CodeTxtText) == 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 == "NyukinList") { //データを連れてくるため、newをしないこと NyukinList nyukinlist = (NyukinList)frm; nyukinlist.btnEndClick(sender, e); return; } //支払リストの場合 else if (frm.Name == "ShiharaiList") { //データを連れてくるため、newをしないこと ShiharaiList shiharailist = (ShiharaiList)frm; shiharailist.btnEndClick(sender, e); } } } } } } } //グループボックスかパネル内にいる場合 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.CodeTxtText = ""; this.AppendLabelText = ""; //エラーメッセージを表示された blMessageOn = true; return; } // 全角数字を半角数字に変換 this.CodeTxtText = StringUtl.JudZenToHanNum(this.CodeTxtText); // 数値チェック if (StringUtl.JudBanSelect(this.CodeTxtText, CommonTeisu.NUMBER_ONLY) == true) { //4文字以下の場合0パティング if (this.CodeTxtText.Length < 4) { this.CodeTxtText = this.CodeTxtText.ToString().PadLeft(4, '0'); } } //データ渡し用 lstStringSQL.Add("Common"); lstStringSQL.Add("C_LIST_TokuisakiAS400_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 { //グループボックスかパネル内にいる場合 if (this.Parent is GroupBox || this.Parent is Panel) { //メッセージボックスの処理、項目のデータがない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent.Parent, CommonTeisu.TEXT_VIEW, CommonTeisu.LABEL_NOTDATA, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); } else { //メッセージボックスの処理、項目のデータがない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent, CommonTeisu.TEXT_VIEW, CommonTeisu.LABEL_NOTDATA, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); } this.ValueLabelText = ""; this.CodeTxtText = ""; this.AppendLabelText = ""; blMessageOn = true; } 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(); return; } else { //例外発生メッセージ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent, CommonTeisu.TEXT_ERROR, CommonTeisu.LABEL_ERROR_MESSAGE, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); return; } } }