///<summary> ///setEndAction ///戻るボタンの処理 ///</summary> private void setEndAction(List <string> lstSelectId) { //データグリッドビューからデータを選択且つセット系から来た場合 if (lblSetMenu != null && lstSelectId.Count != 0) { //PG番号が0の場合 if (lstSelectId[0] == "0") { lblSetMenu.CodeTxtText = "0"; lblSetMenu.ValueLabelText = ""; } else { //セットの中に検索結果データを入れる lblSetMenu.CodeTxtText = lstSelectId[0]; lblSetMenu.ValueLabelText = lstSelectId[1]; } } this.Close(); //ビジネス層のインスタンス生成 MenuList_B menulistB = new MenuList_B(); try { //画面終了処理 menulistB.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; } }
///<summary> ///setSelectItem ///データグリッドビュー内のデータ選択後の処理 ///</summary> private void setSelectItem() { //検索結果にデータが存在しなければ終了 if (gridMenu.RowCount == 0) { return; } //選択行の担当者情報 List <string> lstSelectId = new List <string>(); //選択行の担当者情報取得 string strSelectNo = (string)gridMenu.CurrentRow.Cells["PG番号"].Value.ToString(); string strSelectName = (string)gridMenu.CurrentRow.Cells["PG名"].Value; //検索情報を入れる lstSelectId.Add(strSelectNo); lstSelectId.Add(strSelectName); //ビジネス層のインスタンス生成 MenuList_B menuListB = new MenuList_B(); try { //ビジネス層、検索ロジックに移動 menuListB.getSelectItem(intFrmKind, strSelectNo); setEndAction(lstSelectId); } 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> ///setDatagridView ///データグリッドビュー表示 ///</summary> private void setDatagridView() { //取得したデータの編集を行う用 DataTable dtView = new DataTable(); //ビジネス層のインスタンス生成 MenuList_B menulistB = new MenuList_B(); try { //検索データを取得 dtView = menulistB.getViewGrid(); //データグリッドビューに表示 gridMenu.DataSource = dtView; //検索件数を表示 lblRecords.Text = "該当件数( " + gridMenu.RowCount.ToString() + "件)"; //件数が0の場合 if (gridMenu.RowCount == 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; } }