예제 #1
0
        ///<summary>
        ///EndAction
        ///戻るボタンの処理
        ///</summary>
        private void EndAction(List <string> lstSelectId)
        {
            //データグリッドビューからデータを選択且つセット系から来た場合
            if (lblSetGyoshu != null && lstSelectId.Count != 0)
            {
                //セットの中に検索結果データを入れる
                lblSetGyoshu.CodeTxtText    = lstSelectId[0];
                lblSetGyoshu.ValueLabelText = lstSelectId[1];
            }

            this.Close();

            //ビジネス層のインスタンス生成
            GyoshuList_B gyoshulistB = new GyoshuList_B();

            try
            {
                //画面終了処理
                gyoshulistB.FormMove(intFrmKind);
            }
            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;
            }
        }
예제 #2
0
        ///<summary>
        ///setSelectItem
        ///データグリッドビュー内のデータ選択後の処理
        ///</summary>
        private void setSelectItem()
        {
            //データグリッドビューにデータが存在しなければ終了
            if (gridSeihin.RowCount == 0)
            {
                return;
            }

            //選択行の業種情報
            List <string> lstString = new List <string>();

            //選択行の業種情報取得
            string strSelectId   = (string)gridSeihin.CurrentRow.Cells["業種コード"].Value;
            string strSelectName = (string)gridSeihin.CurrentRow.Cells["業種名"].Value;

            //検索情報を入れる
            lstString.Add(strSelectId);
            lstString.Add(strSelectName);

            //ビジネス層のインスタンス生成
            GyoshuList_B gyoshulistB = new GyoshuList_B();

            try
            {
                //データグリッドビュー内のデータ選択後の処理
                gyoshulistB.getSelectItem(intFrmKind, strSelectId);

                EndAction(lstString);
            }
            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;
            }
        }
예제 #3
0
        ///<summary>
        ///setDatagridView
        ///データグリッドビュー表示
        ///</summary>
        private void setDatagridView()
        {
            //ビジネス層のインスタンス生成
            GyoshuList_B gyoshulistB = new GyoshuList_B();

            try
            {
                //データグリッドビュー部分
                gridSeihin.DataSource = gyoshulistB.getDatagridView();

                //幅の値を設定
                gridSeihin.Columns["業種コード"].Width = 120;
                gridSeihin.Columns["業種名"].Width   = 250;

                //中央揃え
                gridSeihin.Columns[1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

                lblRecords.Text = "該当件数( " + gridSeihin.RowCount.ToString() + "件)";

                //件数が0の場合
                if (lblRecords.Text == "0")
                {
                    //メッセージボックスの処理、項目のデータがない場合のウィンドウ(OK)
                    BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_VIEW, CommonTeisu.LABEL_NOTDATA, CommonTeisu.BTN_OK, CommonTeisu.DIAG_ERROR);
                    basemessagebox.ShowDialog();
                    return;
                }
            }
            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;
            }
        }