///<summary> ///setShohinList ///商品リストに移動 ///</summary> private void setShohinList() { //商品リストのインスタンス生成 ShouhinList shouhinlist = new ShouhinList(this); try { //検索項目に一つでも記入がある場合 if (labelSet_Daibunrui.codeTxt.blIsEmpty() == false && labelSet_Chubunrui.codeTxt.blIsEmpty() == false && labelSet_Maker.codeTxt.blIsEmpty() == false && txtKensaku.blIsEmpty() == false) { shouhinlist.blKensaku = false; } else { shouhinlist.blKensaku = true; } //商品リストの表示、画面IDを渡す shouhinlist.intFrmKind = CommonTeisu.FRM_SHOHINMOTOCHOKAKUNIN; shouhinlist.strYMD = ""; shouhinlist.strEigyoushoCode = ""; shouhinlist.lsDaibunrui = labelSet_Daibunrui; shouhinlist.lsChubunrui = labelSet_Chubunrui; shouhinlist.lsMaker = labelSet_Maker; shouhinlist.btxtKensaku = txtKensaku; shouhinlist.btxtShohinCd = txtShohinCd; shouhinlist.lblGrayHinMakerChuHinban = lblGrayShohin; shouhinlist.lblGrayTanabanH = lblGrayTanaHon; shouhinlist.lblGrayTanabanG = lblGrayTanaGihu; shouhinlist.ShowDialog(); //初回時用、二回目以降は無くても動作する if (txtShohinCd.Text != "") { txtCalendarYMopen.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> ///setShohinList ///商品リストに移動 ///</summary> private void setShohinList() { ShouhinList shouhinlist = new ShouhinList(this); try { //検索項目に一つでも記入がある場合 if (labelSet_Daibunrui.codeTxt.blIsEmpty() == false && labelSet_Chubunrui.codeTxt.blIsEmpty() == false && labelSet_Maker.codeTxt.blIsEmpty() == false && txtKensakuS.blIsEmpty() == false) { shouhinlist.blKensaku = false; } else { shouhinlist.blKensaku = true; } //商品リストの表示、画面IDを渡す shouhinlist.intFrmKind = CommonTeisu.FRM_SHOHINBETSURIEKIRITSUSETTEI; shouhinlist.lsDaibunrui = labelSet_Daibunrui; shouhinlist.lsChubunrui = labelSet_Chubunrui; shouhinlist.lsMaker = labelSet_Maker; shouhinlist.btxtKensaku = txtKensakuS; shouhinlist.btxtShohinCd = txtShohinCd; shouhinlist.bmtxtTeika = txtTeika; shouhinlist.btxtHinC1Hinban = txtKataban; shouhinlist.ShowDialog(); } 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> ///showShohinList ///商品リストの実行 ///</summary> private void showShohinList() { ShouhinList shouhinlist = new ShouhinList(this); try { //検索項目に一つでも記入がある場合 if (labelSet_Daibunrui.codeTxt.blIsEmpty() == false && labelSet_Chubunrui.codeTxt.blIsEmpty() == false && labelSet_Maker.codeTxt.blIsEmpty() == false && txtKensaku.blIsEmpty() == false) { shouhinlist.blKensaku = false; } else { shouhinlist.blKensaku = true; } shouhinlist.intFrmKind = CommonTeisu.FRM_SHOHINZAIKOKAKUNIN; shouhinlist.lsDaibunrui = labelSet_Daibunrui; shouhinlist.lsChubunrui = labelSet_Chubunrui; shouhinlist.lsMaker = labelSet_Maker; shouhinlist.btxtKensaku = txtKensaku; shouhinlist.btxtShohinCd = txtShohinCd; shouhinlist.btxtHinC1Hinban = txtHin; shouhinlist.ShowDialog(); } 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> ///updTxtKensakuLeave //検索ウィンドウか別テキストボックスに移動 ///</summary> public void updTxtKensakuLeave(object sender, EventArgs e) { if (txtKensaku.TextLength > 0) { ShouhinList shouhinlist = new ShouhinList(this); try { //検索項目に一つでも記入がある場合 if (labelSet_Daibunrui.codeTxt.blIsEmpty() == false && labelSet_Chubunrui.codeTxt.blIsEmpty() == false && labelSet_Maker.codeTxt.blIsEmpty() == false && txtKensaku.blIsEmpty() == false) { shouhinlist.blKensaku = false; } else { shouhinlist.blKensaku = true; } shouhinlist.intFrmKind = CommonTeisu.FRM_TANAOROSHI; shouhinlist.strYMD = txtYMD.Text; shouhinlist.strEigyoushoCode = labelSet_Eigyousho.CodeTxtText; shouhinlist.lsDaibunrui = labelSet_Daibunrui_Edit; shouhinlist.lsChubunrui = labelSet_Chubunrui_Edit; shouhinlist.lsMaker = labelSet_Maker_Edit; //shouhinlist.lsDaibunrui.CodeTxtText = ""; //shouhinlist.lsChubunrui.CodeTxtText = ""; //shouhinlist.lsMaker.CodeTxtText = ""; shouhinlist.btxtKensaku = txtKensaku; shouhinlist.blKensaku = true; shouhinlist.lblGrayHinChuHinban = lblDspShouhin; shouhinlist.btxtShohinCd = txtShouhinCD; //営業所が本社の場合 if (labelSet_Eigyousho.CodeTxtText == "0001") { shouhinlist.lsTanabanH = labelSet_Tanaban_Edit; } //営業所が岐阜の場合 else if (labelSet_Eigyousho.CodeTxtText == "0002") { shouhinlist.lsTanabanG = labelSet_Tanaban_Edit; } shouhinlist.ShowDialog(); //商品コードがある場合 if (txtShouhinCD.blIsEmpty()) { //データ渡し用 List <string> lstString = new List <string>(); DataTable dtSelect = null; //データ渡し用 lstString.Add(txtYMD.Text); lstString.Add(txtShouhinCD.Text); lstString.Add(labelSet_Eigyousho.CodeTxtText); //処理部に移動 F0140_TanaorosiInput_B tanaorosiinputB = new F0140_TanaorosiInput_B(); //戻り値のDatatableを取り込む dtSelect = tanaorosiinputB.setSelectItem(lstString); //存在チェック if (dtSelect.Rows.Count > 0) { //各ラベル,テキストボックスに記入 labelSet_Daibunrui_Edit.CodeTxtText = dtSelect.Rows[0]["大分類コード"].ToString(); labelSet_Daibunrui_Edit.chkTxtDaibunrui(); labelSet_Chubunrui_Edit.CodeTxtText = dtSelect.Rows[0]["中分類コード"].ToString(); labelSet_Chubunrui_Edit.chkTxtChubunrui(labelSet_Daibunrui_Edit.CodeTxtText); labelSet_Tanaban_Edit.CodeTxtText = dtSelect.Rows[0]["棚番"].ToString(); labelSet_Maker_Edit.CodeTxtText = dtSelect.Rows[0]["メーカーコード"].ToString(); lblDspShouhin.Text = dtSelect.Rows[0]["品名型番"].ToString(); txtBiko.Text = dtSelect.Rows[0]["備考"].ToString(); //文字列をDecimal型に変換、小数点以下を削除 decimal decElemTanasu = Math.Floor(decimal.Parse(dtSelect.Rows[0]["棚卸数量"].ToString())); decimal decElemShitei = Math.Floor(decimal.Parse(dtSelect.Rows[0]["指定日在庫"].ToString())); //各テキストボックスに記入 txtTanasuu.Text = decElemTanasu.ToString(); txtTyoubosuu.Text = decElemShitei.ToString(); txtTanasuu.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> ///showShohinList ///商品リストの実行 ///</summary> private void showShohinList() { //商品検索画面のインスタンス生成 ShouhinList shouhinlist = new ShouhinList(this); try { //検索項目に一つでも記入がある場合 if (lblsetDaibunrui.codeTxt.blIsEmpty() == false && lblsetChubunrui.codeTxt.blIsEmpty() == false && lblsetMaker.codeTxt.blIsEmpty() == false && txtKensaku.blIsEmpty() == false) { //商品検索画面へ移動時に検索をしない shouhinlist.blKensaku = false; } else { //商品検索画面へ移動時に検索をする shouhinlist.blKensaku = true; } //表示していた品名を確保 string strHinmeiBef = txtHinmei.Text; //検索項目が編集できる状態かどうか判断 Boolean blEnabledTrue = false; //検索項目が編集できる状態だった場合(Enable処理は複数一挙に行うため、大分類コードのみの確認でOK) if (lblsetDaibunrui.Enabled == true) { //検索項目が編集できる状態だった判定 blEnabledTrue = true; } //編集可能にする lblsetDaibunrui.Enabled = true; lblsetChubunrui.Enabled = true; lblsetMaker.Enabled = true; txtHinmei.Enabled = true; lblHinmei.Enabled = true; //商品検索画面と繋げるデータ shouhinlist.intFrmKind = CommonTeisu.FRM_HACHUINPUT; //画面No shouhinlist.lsDaibunrui = lblsetDaibunrui; //大分類ラベルセット shouhinlist.lsChubunrui = lblsetChubunrui; //中分類ラベルセット shouhinlist.lsMaker = lblsetMaker; //メーカーラベルセット shouhinlist.btxtHinC1Hinban = txtHinmei; //品名テキストボックス shouhinlist.btxtHinC1 = txtC1; //C1テキストボックス shouhinlist.btxtHinC2 = txtC2; //C2テキストボックス shouhinlist.btxtHinC3 = txtC3; //C3テキストボックス shouhinlist.btxtHinC4 = txtC4; //C4テキストボックス shouhinlist.btxtHinC5 = txtC5; //C5テキストボックス shouhinlist.btxtHinC6 = txtC6; //C6テキストボックス shouhinlist.btxtShohinCd = txtShohinCd; //商品コードテキストボックス shouhinlist.btxtKensaku = txtKensaku; //検索テキストボックス shouhinlist.bmtxtShireTanka = txtTanka; //単価テキストボックス //商品検索画面の表示 shouhinlist.ShowDialog(); //商品リストから新しく選ばれた場合 if (strHinmeiBef != txtHinmei.Text) { txtHinmei.Enabled = false; lblHinmei.Enabled = false; //カンマ処理 txtTanka.updPriceMethod(); //数量テキストボックスにフォーカス txtSu.Focus(); } else { //商品リストに行く前に検索項目が編集できない状態だった場合 if (blEnabledTrue == false) { //編集不可能にする(検索前の状態にする) lblsetDaibunrui.Enabled = false; lblsetChubunrui.Enabled = false; lblsetMaker.Enabled = false; txtHinmei.Enabled = false; lblHinmei.Enabled = 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> ///setShohinList ///商品リストに移動 ///</summary> private void setShohinList() { logger.Info(LogUtil.getMessage(this._Title, "検索実行")); if (blSelectFlag == false) { ShouhinList shouhinlist = new ShouhinList(this); try { //検索項目がある場合 if (txtKensakuS.blIsEmpty() == false) { shouhinlist.blKensaku = false; } else { shouhinlist.blKensaku = true; } //商品リストの表示、画面IDを渡す shouhinlist.intFrmKind = CommonTeisu.FRM_TOKUTEIMUKESAKITANKA; shouhinlist.btxtKensaku = txtKensakuS; shouhinlist.btxtShohinCd = txtShohinCd; shouhinlist.btxtHinC1Hinban = txtKataban; shouhinlist.ShowDialog(); strBfKensa = txtKensakuS.Text; blSelectFlag = true; } 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; } } else { // 検索前の検索文字列がブランク、又は、検索前と検索文字列が違っていた場合 if (strBfKensa == "" || strBfKensa != txtKensakuS.Text) { ShouhinList shouhinlist = new ShouhinList(this); try { //検索項目がある場合 if (txtKensakuS.blIsEmpty() == false) { shouhinlist.blKensaku = false; } else { shouhinlist.blKensaku = true; } //商品リストの表示、画面IDを渡す shouhinlist.intFrmKind = CommonTeisu.FRM_TOKUTEIMUKESAKITANKA; shouhinlist.btxtKensaku = txtKensakuS; shouhinlist.btxtShohinCd = txtShohinCd; shouhinlist.btxtHinC1Hinban = txtKataban; shouhinlist.ShowDialog(); strBfKensa = txtKensakuS.Text; } 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; } } else { SendKeys.Send("{TAB}"); } } }
///<summary> ///showtShohinList ///商品リストに移動(前提) ///</summary> private void showShohinList() { //商品リストを一回以上開いたことがない場合 if (shouhinlist == null) { shouhinlist = new ShouhinList(this); try { //検索項目に一つでも記入がある場合 if (labelSet_Daibunrui.codeTxt.blIsEmpty() == false && labelSet_Chubunrui.codeTxt.blIsEmpty() == false && labelSet_Maker.codeTxt.blIsEmpty() == false && txtKensaku.blIsEmpty() == false) { shouhinlist.blKensaku = false; } else { shouhinlist.blKensaku = true; } shouhinlist.intFrmKind = CommonTeisu.FRM_SHOHIN; shouhinlist.strYMD = ""; shouhinlist.strEigyoushoCode = ""; shouhinlist.lsDaibunrui = labelSet_Daibunrui; shouhinlist.lsChubunrui = labelSet_Chubunrui; shouhinlist.lsMaker = labelSet_Maker; shouhinlist.btxtKensaku = txtKensaku; shouhinlist.btxtHinC1 = txtData1; shouhinlist.btxtHinC2 = txtData2; shouhinlist.btxtHinC3 = txtData3; shouhinlist.btxtHinC4 = txtData4; shouhinlist.btxtHinC5 = txtData5; shouhinlist.btxtHinC6 = txtData6; shouhinlist.bmtxtHyojunBaika = txtHyojun; shouhinlist.bmtxtShireTanka = txtShire; shouhinlist.bmtxtHyokaTanka = txtHyoka; shouhinlist.bmtxtTateneShire = txtTatene; shouhinlist.btxtZaikokbn = txtZaiko; shouhinlist.lsTanabanH = labelSet_TanabanHonsha; shouhinlist.lsTanabanG = labelSet_TanabanGihu; shouhinlist.btxtMemo = txtMemo; shouhinlist.bmtxtTeika = txtTeika; shouhinlist.bmtxtHakosu = txtHako; shouhinlist.btxtComment = txtComment; shouhinlist.lblGrayYM = lblGrayToroku; shouhinlist.btxtShohinCd = txtShohinCd; shouhinlist.lblGrayHinMakerDaiCdChuCdHinban = lblGrayShohin; shouhinlist.blShohinMaster = true; shouhinlist.chbxHontoroku = chbxHontoroku; shouhinlist.ShowDialog(); shouhinlist.Close(); shouhinlist.Dispose(); shouhinlist = null; //初回時用、二回目以降は無くても動作する if (txtShohinCd.Text != "") { txtData1.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; } } else { //既に1回以上商品リストを表示しているので、hideを元に戻す shouhinlist.Show(); //再検索 shouhinlist.setShohinView(); } }
///<summary> ///showShohinList ///商品リストの実行 ///</summary> private void showShohinList() { ShouhinList shouhinlist = new ShouhinList(this); try { //検索項目に一つでも記入がある場合 if ( labelSet_DaibunruiS.codeTxt.blIsEmpty() == false && labelSet_ChubunruiS.codeTxt.blIsEmpty() == false && labelSet_MakerS.codeTxt.blIsEmpty() == false && txtKensaku.blIsEmpty() == false) { shouhinlist.blKensaku = false; } else { shouhinlist.blKensaku = true; } ////表示していた品名を確保 //string strHinmeiBef = txtHinmei.Text; ////検索項目が編集できる状態かどうか判断 //Boolean blEnabledTrue = false; ////検索項目が編集できる状態だった場合 //if (labelSet_Daibunrui.Enabled == true) //{ // blEnabledTrue = true; //} ////編集可能にする //labelSet_Daibunrui.Enabled = true; //labelSet_Chubunrui.Enabled = true; //labelSet_Maker.Enabled = true; //txtHinmei.Enabled = true; //lblHinmei.Enabled = true; shouhinlist.intFrmKind = CommonTeisu.FRM_HACHUINPUT; shouhinlist.lsDaibunrui = labelSet_DaibunruiS; shouhinlist.lsChubunrui = labelSet_ChubunruiS; shouhinlist.lsMaker = labelSet_MakerS; //shouhinlist.btxtHinC1 = txtHinmei; //shouhinlist.btxtHinC2 = txtData2; //shouhinlist.btxtHinC3 = txtData3; //shouhinlist.btxtHinC4 = txtData4; //shouhinlist.btxtHinC5 = txtData5; //shouhinlist.btxtHinC6 = txtData6; shouhinlist.btxtShohinCd = txtShohinCd; //shouhinlist.lblGrayTanabanH = lblGrayTanaHon; //shouhinlist.lblGrayTanabanG = lblGrayTanaGihu; //shouhinlist.cbShireTanka = cmbHachutan; shouhinlist.btxtKensaku = txtKensaku; shouhinlist.bmtxtTeika = txtTeka; shouhinlist.lblGrayHinMakerDaiCdChuCdHinban = lblGrayShohin; shouhinlist.ShowDialog(); //setcmbHachutanSetUp(); ////商品リストから新しく選ばれた場合 //if (strHinmeiBef != txtHinmei.Text) //{ // //編集不可能にする // labelSet_Daibunrui.Enabled = false; // labelSet_Chubunrui.Enabled = false; // labelSet_Maker.Enabled = false; // txtHinmei.Enabled = false; // lblHinmei.Enabled = false; // //データを確保 // txtData1.Text = txtHinmei.Text; // //掛率の再計算 // setKakeritsu(); // txtHachusu.Focus(); //} //else //{ // //商品リストに行く前に検索項目が編集できる状態ではない場合 // if (blEnabledTrue == false) // { // //編集不可能にする // labelSet_Daibunrui.Enabled = false; // labelSet_Chubunrui.Enabled = false; // labelSet_Maker.Enabled = false; // txtHinmei.Enabled = false; // lblHinmei.Enabled = 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; } }