Beispiel #1
0
        /// <summary>
        /// MakerList
        /// フォームの初期設定(ラベルセットから)
        /// </summary>
        public MenuList(Control c, LabelSet_Menu lblSetMenuSelect)
        {
            //画面データが解放されていた時の対策
            if (c == null)
            {
                return;
            }

            //画面位置の指定
            int intWindowWidth  = c.Width;
            int intWindowHeight = c.Height;

            //ラベルセットデータの確保
            lblSetMenu = lblSetMenuSelect;

            InitializeComponent();

            //ウィンドウ位置をマニュアル
            this.StartPosition = FormStartPosition.Manual;
            //親画面の中央を指定
            this.Left = c.Left + (intWindowWidth - this.Width) / 2;
            this.Top  = c.Top + 150;
        }
Beispiel #2
0
        ///<summary>
        ///addMyMenu
        ///テキストボックス内のデータをDBに登録
        ///</summary>
        private void addMyMenu()
        {
            //フォーカス位置の確保
            cActiveBefore = this.ActiveControl;

            //一度登録ボタンに移動して各データをチェック
            btnF01.Focus();

            //エラーメッセージを表示したかどうか
            if (blMessageOn == true)
            {
                //元のフォーカスに移動
                cActiveBefore.Focus();
                return;
            }

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

            try
            {
                //全データ分ループ
                for (int intCnt = 1; intCnt <= 200; intCnt++)
                {
                    //記入情報登録用
                    List <string> lstMakerData = new List <string>();

                    LabelSet_Menu lblsetmenu = (LabelSet_Menu)FindControlByFieldName(this, "labelSet_Menu" + intCnt);
                    lstMakerData.Add(intCnt.ToString());
                    lstMakerData.Add(lblsetmenu.CodeTxtText);
                    lstMakerData.Add(lblsetmenu.ValueLabelText);

                    //登録
                    mymenuB.addMyMenu(lstMakerData);
                }

                //メッセージボックスの処理、登録完了のウィンドウ(OK)
                BaseMessageBox basemessagebox = new BaseMessageBox(this, CommonTeisu.TEXT_TOUROKU, CommonTeisu.LABEL_TOUROKU, CommonTeisu.BTN_OK, CommonTeisu.DIAG_INFOMATION);
                basemessagebox.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;
            }

            //閉じる
            this.Close();

            //全てのフォームの中から
            foreach (System.Windows.Forms.Form frm in Application.OpenForms)
            {
                //業種のフォームを探す
                if (frm.Name.Equals("Z0000"))
                {
                    //データを連れてくるため、newをしないこと
                    Z0000.Z0000 z0000 = (Z0000.Z0000)frm;
                    z0000.Menu_ReSet();
                    z0000.Menu_Set();
                    break;
                }
            }
        }