///<summary> /// chkDaibunCd /// 大分類コードチェック ///</summary> private bool chkDaibunCd() { // 禁止文字チェック if (StringUtl.JudBanSQL(txtDaibunrui.Text) == false) { // メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtDaibunrui.Text = ""; txtDaibunrui.Focus(); return(true); } // 数値チェック if (StringUtl.JudBanSelect(txtDaibunrui.Text, CommonTeisu.NUMBER_ONLY) == false) { // メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtDaibunrui.Text = ""; txtDaibunrui.Focus(); return(true); } // 文字数が足りなかった場合0パティング if (txtDaibunrui.TextLength == 1) { txtDaibunrui.Text = txtDaibunrui.Text.ToString().PadLeft(2, '0'); } return(false); }
///<summary> /// chktxtGyoshuCd /// 業種コードチェック ///</summary> private bool chkGyoshuCd() { if (StringUtl.JudBanSQL(txtGyoshuCd.Text) == false) { //メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); this.txtGyoshuCd.Text = ""; txtGyoshuCd.Focus(); return(true); } // 全角数字を半角数字に変換 this.txtGyoshuCd.Text = StringUtl.JudZenToHanNum(txtGyoshuCd.Text); //数値数が足りなかった場合0パティング if (StringUtl.JudBanSelect(txtGyoshuCd.Text, CommonTeisu.NUMBER_ONLY) == true) { if (txtGyoshuCd.TextLength < 4) { txtGyoshuCd.Text = txtGyoshuCd.Text.ToString().PadLeft(4, '0'); } } return(false); }
///<summary> /// chkChokusoCd /// 直送先コードチェック ///</summary> private bool chkChokusoCd() { // 禁止文字チェック if (StringUtl.JudBanSQL(txtChokusoCd.Text) == false) { // メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); DipDelChokusoInfo(); return(true); } this.txtChokusoCd.Text = StringUtl.JudZenToHanNum(txtChokusoCd.Text); // 数値チェック if (StringUtl.JudBanSelect(txtChokusoCd.Text, CommonTeisu.NUMBER_ONLY) == true) { // 文字数が足りなかった場合0パティング if (txtChokusoCd.TextLength < 4) { txtChokusoCd.Text = txtChokusoCd.Text.ToString().PadLeft(4, '0'); } } return(false); }
///<summary> /// PGNo.チェック ///</summary> private bool chkPGNo() { // 禁止文字チェック if (StringUtl.JudBanSQL(labelSet_Menu.CodeTxtText) == false) { // メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); labelSet_Menu.CodeTxtText = ""; labelSet_Menu.codeTxt.Focus(); return(true); } // 数値チェック if (StringUtl.JudBanSelect(labelSet_Menu.CodeTxtText, CommonTeisu.NUMBER_ONLY) == false) { // メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); labelSet_Menu.CodeTxtText = ""; labelSet_Menu.codeTxt.Focus(); return(true); } return(false); }
///<summary> ///getDatagridView ///データグリッドビュー表示 ///</summary> public DataTable getDatagridView(List <string> lstUriageView) { //データグリッドビューを入れる用 DataTable dtGetTableGrid = new DataTable(); string strWhere; strWhere = "WHERE H.削除 = 'N' AND M.削除 = 'N' AND H.伝票番号=M.伝票番号 "; //担当者に記入がある場合 if (StringUtl.blIsEmpty(lstUriageView[0])) { strWhere = strWhere + " AND H.担当者コード ='" + lstUriageView[0] + "'"; } //取引先(表示は得意先)に記入がある場合 if (StringUtl.blIsEmpty(lstUriageView[1])) { strWhere = strWhere + " AND H.得意先コード ='" + lstUriageView[1] + "'"; } strWhere = strWhere + " AND H.伝票年月日 >='" + lstUriageView[2] + "'"; strWhere = strWhere + " AND H.伝票年月日 <='" + lstUriageView[3] + "'"; //品名・型番に記入がある場合 if (StringUtl.blIsEmpty(lstUriageView[4])) { strWhere = strWhere + " AND (Rtrim(ISNULL(M.C1,'')) "; strWhere = strWhere + " + Rtrim(ISNULL(M.C2,''))"; strWhere = strWhere + " + Rtrim(ISNULL(M.C3,''))"; strWhere = strWhere + " + Rtrim(ISNULL(M.C4,''))"; strWhere = strWhere + " + Rtrim(ISNULL(M.C5,''))"; strWhere = strWhere + " + Rtrim(ISNULL(M.C6,'')) ) LIKE '%" + lstUriageView[4] + "%' "; } //SQL用に移動 DBConnective dbconnective = new DBConnective(); try { string s = "SELECT H.伝票番号,H.伝票年月日,H.得意先名," + "RTRIM(ISNULL(M.C1,'')) AS 品名型番," + "M.数量,M.売上単価,M.備考," + "dbo.f_get担当者名(H.担当者コード) AS 担当者 " + "FROM 売上ヘッダ H,売上明細 M " + strWhere + " ORDER BY H.伝票年月日 DESC, H.得意先コード"; dtGetTableGrid = dbconnective.ReadSql(s); } catch (Exception ex) { new CommonException(ex); throw (ex); } return(dtGetTableGrid); }
/// <summary> /// 検収済仕入明細テーブル更新(検収済仕入明細更新_PROC実行) /// </summary> /// <param name="dt"> /// 更新対象データ(DataGridView内のデータ)</param> /// <param name="userName"> /// ユーザ名</param> /// <returns> /// </returns> public void UpdateKnesyuSiire(DataTable dt, string userName) { // DBコネクションのインスタンス生成 DBConnective dbconnective = new DBConnective(); foreach (DataRow row in dt.Rows) { string denNo = ""; string rowNo = ""; string status = ""; string strProc = ""; try { // トランザクション開始 dbconnective.BeginTrans(); denNo = row["伝票番号"].ToString(); rowNo = row["行番号"].ToString(); status = row["検収状態"].ToString(); if (StringUtl.blIsEmpty(status)) { strProc = "検収済仕入明細更新_PROC '" + denNo + "' ,'" + rowNo + "' ,'" + status + "' ,'" + userName + "'"; } else { strProc = "検収済仕入明細更新_PROC '" + denNo + "' ,'" + rowNo + "' ," + "NULL ,'" + userName + "'"; } // ストアド実行 dbconnective.ReadSql(strProc); dbconnective.Commit(); } catch (Exception ex) { // ロールバック処理 dbconnective.Rollback(); throw; } finally { dbconnective.DB_Disconnect(); } } }
/// <summary> /// setKakouGenka /// データをグリッドビューに追加 /// </summary> private void setKakouGenka() { string strJuchu = this.strJuchuNo; // ビジネス層のインスタンス生成 KakouGenkaList_B kakouB = new KakouGenkaList_B(); try { //受注番号が0の場合[-99999]とする if (this.strJuchuNo == "0" || StringUtl.blIsEmpty(this.strJuchuNo) == false) { strJuchu = "-99999"; } // 検索実行 DataTable dtKakouGenkaList = kakouB.getDatagridView(strJuchu); // データテーブルからデータグリッドへセット gridJuchu.DataSource = dtKakouGenkaList; if (dtKakouGenkaList != null && dtKakouGenkaList.Rows.Count > 0) { for (int cnt = 0; cnt < gridJuchu.RowCount; cnt++) { string strKubun = gridJuchu.Rows[cnt].Cells["区分"].Value.ToString(); // 区分が出庫、加工出庫、入庫(原在)、入庫(原)の場合はフォントカラーを変更 if (strKubun.Equals("出庫") || strKubun.Equals("加工出庫") || strKubun.Equals("入庫(原在)") || strKubun.Equals("入庫(原)")) { gridJuchu.Rows[cnt].DefaultCellStyle.ForeColor = Color.Green; } // 区分が発注の場合はフォントカラーを変更 if (strKubun.Equals("発注")) { gridJuchu.Rows[cnt].DefaultCellStyle.ForeColor = Color.Blue; } } Control cNow = this.ActiveControl; cNow.Focus(); } } catch (Exception ex) { // エラーロギング new CommonException(ex); return; } return; }
///<summary> ///lblSetDaibunrui_Leave ///大分類コードのラベルセットから離れた場合 ///</summary> private void lblSetDaibunrui_Leave(object sender, EventArgs e) { //メッセージが表示された場合 if (lblSetDaibunrui.blMessageOn == false) { return; } //大分類の名前が白紙の場合 if (lblSetDaibunrui.ValueLabelText == "" || StringUtl.blIsEmpty(lblSetDaibunrui.ValueLabelText) == false) { gridMaker.DataSource = null; } }
///<summary> ///labelSet_GroupCd_Leave ///グループコードのラベルセットから離れた場合 ///</summary> private void labelSet_GroupCd_Leave(object sender, EventArgs e) { //グループコードがない場合 if (lblSetGroupCd.CodeTxtText == "" || StringUtl.blIsEmpty(lblSetGroupCd.CodeTxtText) == false) { return; } //コードの名前が白紙の場合 if (lblSetGroupCd.ValueLabelText == "" || StringUtl.blIsEmpty(lblSetGroupCd.ValueLabelText) == false) { lblSetGroupCd.Focus(); } }
///<summary> ///labelSet_Eigyousho_Leave ///営業所のラベルセットから離れた場合 ///</summary> private void labelSet_Eigyousho_Leave(object sender, EventArgs e) { //営業所コードがない場合 if (lblSetEigyousho.CodeTxtText == "" || StringUtl.blIsEmpty(lblSetEigyousho.CodeTxtText) == false) { return; } //営業所コードの名前が白紙の場合 if (lblSetEigyousho.ValueLabelText == "" || StringUtl.blIsEmpty(lblSetEigyousho.ValueLabelText) == false) { lblSetEigyousho.Focus(); } }
///<summary> ///lblSetDaibun_Leave ///大分類のラベルセットから離れた場合 ///</summary> private void lblSetDaibun_Leave(object sender, EventArgs e) { //大分類コードがない場合 if (lblSetDaibun.CodeTxtText == "" || StringUtl.blIsEmpty(lblSetDaibun.CodeTxtText) == false) { return; } //大分類の名前が白紙の場合 if (lblSetDaibun.ValueLabelText == "" || StringUtl.blIsEmpty(lblSetDaibun.ValueLabelText) == false) { lblSetDaibun.Focus(); } }
///<summary> /// テキストの文字チェック ///</summary> private Boolean chkText(string target) { //文字チェック用 Boolean bln = false; //禁止文字チェック bln = StringUtl.JudBanChr(target); if (bln == true) { //数字のみを許可する bln = StringUtl.JudBanSelect(target, CommonTeisu.NUMBER_ONLY); } return bln; }
///<summary> /// 棚番コードチェック ///</summary> private bool chkTanaCd() { // 禁止文字チェック if (StringUtl.JudBanSQL(txtTanabanCd.Text) == false) { // メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtTanabanCd.Text = ""; txtTanabanCd.Focus(); return(true); } return(false); }
///<summary> ///labelSet_Tokuisaki_Leave ///得意先コードのラベルセットから離れた場合 ///</summary> private void labelSet_Tokuisaki_Leave(object sender, EventArgs e) { //得意先コードがない場合 if (lblset_Shiresaki.CodeTxtText == "" || StringUtl.blIsEmpty(lblset_Shiresaki.CodeTxtText) == false) { return; } //得意先の名前が白紙の場合 if (lblset_Shiresaki.ValueLabelText == "" || StringUtl.blIsEmpty(lblset_Shiresaki.ValueLabelText) == false) { gridTokui.DataSource = null; lblset_Shiresaki.Focus(); } }
///<summary> ///labelSet_Torihikisaki_Leave ///取引先コードのラベルセットから離れた場合 ///</summary> private void labelSet_Torihikisaki_Leave(object sender, EventArgs e) { //得意先コードがない場合 if (labelSet_Torihikisaki.CodeTxtText == "" || StringUtl.blIsEmpty(labelSet_Torihikisaki.CodeTxtText) == false) { return; } //得意先の名前が白紙の場合 if (labelSet_Torihikisaki.ValueLabelText == "" || StringUtl.blIsEmpty(labelSet_Torihikisaki.ValueLabelText) == false) { gridShire.DataSource = null; labelSet_Torihikisaki.Focus(); //担当者コードのラベルセットの背景色のチェック、背景白化 labelSet_Tantousha.codeTxt.BaseText_Leave_Check(); } }
///<summary> ///labelSet_Daibunrui_Leave ///大分類コードのラベルセットから離れた場合 ///</summary> private void labelSet_Daibunrui_Leave(object sender, EventArgs e) { //メッセージが表示された場合 if (lblSetDaibunrui.blMessageOn == false) { return; } //大分類コードがない場合 if (lblSetDaibunrui.CodeTxtText == "" || StringUtl.blIsEmpty(lblSetDaibunrui.CodeTxtText) == false) { return; } //大分類の名前がない場合 if (lblSetDaibunrui.ValueLabelText == "" || StringUtl.blIsEmpty(lblSetDaibunrui.ValueLabelText) == false) { gridSeihin.DataSource = null; } }
///<summary> ///chkToriikisaki ///code入力箇所からフォーカスがついた時 ///</summary> private bool chkToriikisaki() { if (txtCdT.Text == "" || String.IsNullOrWhiteSpace(txtCdT.Text).Equals(true)) { return false; } // 前後の空白を取り除く txtCdT.Text = txtCdT.Text.Trim(); // 禁止文字チェック if (StringUtl.JudBanSQL(txtCdT.Text) == false) { // メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(Parent, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); return true; } // 全角数字を半角数字に変換 txtCdT.Text = StringUtl.JudZenToHanNum(txtCdT.Text); // 数値チェック if (StringUtl.JudBanSelect(txtCdT.Text, CommonTeisu.NUMBER_ONLY) == true) { // 4文字以下の場合0パティング if (txtCdT.Text.Length < 4) { txtCdT.Text = txtCdT.Text.ToString().PadLeft(4, '0'); } } return false; }
// //別の場所にフォーカス移動された時 // public Boolean updCalendarLeave(string updCalendarLeave) { //日付チェック用 DateTime dateCheck = new DateTime(); bool modDay = true; strY = DateTime.Today.Year.ToString(); strM = "01"; Boolean blnDateCheck = false; //テキストデータの格納 string strDate = ""; //格納(エラー時に元に戻す用) string strDataPi = ""; //文字チェック,チェック用のLISTを作成 List <string> checklist = new List <string>(); //データを入れる配列 string[] strInData; //背景色を白にする this.BackColor = Color.White; //フォーカスが外れたのでリセット blnFirstClick = true; //何も書かれていない場合戻る if (updCalendarLeave == "") { blnDateCheck = true; return(blnDateCheck); } // //コピーペーストされた時のための数値チェック // if (!DateTime.TryParse(this.Text, out dateCheck)) // { // if (this.Parent is BaseForm) // { // //データ存在なしメッセージ(OK) // BaseMessageBox basemessagebox_Nodata = new BaseMessageBox(this.Parent, "", "数値を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); // basemessagebox_Nodata.ShowDialog(); // } // else if (this.Parent.Parent is BaseForm) // { // //データ存在なしメッセージ(OK) // BaseMessageBox basemessagebox_Nodata = new BaseMessageBox(this.Parent.Parent, "", "数値を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); // basemessagebox_Nodata.ShowDialog(); // } // blnDateCheck = true; ////ラベルセットのカーソル色が残るのを防ぐ ////しかしShift + Tabで移動した場合は二重になるため対応策が必要(加藤Prj_問題点課題管理表 No29) // SendKeys.Send("+{TAB}"); // return (blnDateCheck); // } //リストに追加 checklist.Add(this.Text); //テキストボックス内のチェック foreach (string Listvalue in checklist) { //「,]があった場合一度取り除く if (this.Text.Contains('.')) { strDataPi = this.Text; this.Text = this.Text.Replace(".", "/"); } } strInData = this.Text.Split('/'); if (strInData.Count() == 2) { strY = strInData[0]; modDay = false; //20~と付けるか否か if (strY.Length == 3) { strY = 2 + strY; } else if (strY.Length == 2) { int intY = int.Parse(strY); if (intY < 50) { strY = 20 + strY; } else { strY = 19 + strY; } } else if (strY.Length == 1) { strY = 200 + strY; } strM = strInData[1]; if (strM.Length == 1) { strM = strM.PadLeft(2, '0'); } } else if (strInData.Count() == 1) { if (strInData[0].Length > 4) { // 年部分取得 strY = strInData[0].Substring(0, strInData[0].Length - 2); modDay = false; //20~と付けるか否か if (strY.Length == 3) { strY = 2 + strY; } else if (strY.Length == 2) { int intY = int.Parse(strY); if (intY < 50) { strY = 20 + strY; } else { strY = 19 + strY; } } else if (strY.Length == 1) { strY = 200 + strY; } //月部のみを取り出す strM = strInData[0].Substring(strInData[0].Length - 2, 2); } else if (strInData[0].Length > 2) { //月部のみを取り出す strM = strInData[0].Substring(0, strInData[0].Length - 2); } else { //月部のみを取り出す strM = strInData[0].ToString(); if (strM.Length == 1) { strM = strM.PadLeft(2, '0'); } } } strDate = strY + "/" + strM; blnDateCheck = StringUtl.JudCalenderCheck(strDate); if (blnDateCheck == true) { this.Text = strDate; } else { if (strDataPi != "") { this.Text = strDataPi; } } if (modDay && !string.IsNullOrWhiteSpace(this.Text)) { this.Text = chkModDay(this.Text); } return(blnDateCheck); }
///<summary> ///blnDataCheckAdd ///DB追加前のチェック工程 ///</summary> private bool blnAddDataCheck() { bool good = true; if (good) { good = txtYMD.blIsEmpty(); if (good == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtYMD.Focus(); } } if (good) { good = StringUtl.blIsEmpty(labelSet_Eigyousho.CodeTxtText); if (good == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); labelSet_Eigyousho.Focus(); } } if (good) { good = StringUtl.blIsEmpty(labelSet_Daibunrui_Edit.CodeTxtText); if (good == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); labelSet_Daibunrui_Edit.Focus(); } } if (good) { good = StringUtl.blIsEmpty(labelSet_Chubunrui_Edit.CodeTxtText); if (good == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); labelSet_Chubunrui_Edit.Focus(); } } if (good) { good = StringUtl.blIsEmpty(labelSet_Maker_Edit.CodeTxtText); if (good == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); labelSet_Maker_Edit.Focus(); } } if (good) { good = txtTanasuu.blIsEmpty(); if (good == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtTanasuu.Focus(); } } if (good) { good = StringUtl.blIsEmpty(labelSet_Tanaban_Edit.CodeTxtText); if (good == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); labelSet_Tanaban_Edit.Focus(); } } if (good) { good = txtShouhinCD.blIsEmpty(); if (good == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtKensaku.Focus(); } } if (good) { if (btnF01.Enabled == false) { good = false; } } //エラーになってない場合 if (good == true) { //営業所チェック if (labelSet_Eigyousho.chkTxtEigyousho()) { good = false; } } //エラーになってない場合 if (good == true) { //大分類チェック if (labelSet_Daibunrui.chkTxtDaibunrui()) { good = false; } } //エラーになってない場合 if (good == true) { //中分類チェック if (labelSet_Chubunrui.chkTxtChubunrui(labelSet_Daibunrui.CodeTxtText)) { good = false; } } //エラーになってない場合 if (good == true) { //メーカーチェック if (labelSet_Maker.chkTxtMaker()) { good = false; } } //エラーになってない場合 if (good == true) { //棚番チェック if (labelSet_Tanaban.chkTxtTanaban()) { good = false; } } //エラーになってない場合 if (good == true) { //データがある場合 if (labelSet_Chubunrui_Edit.codeTxt.blIsEmpty()) { //下段中分類チェック if (labelSet_Chubunrui_Edit.chkTxtChubunrui(labelSet_Daibunrui_Edit.CodeTxtText)) { good = false; } } } //エラーになってない場合 if (good == true) { //データがある場合 if (labelSet_Maker_Edit.codeTxt.blIsEmpty()) { //下段メーカーチェック if (labelSet_Maker_Edit.chkTxtMaker()) { good = false; } } } //エラーになってない場合 if (good == true) { //データがある場合 if (txtTanasuu.blIsEmpty()) { //数値チェック if (txtTanasuu.chkMoneyText()) { good = false; } } } //エラーになってない場合 if (good == true) { //データがある場合 if (labelSet_Tanaban_Edit.codeTxt.blIsEmpty()) { //棚卸数 if (labelSet_Tanaban_Edit.chkTxtTanaban()) { good = false; } } } return(good); }
///<summary> ///printHusho ///印刷ダイアログ ///</summary> private void printHusho() { //敬称 string strKeisho = ""; //SQL実行先のフラグ管理 int intFlag = 0; //印刷情報取得用 List <string> lstAtenaInsatsu = new List <string>(); //SQL実行時に取り出したデータを入れる用 DataTable dtSetCd_B = new DataTable(); //PDF作成後の入れ物 string strFile = ""; //取引先入力項目に記入がある場合 if (StringUtl.blIsEmpty(labelSet_Torihikisaki.codeTxt.ToString())) { //様にチェックされている場合 if (radSet_2btn_Kesho.radbtn0.Checked == true) { strKeisho = " 様"; } else if (radSet_2btn_Kesho.radbtn1.Checked == true) { strKeisho = " 御中"; } //住所①を使用にチェックされている場合 if (radAtena1.Checked == true) { intFlag = 0; } //住所②を使用にチェックされている場合 else if (radAtena2.Checked == true) { intFlag = 1; } //領収書送付先を使用にチェックされている場合 else if (radAtena3.Checked == true) { intFlag = 2; } //請求書送付先を使用にチェックされている場合 else if (radAtena4.Checked == true) { intFlag = 3; } //ビジネス層のインスタンス生成 M0620_HushoAtenaInsatsu_B hushoatenainsatsuB = new M0620_HushoAtenaInsatsu_B(); try { lstAtenaInsatsu.Add(labelSet_Torihikisaki.CodeTxtText); lstAtenaInsatsu.Add(intFlag.ToString()); lstAtenaInsatsu.Add(strKeisho); dtSetCd_B = hushoatenainsatsuB.getAtenaInsatsuData(lstAtenaInsatsu); //取得したデータがない場合 if (dtSetCd_B.Rows.Count == 0 || dtSetCd_B == null) { //例外発生メッセージ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_ERROR, "対象のデータはありません", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); return; } //初期値 Common.Form.PrintForm pf = new Common.Form.PrintForm(this, "", CommonTeisu.SIZE_NAGA4, TATE); //長4の場合 if (radSet_2btn_Yoshi.radbtn0.Checked == true || radSet_2btn_Yoshi.judCheckBtn() == 0) { blNaga4 = true; //印刷ダイアログ pf = new Common.Form.PrintForm(this, "", CommonTeisu.SIZE_NAGA4, false); pf.ShowDialog(this); } else if (radSet_2btn_Yoshi.radbtn1.Checked == true || radSet_2btn_Yoshi.judCheckBtn() == 1) { blNaga4 = false; //印刷ダイアログ pf = new Common.Form.PrintForm(this, "", CommonTeisu.SIZE_NAGA3, false); pf.ShowDialog(this); } //プレビューの場合 if (this.printFlg == CommonTeisu.ACTION_PREVIEW) { //結果セットをレコードセットに strFile = hushoatenainsatsuB.dbToPdf(dtSetCd_B, blNaga4); // プレビュー pf.execPreview(strFile); } // 一括印刷の場合 else if (this.printFlg == CommonTeisu.ACTION_PRINT) { // PDF作成 strFile = hushoatenainsatsuB.dbToPdf(dtSetCd_B, blNaga4); if (blNaga4 == true) { // 一括印刷 pf.execPrint(null, strFile, CommonTeisu.SIZE_NAGA4, CommonTeisu.YOKO, false); } else { // 一括印刷 pf.execPrint(null, strFile, CommonTeisu.SIZE_NAGA3, CommonTeisu.YOKO, false); } } } 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> ///AtenaView ///取引先コード入力項目から離れた時 ///</summary> public void AtenaView(object sender, EventArgs e) { //検索時のデータ取り出し先 DataTable dtSetData; //取引先入力項目が空の場合 if (!StringUtl.blIsEmpty(labelSet_Torihikisaki.CodeTxtText)) { return; } //ビジネス層のインスタンス生成 M0620_HushoAtenaInsatsu_B hushoatenainsatsu = new M0620_HushoAtenaInsatsu_B(); try { dtSetData = hushoatenainsatsu.getEigyoshoTextLeave(labelSet_Torihikisaki.CodeTxtText); //住所1を使用する場合 if (radAtena1.Checked == true) { lblGrayMeisho.Text = dtSetData.Rows[0]["取引先名称"].ToString(); lblGrayYubin.Text = dtSetData.Rows[0]["郵便番号"].ToString(); lblGrayJusho1.Text = dtSetData.Rows[0]["住所1"].ToString(); lblGrayJusho2.Text = dtSetData.Rows[0]["住所2"].ToString(); } else if (radAtena2.Checked == true) { lblGrayMeisho.Text = dtSetData.Rows[0]["取引先名称"].ToString(); lblGrayYubin.Text = dtSetData.Rows[0]["A郵便番号"].ToString(); lblGrayJusho1.Text = dtSetData.Rows[0]["A住所1"].ToString(); lblGrayJusho2.Text = dtSetData.Rows[0]["A住所2"].ToString(); } else if (radAtena3.Checked == true) { lblGrayMeisho.Text = dtSetData.Rows[0]["領収書送付先名"].ToString(); lblGrayYubin.Text = dtSetData.Rows[0]["領収書送付郵便番号"].ToString(); lblGrayJusho1.Text = dtSetData.Rows[0]["領収書送付住所1"].ToString(); lblGrayJusho2.Text = dtSetData.Rows[0]["領収書送付住所2"].ToString(); } else if (radAtena4.Checked == true) { lblGrayMeisho.Text = dtSetData.Rows[0]["請求書送付先名"].ToString(); lblGrayYubin.Text = dtSetData.Rows[0]["請求書送付郵便番号"].ToString(); lblGrayJusho1.Text = dtSetData.Rows[0]["請求書送付住所1"].ToString(); lblGrayJusho2.Text = dtSetData.Rows[0]["請求書送付住所2"].ToString(); } else { lblGrayMeisho.Text = dtSetData.Rows[0]["取引先名称"].ToString(); lblGrayYubin.Text = dtSetData.Rows[0]["郵便番号"].ToString(); lblGrayJusho1.Text = dtSetData.Rows[0]["住所1"].ToString(); lblGrayJusho2.Text = dtSetData.Rows[0]["住所2"].ToString(); } //長4を選択 if (radSet_2btn_Yoshi.radbtn0.Checked == true) { blNaga4 = true; } //長3を選択 else if (radSet_2btn_Yoshi.radbtn1.Checked == true) { blNaga4 = false; } } 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> ///setTxtMakerLeave ///code入力箇所からフォーカスが外れた時の処理 ///</summary> public void setTxtMakerLeave() { //データ渡し用 List <string> lstStringSQL = new List <string>(); DataTable dtSetCd; if (this.CodeTxtText == "" || String.IsNullOrWhiteSpace(this.CodeTxtText).Equals(true)) { this.ValueLabelText = ""; this.AppendLabelText = ""; return; } //前後の空白を取り除く this.CodeTxtText = this.CodeTxtText.Trim(); //禁止文字チェック if (StringUtl.JudBanSQL(this.CodeTxtText) == false) { //グループボックスかパネル内にいる場合 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) { if (this.CodeTxtText.Length <= 3) { this.CodeTxtText = this.CodeTxtText.ToString().PadLeft(4, '0'); } } //データ渡し用 lstStringSQL.Add("Common"); lstStringSQL.Add("C_LIST_Maker_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; } 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; } } }
///<summary> ///setData ///code入力箇所からフォーカスが外れた時の処理 ///</summary> private void setData() { //データ渡し用 List <string> lstStringSQL = new List <string>(); DataTable dtSetCd; Boolean blnGood; //空白、文字数4以上の場合 if (this.CodeTxtText == "" || String.IsNullOrWhiteSpace(this.CodeTxtText).Equals(true) || this.CodeTxtText.Length > 3) { this.ValueLabelText = ""; this.AppendLabelText = ""; return; } //前後の空白を取り除く this.CodeTxtText = this.CodeTxtText.Trim(); //禁止文字チェック if (StringUtl.JudBanSQL(this.CodeTxtText) == false || StringUtl.JudBanSelect(this.CodeTxtText, CommonTeisu.NUMBER_ONLY) == false) { 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(); } else { //メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(Parent, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); } //エラーメッセージを表示された blMessageOn = true; CodeTxtText = "0"; return; } //データ渡し用 lstStringSQL.Add("Common"); lstStringSQL.Add("C_LIST_Menu_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) { //PG番号が0の場合 if (dtSetCd.Rows[0]["PG番号"].ToString() == "0") { this.CodeTxtText = "0"; this.ValueLabelText = ""; } else { this.CodeTxtText = dtSetCd.Rows[0]["PG番号"].ToString(); this.ValueLabelText = dtSetCd.Rows[0]["PG名"].ToString(); } blMessageOn = false; } else { //初期化 this.CodeTxtText = "0"; this.ValueLabelText = "0"; //グループボックスかパネル内にいる場合 if (this.Parent is TabPage) { //メッセージボックスの処理、項目のデータがない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent.Parent.Parent, "入力", "指定されたPgNo.は登録されていません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_EXCLAMATION); basemessagebox.ShowDialog(); } else if (this.Parent is GroupBox || this.Parent is Panel) { //メッセージボックスの処理、項目のデータがない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent.Parent, "入力", "指定されたPgNo.は登録されていません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_EXCLAMATION); basemessagebox.ShowDialog(); } else { //メッセージボックスの処理、項目のデータがない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent, "入力", "指定されたPgNo.は登録されていません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_EXCLAMATION); basemessagebox.ShowDialog(); } //エラーメッセージを表示された blMessageOn = true; } return; } catch (Exception ex) { //データロギング new CommonException(ex); //グループボックスかパネル内にいる場合 if (this.Parent is GroupBox || this.Parent is Panel || this.Parent is TabPage) { //例外発生メッセージ(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; } } }
///<summary> /// chkTxtShiresaki /// ファンクション機能の仕入先コードエラーチェック処理 /// 引数 :なし /// 戻り値:エラー発生【true】 ///</summary> public bool chkTxtShiresaki() { // データ渡し用 List <string> lstStringSQL = new List <string>(); DataTable dtSetCd; Boolean blnGood; if (this.CodeTxtText == "" || String.IsNullOrWhiteSpace(this.CodeTxtText).Equals(true)) { this.ValueLabelText = ""; this.AppendLabelText = ""; return(false); } // 前後の空白を取り除く this.CodeTxtText = this.CodeTxtText.Trim(); // 禁止文字チェック if (StringUtl.JudBanSQL(this.CodeTxtText) == false) { // メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(Parent, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); this.ValueLabelText = ""; this.AppendLabelText = ""; this.CodeTxtText = ""; return(true); } // 全角数字を半角数字に変換 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_ShiresakiAS400_SELECT_LEAVE"); OpenSQL opensql = new OpenSQL(); try { string strSQLInput = opensql.setOpenSQL(lstStringSQL); if (strSQLInput == "") { return(false); } 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(); } else { // メッセージボックスの処理、項目のデータがない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent, CommonTeisu.TEXT_VIEW, CommonTeisu.LABEL_NOTDATA, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); this.ValueLabelText = ""; this.AppendLabelText = ""; this.CodeTxtText = ""; return(true); } return(false); } catch (Exception ex) { // データロギング new CommonException(ex); // 例外発生メッセージ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent, CommonTeisu.TEXT_ERROR, CommonTeisu.LABEL_ERROR_MESSAGE, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); return(true); } }
///<summary> ///getDataKaburi ///商品テーブルから同じ品名・型番のデータを取得 ///</summary> public DataTable getDataKaburi(List <string> lstString) { //SQL実行時に取り出したデータを入れる用 DataTable dtKataban = new DataTable(); //SQLファイルのパスとファイル名を入れる用 List <string> lstSQLShohin = new List <string>(); //SQLファイルのパス用(フォーマット後) string strSQLInput = ""; string strSQLOther = ""; strSQLOther = strSQLOther + "AND C1 = '" + lstString[4] + "'"; //C2がある場合 if (StringUtl.blIsEmpty(lstString[5].ToString())) { strSQLOther = strSQLOther + "AND C2 = '" + lstString[5] + "'"; } //C3がある場合 if (StringUtl.blIsEmpty(lstString[6].ToString())) { strSQLOther = strSQLOther + "AND C3 = '" + lstString[6] + "'"; } //C4がある場合 if (StringUtl.blIsEmpty(lstString[7].ToString())) { strSQLOther = strSQLOther + "AND C4 = '" + lstString[7] + "'"; } //C5がある場合 if (StringUtl.blIsEmpty(lstString[8].ToString())) { strSQLOther = strSQLOther + "AND C5 = '" + lstString[8] + "'"; } //C6がある場合 if (StringUtl.blIsEmpty(lstString[9].ToString())) { strSQLOther = strSQLOther + "AND C6 = '" + lstString[9] + "'"; } //メーカーコードがある場合 if (StringUtl.blIsEmpty(lstString[1].ToString())) { strSQLOther = strSQLOther + "AND メーカーコード = '" + lstString[1] + "'"; } //SQLファイルのパスとファイル名を追加 lstSQLShohin.Add("M1030_Shohin"); lstSQLShohin.Add("Shohin_Data_Kaburi_SELECT"); //SQL発行 OpenSQL opensql = new OpenSQL(); //接続用クラスのインスタンス作成 DBConnective dbconnective = new DBConnective(); try { //SQLファイルのパス取得(商品テーブル) strSQLInput = opensql.setOpenSQL(lstSQLShohin); //パスがなければ返す if (strSQLInput == "") { return(dtKataban); } //SQLファイルと該当コードでフォーマット strSQLInput = string.Format(strSQLInput, strSQLOther ); //データ取得(ここから取得) dtKataban = dbconnective.ReadSql(strSQLInput); return(dtKataban); } catch (Exception ex) { //ロールバック開始 dbconnective.Rollback(); throw (ex); } finally { //トランザクション終了 dbconnective.DB_Disconnect(); } }
///<summary> ///updTxtTokuisakiLeave ///code入力箇所からフォーカスが外れた時 ///</summary> public void updTxtTokuisakiLeave(object sender, EventArgs e) { //データ渡し用 List <string> lstStringSQL = new List <string>(); DataTable dtSetCd; string strSQLName = null; Boolean blnGood; if (this.CodeTxtText == "" || String.IsNullOrWhiteSpace(this.CodeTxtText).Equals(true)) { this.valueTextText = ""; this.AppendLabelText = ""; return; } //禁止文字チェック blnGood = StringUtl.JudBanChr(this.CodeTxtText); //数字のみを許可する blnGood = StringUtl.JudBanSelect(this.CodeTxtText, CommonTeisu.NUMBER_ONLY); if (blnGood == false) { this.valueTextText = ""; //グループボックスかパネル内にいる場合 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}"); return; } else { //メッセージボックスの処理、項目が該当する禁止文字を含む場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(Parent, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); SendKeys.Send("+{TAB}"); return; } } //前後の空白を取り除く this.CodeTxtText = this.CodeTxtText.Trim(); if (this.CodeTxtText.Length < 4) { this.CodeTxtText = this.CodeTxtText.ToString().PadLeft(4, '0'); } // 存在チェックを行い if (SearchOn == false) { return; } strSQLName = "C_LIST_Torihikisaki_SELECT_LEAVE"; //データ渡し用 lstStringSQL.Add("Common"); lstStringSQL.Add(strSQLName); OpenSQL opensql = new OpenSQL(); try { string strSQLInput = opensql.setOpenSQL(lstStringSQL); if (strSQLInput == "") { return; } //配列設定 string[] aryStr = { this.CodeTxtText }; strSQLInput = string.Format(strSQLInput, aryStr); //SQLのインスタンス作成 DBConnective dbconnective = new DBConnective(); //SQL文を直書き(+戻り値を受け取る) dtSetCd = dbconnective.ReadSql(strSQLInput); if (dtSetCd.Rows.Count != 0) { string strZeikubun = ""; if (dtSetCd.Rows[0]["消費税計算区分"].ToString() == "0" || dtSetCd.Rows[0]["消費税計算区分"].ToString() == "2") { strZeikubun = "外税"; } else if (dtSetCd.Rows[0]["消費税計算区分"].ToString() == "1") { strZeikubun = "内税"; } this.CodeTxtText = dtSetCd.Rows[0]["取引先コード"].ToString(); this.valueTextText = dtSetCd.Rows[0]["取引先名称"].ToString(); this.AppendLabelText = strZeikubun; } else { this.valueTextText = ""; //グループボックスかパネル内にいる場合 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(); return; } else { //メッセージボックスの処理、項目のデータがない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this.Parent, CommonTeisu.TEXT_VIEW, CommonTeisu.LABEL_NOTDATA, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); return; } } 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; } } }
///<summary> /// chkDateYMDataFormat /// テキストボックス内の日付フォーマットをチェック及び再生成 /// 引数:日付フォーマット再生成済み日付文字列 エラーの場合、空を返す。 ///</summary> public string chkDateYMDataFormat(string strDateData) { bool modDay = true; strY = DateTime.Today.Year.ToString(); strM = "01"; Boolean blnDateCheck = false; //テキストデータの格納 string strDate = ""; //格納(エラー時に元に戻す用) string strDataPi = ""; //文字チェック,チェック用のLISTを作成 List <string> checklist = new List <string>(); //データを入れる配列 string[] strInData; //リストに追加 checklist.Add(strDateData); //テキストボックス内のチェック foreach (string Listvalue in checklist) { //「,]があった場合一度取り除く if (strDateData.Contains('.')) { strDataPi = strDateData; strDateData = strDateData.Replace(".", "/"); } } strInData = strDateData.Split('/'); if (strInData.Count() == 2) { strY = strInData[0]; modDay = false; //20~と付けるか否か if (strY.Length == 3) { strY = 2 + strY; } else if (strY.Length == 2) { int intY = int.Parse(strY); if (intY < 50) { strY = 20 + strY; } else { strY = 19 + strY; } } else if (strY.Length == 1) { strY = 200 + strY; } strM = strInData[1]; if (strM.Length == 1) { strM = strM.PadLeft(2, '0'); } } else if (strInData.Count() == 1) { if (strInData[0].Length > 4) { //月部のみを取り出す strY = strInData[0].Substring(0, strInData[0].Length - 2); modDay = false; //20~と付けるか否か if (strY.Length == 3) { strY = 2 + strY; } else if (strY.Length == 2) { int intY = int.Parse(strY); if (intY < 50) { strY = 20 + strY; } else { strY = 19 + strY; } } else if (strY.Length == 1) { strY = 200 + strY; } //月部のみを取り出す strM = strInData[0].Substring(strInData[0].Length - 2, 2); } else if (strInData[0].Length > 2) { //月部のみを取り出す strM = strInData[0].Substring(0, strInData[0].Length - 2); } else { //月部のみを取り出す strM = strInData[0].ToString(); if (strM.Length == 1) { strM = strM.PadLeft(2, '0'); } } } strDate = strY + "/" + strM; blnDateCheck = StringUtl.JudCalenderCheck(strDate); if (blnDateCheck == true) { strDateData = strDate; } else { if (strDataPi != "") { strDateData = strDataPi; } else { strDateData = ""; } } if (modDay && !string.IsNullOrWhiteSpace(strDateData)) { strDateData = chkModDay(strDateData); } return(strDateData); }
///<summary> ///setHachusuhenko ///該当データの表示 ///</summary> private void setHachusuhenko() { //年月日の日付フォーマット後を入れる用 string strYMDformat = ""; //受注者コードと仕入先コードがない場合 if (StringUtl.blIsEmpty(labelSet_Tantousha.CodeTxtText) == false && StringUtl.blIsEmpty(labelSet_Torihikisaki.CodeTxtText) == false) { //メッセージボックスの処理、受注者コードと仕入先コードが空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "発注者か仕入先を指定してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); labelSet_Tantousha.Focus(); return; } //発注者チェック if (labelSet_Tantousha.chkTxtTantosha()) { labelSet_Tantousha.Focus(); return; } //仕入先チェック if (labelSet_Torihikisaki.chkTxtTorihikisaki()) { labelSet_Torihikisaki.Focus(); return; } //検索開始年月日に記入がある場合 if (baseCalendarOpen.blIsEmpty()) { //日付フォーマット生成、およびチェック strYMDformat = baseCalendarOpen.chkDateDataFormat(baseCalendarOpen.Text); //検索開始年月日の日付チェック if (strYMDformat == "") { // メッセージボックスの処理、項目が日付でない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "入力された日付が正しくありません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); baseCalendarOpen.Focus(); return; } else { baseCalendarOpen.Text = strYMDformat; } } //検索終了年月日に記入がある場合 if (baseCalendarClose.blIsEmpty()) { //初期化 strYMDformat = ""; //日付フォーマット生成、およびチェック strYMDformat = baseCalendarClose.chkDateDataFormat(baseCalendarClose.Text); //検索終了年月日の日付チェック if (strYMDformat == "") { // メッセージボックスの処理、項目が日付でない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "入力された日付が正しくありません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); baseCalendarClose.Focus(); return; } else { baseCalendarClose.Text = strYMDformat; } } //発注数の数値チェック if (txtHachusu.chkMoneyText()) { // メッセージボックスの処理、項目が日付でない場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "入力された数値が正しくありません。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtHachusu.Focus(); return; } //グリッド表示のデータ渡し用 List <string> lstStrSQL = new List <string>(); //ビジネス層のインスタンス生成 A0470_Hachusuhenko_B hachusuhenkoB = new A0470_Hachusuhenko_B(); try { //発注者コード lstStrSQL.Add(labelSet_Tantousha.CodeTxtText); //仕入先コード lstStrSQL.Add(labelSet_Torihikisaki.CodeTxtText); //検索納期範囲(開始) lstStrSQL.Add(baseCalendarOpen.Text); //検索納期範囲(終了) lstStrSQL.Add(baseCalendarClose.Text); //場所ボタンセットの「すべて」にチェックがある場合 if (radSet_3btn_Basho.radbtn0.Checked) { lstStrSQL.Add("0"); } //本社 else if (radSet_3btn_Basho.radbtn1.Checked) { lstStrSQL.Add("1"); } //岐阜 else { lstStrSQL.Add("2"); } //発注残ボタンセットの「発注残をすべて」にチェックがある場合 if (radHachuZan0.Checked == true) { lstStrSQL.Add("0"); } //発注残で仕入済数あり else { lstStrSQL.Add("1"); } //品名・型番 lstStrSQL.Add(txtHinmei_Kataban.Text); //注番 lstStrSQL.Add(txtChuban.Text); gridHachusuhenko.DataSource = hachusuhenkoB.setHachusuhenkoGrid(lstStrSQL); int intCnt; int intKin = 0; for (intCnt = 0; intCnt < gridHachusuhenko.RowCount; intCnt++) { intKin = intKin + Convert.ToInt32(gridHachusuhenko.Rows[intCnt].Cells[8].Value); if (Convert.ToInt32(gridHachusuhenko.Rows[intCnt].Cells[6].Value) < 0) { gridHachusuhenko.Rows[intCnt].DefaultCellStyle.ForeColor = Color.Red; } } txtHachukin.Text = string.Format("{0:#,#}", intKin); //グリッドビューに一行以上ある場合 if (gridHachusuhenko.RowCount > 0) { gridHachusuhenko.Focus(); } else { labelSet_Torihikisaki.Focus(); } } 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> ///addTantousha ///テキストボックス内のデータをDBに登録 ///</summary> private void addTantousha() { //記入情報登録用 List <string> lstTantousha = new List <string>(); //空文字判定(担当者コード) if (txtTantoushaCd.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtTantoushaCd.Focus(); return; } //空文字判定(担当者名) if (txtTantoushaName.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtTantoushaName.Focus(); return; } //空文字判定(ログインID) if (txtLoginID.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtLoginID.Focus(); return; } //空文字判定(営業所コード) if (StringUtl.blIsEmpty(lblSetEigyousho.CodeTxtText) == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); lblSetEigyousho.Focus(); return; } // 存在チェック(営業所チェック) if (lblSetEigyousho.chkTxtEigyousho()) { return; } //空文字判定(注番) if (txtChuban.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtChuban.Focus(); return; } //空文字判定(グループコード) if (StringUtl.blIsEmpty(lblSetGroupCd.CodeTxtText) == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); lblSetGroupCd.Focus(); return; } // 存在チェック(グループチェック) if (lblSetGroupCd.chkTxtGroupCd()) { return; } //空文字判定(目標金額) if (txtMokuhyou.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "項目が空です。数値を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtMokuhyou.Focus(); return; } //空文字判定(役職コード) if (txtYakushokuCd.blIsEmpty() == false || StringUtl.blIsEmpty(lblGrayYakushokuCdName.Text) == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtYakushokuCd.Focus(); return; } // 存在チェック(役職コード) if (txtYakushokuCd_Leave_Set()) { return; } //空文字判定(表示設定) if (txtHyoji.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtHyoji.Focus(); return; } //入力文字判定(表示設定) if (txtHyoji.Text != "0" && txtHyoji.Text != "1") { //メッセージボックスの処理、項目が該当数値以外の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "表示設定は、0か1を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtHyoji.Focus(); return; } //空文字判定(マスタ権限) if (txtMasterKengen.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtMasterKengen.Focus(); return; } //入力文字判定(マスタ権限) if (txtMasterKengen.Text != "0" && txtMasterKengen.Text != "1") { //メッセージボックスの処理、項目が該当数値以外の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "表示設定は、0か1を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtMasterKengen.Focus(); return; } //空文字判定(閲覧権限) if (txtEtsuranKengen.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtEtsuranKengen.Focus(); return; } //入力文字判定(閲覧権限) if (txtEtsuranKengen.Text != "0" && txtEtsuranKengen.Text != "1") { //メッセージボックスの処理、項目が該当数値以外の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "表示設定は、0か1を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtEtsuranKengen.Focus(); return; } //空文字判定(利益率権限) if (txtRiekiritsuKengen.blIsEmpty() == false) { //メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtRiekiritsuKengen.Focus(); return; } //入力文字判定(利益率権限) if (txtRiekiritsuKengen.Text != "0" && txtRiekiritsuKengen.Text != "1") { //メッセージボックスの処理、項目が該当数値以外の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "表示設定は、0か1を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtRiekiritsuKengen.Focus(); return; } // 担当者コードチェック if (chkTantoushaCd()) { return; } // 金額チェック(目標金額) if (txtMokuhyou.chkMoneyText()) { return; } if (!chkTime(txtTimeFrom1)) { return; } if (!chkTime(txtTimeTo1)) { return; } //登録情報を入れる(担当者コード、担当者名、ログインID、営業所コード、注番、グループコード、目標金額、マスター権限、閲覧権限、利益率権限、ユーザー名) //[0] lstTantousha.Add(txtTantoushaCd.Text); //[1] lstTantousha.Add(txtTantoushaName.Text); //[2] lstTantousha.Add(txtLoginID.Text); //[3] lstTantousha.Add(lblSetEigyousho.CodeTxtText); //[4] lstTantousha.Add(txtChuban.Text); //[5] lstTantousha.Add(lblSetGroupCd.CodeTxtText); //[6] lstTantousha.Add(txtMokuhyou.Text); //[7] lstTantousha.Add(txtMasterKengen.Text); //[8] lstTantousha.Add(txtEtsuranKengen.Text); //[9] lstTantousha.Add(txtRiekiritsuKengen.Text); //[10] lstTantousha.Add(txtYakushokuCd.Text); //[11] lstTantousha.Add(txtHyoji.Text); //[12] lstTantousha.Add(SystemInformation.UserName); //ビジネス層のインスタンス生成 M1050_Tantousha_B tantouB = new M1050_Tantousha_B(); //検索時のデータ取り出し先 DataTable dtSetCd; // データ存在チェック用フラグ【新規登録以外の場合、メニュー権限の登録を行わない】 bool dataflag = false; try { //戻り値のDatatableを取り込む dtSetCd = tantouB.getTxtTantoshaLeave(txtTantoushaCd.Text); //検索結果にデータが存在しなければ終了 if (dtSetCd.Rows.Count == 0) { dataflag = true; } //登録 tantouB.addTantousha(lstTantousha, dataflag); tantouB.addTime(txtTantoushaCd.Text, txtTimeFrom1.Text, txtTimeTo1.Text); //メッセージボックスの処理、登録完了のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_TOUROKU, CommonTeisu.LABEL_TOUROKU, CommonTeisu.BTN_OK, CommonTeisu.DIAG_INFOMATION); basemessagebox.ShowDialog(); //テキストボックスを白紙にする delText(); } 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> /// addShiharai /// 支払追加処理 /// </summary> private void addShiharai() { string strDenpyoNo = ""; Control ctlGb = this.Controls["gbSiharaiInput"]; // 空文字判定(伝票年月日) if (txtYMD.blIsEmpty() == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "項目が空です。日付を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); txtYMD.Focus(); return; } // 日付フォーマットチェック string datedata = txtYMD.chkDateDataFormat(txtYMD.Text); if ("".Equals(datedata)) { // メッセージボックスの処理 BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_DATE_ALERT, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); return; } else { txtYMD.Text = datedata; } // 空文字判定(仕入先コード(取引先)) if (lblset_Siiresaki.codeTxt.blIsEmpty() == false) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_NULL, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); lblset_Siiresaki.Focus(); return; } // 入力チェック(仕入先コード(取引先)) if (lblset_Siiresaki.chkTxtTorihikisaki()) { lblset_Siiresaki.Focus(); return; } // 空文字判定(取引区分コードがある場合の金額) for (int cnt = 0; cnt <= 9; cnt++) { if (!ctlGb.Controls["labelSet_TorihikiKbn" + cnt.ToString()].Controls["codeTxt"].Text.Equals("")) { // 入力チェック(取引区分) if (((LabelSet_Torihikikbn)ctlGb.Controls["labelSet_TorihikiKbn" + cnt.ToString()]).chkTxtTorihikikbn()) { return; } if (ctlGb.Controls["txtShiharai" + cnt.ToString()].Text.Equals("")) { // メッセージボックスの処理、項目が空の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, "項目が空です。\r\n数値を入力してください。", CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); ctlGb.Controls["txtShiharai" + cnt.ToString()].Focus(); return; } // 金額フォーマットチェック(金額) if (((BaseTextMoney)ctlGb.Controls["txtShiharai" + cnt.ToString()]).chkMoneyText()) { return; } // 日付フォーマットチェック(手形期日) if (!"".Equals(((BaseCalendar)ctlGb.Controls["txtTegataYMD" + cnt.ToString()]).Text)) { datedata = ((BaseCalendar)ctlGb.Controls["txtTegataYMD" + cnt.ToString()]).chkDateDataFormat(((BaseCalendar)ctlGb.Controls["txtTegataYMD" + cnt.ToString()]).Text); if ("".Equals(datedata)) { // メッセージボックスの処理 BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_INPUT, CommonTeisu.LABEL_DATE_ALERT, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); return; } else { ((BaseCalendar)ctlGb.Controls["txtTegataYMD" + cnt.ToString()]).Text = datedata; } } } } // 日付制限チェック if (!dateCheck()) { txtYMD.Focus(); return; } B0060_ShiharaiInput_B shiharaiinputB = new B0060_ShiharaiInput_B(); try { // 伝票番号がない場合 if (txtDenpyoNo.Text.Equals("")) { strDenpyoNo = shiharaiinputB.getDenpyoNo(); } else { strDenpyoNo = txtDenpyoNo.Text; } string[] strCommontItem = new string[4]; string[,] strInsertItem = new string[10, 4]; strCommontItem[0] = strDenpyoNo; strCommontItem[1] = Environment.UserName; strCommontItem[2] = txtYMD.Text; strCommontItem[3] = lblset_Siiresaki.CodeTxtText; for (int cnt = 0; cnt <= 9; cnt++) { strInsertItem[cnt, 0] = ctlGb.Controls["labelSet_TorihikiKbn" + cnt.ToString()].Controls["codeTxt"].Text; strInsertItem[cnt, 1] = ctlGb.Controls["txtShiharai" + cnt.ToString()].Text; strInsertItem[cnt, 2] = ctlGb.Controls["txtTegataYMD" + cnt.ToString()].Text; strInsertItem[cnt, 3] = ctlGb.Controls["txtBikou" + cnt.ToString()].Text; } Boolean blDataAri = false; for (int intRow = 0; intRow <= 9; intRow++) { for (int intCol = 0; intCol <= 3; intCol++) { //データがある場合 if (StringUtl.blIsEmpty(strInsertItem[intRow, intCol].ToString())) { blDataAri = true; } } } //データがない場合 if (blDataAri == false) { return; } // 表示中の支払を追加する処理 shiharaiinputB.addShiharai(strCommontItem, strInsertItem); // メッセージボックスの処理、追加成功の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_TOUROKU, CommonTeisu.LABEL_TOUROKU, CommonTeisu.BTN_OK, CommonTeisu.DIAG_INFOMATION); basemessagebox.ShowDialog(); delText(); } catch (Exception ex) { // エラーロギング new CommonException(ex); // メッセージボックスの処理、追加失敗の場合のウィンドウ(OK) BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_TOUROKU, CommonTeisu.LABEL_TOUROKU_MISS, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR); basemessagebox.ShowDialog(); } return; }