Example #1
0
 ////////////////////////////////////////////////////////////////////////////
 //  イベント名 : SuishitsuKekkaNameMstButton_click
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 /// <param name="sender"></param>
 /// <history>
 /// 日付    担当者   内容
 /// 2014/06/24 YS.CHEW    新規作成
 /// </history>
 ////////////////////////////////////////////////////////////////////////////
 private void SuishitsuKekkaNameMstButton_click(object sender, EventArgs e)
 {
     SuishitsuKekkaNmMstListForm frm = new SuishitsuKekkaNmMstListForm();
     Program.mForm.ShowForm(frm);
 }
        ////////////////////////////////////////////////////////////////////////////
        //  イベント名 : decisionButton_Click
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// 日付    担当者   内容
        /// 2014/07/03 HuyTX      新規作成
        /// </history>
        ////////////////////////////////////////////////////////////////////////////
        private void decisionButton_Click(object sender, EventArgs e)
        {
            TraceLog.StartWrite(MethodInfo.GetCurrentMethod());
            Cursor preCursor = Cursor.Current;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                IDecisionBtnClickALInput alInput = new DecisionBtnClickALInput();

                //insert data
                if (string.IsNullOrEmpty(this._shishoCd) && string.IsNullOrEmpty(this._suishitsuKekkaCd))
                {
                    alInput.DisplayMode = DispMode.Add;
                    alInput.SuishitsuKekkaNmDT = CreateSuishitsuKekkaNmMstInsert();
                }
                else
                {
                    //update data
                    alInput.DisplayMode = DispMode.Edit;
                    alInput.SuishitsuKekkaNmDT = CreateSuishitsuKekkaNmMstUpdate(this._suishitsuKekkaNmMstDT);
                }

                IDecisionBtnClickALOutput alOutput = new DecisionBtnClickApplicationLogic().Execute(alInput);

                if (!string.IsNullOrEmpty(alOutput.ErrMessage))
                {
                    MessageForm.Show2(MessageForm.DispModeType.Error, alOutput.ErrMessage);
                    return;
                }

                //close form and redirect SuishitsuKekkaNmMstListForm
                SuishitsuKekkaNmMstListForm frm = new SuishitsuKekkaNmMstListForm();
                Program.mForm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                TraceLog.ErrorWrite(MethodInfo.GetCurrentMethod(), ex.ToString());
                MessageForm.Show(MessageForm.DispModeType.Error, MessageResouce.MSGID_E00001, ex.Message);
            }
            finally
            {
                Cursor.Current = preCursor;
                TraceLog.EndWrite(MethodInfo.GetCurrentMethod());
            }
        }
        ////////////////////////////////////////////////////////////////////////////
        //  イベント名 : deleteButton_Click
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// 日付    担当者   内容
        /// 2014/07/03 HuyTX      新規作成
        /// </history>
        ////////////////////////////////////////////////////////////////////////////
        private void deleteButton_Click(object sender, EventArgs e)
        {
            TraceLog.StartWrite(MethodInfo.GetCurrentMethod());
            Cursor preCursor = Cursor.Current;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                if (MessageForm.Show2(MessageForm.DispModeType.Question, "表示されているデータが削除されます。よろしいですか?") == DialogResult.Yes)
                {
                    IDeleteBtnClickALInput alInput = new DeleteBtnClickALInput();
                    alInput.ShishoCd = this._shishoCd;
                    alInput.SuishitsuKekkaNmCd = this._suishitsuKekkaCd;

                    IDeleteBtnClickALOutput alOutput = new DeleteBtnClickApplicationLogic().Execute(alInput);

                    //check not exist record
                    if (!string.IsNullOrEmpty(alOutput.ErrMessage))
                    {
                        MessageForm.Show2(MessageForm.DispModeType.Error, alOutput.ErrMessage);
                        return;
                    }

                    //close form and redirect SuishitsuKekkaNmMstListForm
                    SuishitsuKekkaNmMstListForm frm = new SuishitsuKekkaNmMstListForm();
                    Program.mForm.ShowForm(frm);
                }

            }
            catch (Exception ex)
            {
                TraceLog.ErrorWrite(MethodInfo.GetCurrentMethod(), ex.ToString());
                MessageForm.Show(MessageForm.DispModeType.Error, MessageResouce.MSGID_E00001, ex.Message);
            }
            finally
            {
                Cursor.Current = preCursor;
                TraceLog.EndWrite(MethodInfo.GetCurrentMethod());
            }
        }
        ////////////////////////////////////////////////////////////////////////////
        //  イベント名 : closeButton_Click
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// 日付    担当者   内容
        /// 2014/07/03 HuyTX      新規作成
        /// </history>
        ////////////////////////////////////////////////////////////////////////////
        private void closeButton_Click(object sender, EventArgs e)
        {
            TraceLog.StartWrite(MethodInfo.GetCurrentMethod());
            Cursor preCursor = Cursor.Current;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                SuishitsuKekkaNmMstListForm frm = new SuishitsuKekkaNmMstListForm();

                if (this._displayMode != DispMode.Detail)
                {
                    if (IsEditedControl())
                    {
                        if (MessageForm.Show2(MessageForm.DispModeType.Question, "編集内容が破棄されます。よろしいですか?") != DialogResult.Yes)
                        {
                            return;
                        }
                    }
                }

                Program.mForm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                TraceLog.ErrorWrite(MethodInfo.GetCurrentMethod(), ex.ToString());
                MessageForm.Show(MessageForm.DispModeType.Error, MessageResouce.MSGID_E00001, ex.Message);
            }
            finally
            {
                Cursor.Current = preCursor;
                TraceLog.EndWrite(MethodInfo.GetCurrentMethod());
            }
        }