Exemple #1
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     if (this.StartUpMode == true)
     {
         ExMessageBox.ResultShow(this, null, "アプリケーションを終了します。" + Environment.NewLine + "よろしいですか?");
         //if (ExMessageBox.ResultShow("アプリケーションを終了します。" + Environment.NewLine + "よろしいですか?") == MessageBoxResult.OK)
         //{
         //    if (Application.Current.IsRunningOutOfBrowser)
         //        Application.Current.MainWindow.Close();
         //}
     }
     else
     {
         Dlg_Login win = (Dlg_Login)ExVisualTreeHelper.FindPerentChildWindow(this.Parent);
         if (win != null)
         {
             win.Close();
         }
     }
 }
Exemple #2
0
        private void lblEnd_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            ExMessageBox.ResultShow(this, null, "アプリケーションを終了します。" + Environment.NewLine + "よろしいですか?");

            //if (ExMessageBox.ResultShow("アプリケーションを終了します。" + Environment.NewLine + "よろしいですか?") == MessageBoxResult.OK)
            //{
            //    // ログイン済の場合
            //    if (Common.gstrSessionString != "")
            //    {
            //        // System終了時の証跡を保存(System開始時の証跡はログイン時)
            //        DataPgEvidence.SaveLoadOrUnLoadEvidence(DataPgEvidence.PGName.System, DataPgEvidence.geOperationType.End);

            //        // ログオフ
            //        object[] prm = new object[1];
            //        prm[0] = "";
            //        ExWebService webService = new ExWebService();
            //        webService.objMenu = this;
            //        webService.CallWebService(ExWebService.geWebServiceCallKbn.Logoff,
            //                                  ExWebService.geDialogDisplayFlg.No,
            //                                  ExWebService.geDialogCloseFlg.No,
            //                                  prm);
            //    }
            //}
        }
Exemple #3
0
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            string  errMessage  = "";
            string  warnMessage = "";
            Control errCtl      = null;

            #endregion

            try
            {
                for (int i = 0; i <= _entity.Count - 1; i++)
                {
                    // IDまたは名称の入力がある場合(空行は無視)
                    if (!string.IsNullOrEmpty(_entity[i]._id) || !string.IsNullOrEmpty(_entity[i]._name))
                    {
                        #region 入力チェック

                        #region 必須チェック

                        // ID
                        if (string.IsNullOrEmpty(_entity[i]._id))
                        {
                            errMessage += (i + 1) + "行目のIDが入力されていません。" + Environment.NewLine;
                            if (errCtl == null)
                            {
                                errCtl        = this.dg;
                                _selectIndex  = i;
                                _selectColumn = 0;
                            }
                        }

                        // 名称
                        if (string.IsNullOrEmpty(_entity[i]._name))
                        {
                            errMessage += (i + 1) + "行目の名称が入力されていません。" + Environment.NewLine;
                            if (errCtl == null)
                            {
                                errCtl        = this.dg;
                                _selectIndex  = i;
                                _selectColumn = 1;
                            }
                        }

                        #endregion

                        #region 適正値入力チェック

                        if (!string.IsNullOrEmpty(_entity[i]._id))
                        {
                            if (ExCast.zCInt(_entity[i]._id) == 0)
                            {
                                errMessage += (i + 1) + "行目のIDに「0」以外を入力して下さい。" + Environment.NewLine;
                                if (errCtl == null)
                                {
                                    errCtl        = this.dg;
                                    _selectIndex  = i;
                                    _selectColumn = 0;
                                }
                            }
                        }

                        //// 主仕入先
                        //if (ExCast.zCStr(_entity._main_purchase_id) != "" && string.IsNullOrEmpty(_entity._main_purchase_nm))
                        //{
                        //    errMessage += "主仕入先が適切に入力(選択)されていません。" + Environment.NewLine;
                        //    if (errCtl == null) errCtl = this.utlMainPurchaseId.txtID;
                        //}

                        #endregion

                        #region  一IDチェック

                        if (!string.IsNullOrEmpty(_entity[i]._id))
                        {
                            for (int _i = 0; _i <= _entity.Count - 1; _i++)
                            {
                                if (_i != i && ExCast.zCInt(_entity[i]._id) == ExCast.zCInt(_entity[_i]._id) && !string.IsNullOrEmpty(_entity[_i]._id) && ExCast.zCInt(_entity[i]._id) != 0)
                                {
                                    string _msg = "ID : " + ExCast.zCInt(_entity[i]._id) + " が重複して入力されています。" + Environment.NewLine;
                                    if (errMessage.IndexOf(_msg) == -1)
                                    {
                                        errMessage += _msg;
                                        if (errCtl == null)
                                        {
                                            errCtl        = this.dg;
                                            _selectIndex  = i;
                                            _selectColumn = 0;
                                        }
                                    }
                                }
                            }
                        }

                        #endregion

                        #region 日付チェック

                        //// 納入指定日
                        //if (string.IsNullOrEmpty(_entity.supply_ymd) == false)
                        //{
                        //    if (ExCast.IsDate(_entity.supply_ymd) == false)
                        //    {
                        //        errMessage += "納入指定日の形式が不正です。(yyyy/mm/dd形式で入力(選択)して下さい)" + Environment.NewLine;
                        //        if (errCtl == null) errCtl = this.datNokiYmd;
                        //    }
                        //}

                        #endregion

                        #region 日付変換

                        // 受注日
                        //if (string.IsNullOrEmpty(_entity.order_ymd) == false)
                        //{
                        //    _entity.order_ymd = ExCast.zConvertToDate(_entity.order_ymd).ToString("yyyy/MM/dd");

                        //}

                        #endregion

                        #region 数値チェック

                        // ID
                        if (!string.IsNullOrEmpty(_entity[i]._id))
                        {
                            if (!ExCast.IsNumeric(_entity[i]._id))
                            {
                                errMessage += (i + 1) + "行目のIDに数値が入力されていません。" + Environment.NewLine;
                                if (errCtl == null)
                                {
                                    errCtl        = this.dg;
                                    _selectIndex  = i;
                                    _selectColumn = 0;
                                }
                            }
                        }

                        #endregion

                        #region 正数チェック

                        //if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                        //{
                        //    if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) < 0)
                        //    {
                        //        errMessage += "IDには正の整数を入力して下さい。" + Environment.NewLine;
                        //    }
                        //}

                        #endregion

                        #region 範囲チェック

                        //if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) > 9999)
                        //{
                        //    errMessage += "IDには4桁の正の整数を入力して下さい。" + Environment.NewLine;
                        //}

                        //if (ExString.LenB(_entity._memo) > 32)
                        //{
                        //    errMessage += "備考には全角16桁文字以内(半角32桁文字以内)を入力して下さい。" + Environment.NewLine;
                        //    if (errCtl == null) errCtl = this.txtMemo;
                        //}

                        #endregion

                        #endregion

                        _entity[i]._display_division_id = MeiNameList.GetID(MeiNameList.geNameKbn.DISPLAY_DIVISION_ID, ExCast.zCStr(_entity[i]._display_division_nm)) - 1;
                    }
                }

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(this, errCtl, errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                    //if (ExMessageBox.ResultShow(warnMessage) == MessageBoxResult.No)
                    //{
                    //    flg = false;
                    //}
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        switch (errCtl.Name)
                        {
                        case "dg":
                            errCtl.Focus();
                            this.dg.SelectedIndex = _selectIndex;
                            dg.CurrentColumn      = dg.Columns[_selectColumn];
                            ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                            break;

                        default:
                            ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                            break;
                        }
                    }
                    return;
                }

                #endregion

                #region 更新処理

                UpdateData();

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            int     chk_cnt     = 0;
            string  errMessage  = "";
            string  warnMessage = "";
            Control errCtl      = null;

            #endregion

            try
            {
                foreach (CheckBox chk in ExVisualTreeHelper.FindVisualChildren <CheckBox>(this.stpAll))
                {
                    if (chk.IsChecked == true)
                    {
                        chk_cnt += 1;
                    }
                }

                #region 必須チェック

                if (chk_cnt == 0)
                {
                    errMessage += "権限が1件も選択されていません。" + Environment.NewLine;
                }

                #endregion

                #region チェックセット

                if (chk_cnt > 0)
                {
                    foreach (CheckBox chk in ExVisualTreeHelper.FindVisualChildren <CheckBox>(this.stpAll))
                    {
                        for (int i = 0; i <= this._entity.Count - 1; i++)
                        {
                            if (ExCast.zCStr(chk.Tag) == _entity[i]._pg_id)
                            {
                                if (chk.IsChecked == true)
                                {
                                    _entity[i]._authority_kbn = 2;
                                }
                                else
                                {
                                    _entity[i]._authority_kbn = 0;
                                }
                            }
                            else if (ExCast.zCStr(chk.Tag) == "EstimateApproval" && _entity[i]._pg_id == "EstimateInp")
                            {
                                if (chk.IsChecked == true)
                                {
                                    _entity[i]._authority_kbn = 9;
                                }
                            }
                        }
                    }
                }

                #endregion

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(this, errCtl, errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                    }
                    return;
                }

                #endregion

                #region 更新処理

                UpdateData();

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            string  errMessage    = "";
            string  warnMessage   = "";
            int     _selectIndex  = 0;
            int     _selectColumn = 0;
            Control errCtl        = null;

            #endregion

            try
            {
                #region 必須チェック

                // 名称
                if (string.IsNullOrEmpty(_entity._name))
                {
                    errMessage += "会社名が入力されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtName;
                    }
                }

                #endregion

                #region 適正値入力チェック

                // 郵便番号上記3桁のみはNG
                if (!string.IsNullOrEmpty(_entity._zip_code_from) && string.IsNullOrEmpty(_entity._zip_code_to))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtZipNo1;
                    }
                }

                // 郵便番号下記4桁のみはNG
                if (string.IsNullOrEmpty(_entity._zip_code_from) && !string.IsNullOrEmpty(_entity._zip_code_to))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtZipNo2;
                    }
                }

                // 郵便番号のみはNG
                if ((!string.IsNullOrEmpty(_entity._zip_code_from) && !string.IsNullOrEmpty(_entity._zip_code_to)) && (string.IsNullOrEmpty(_entity._adress1)))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtAdress1;
                    }
                }

                #endregion

                #region 日付チェック

                //// 納入指定日
                //if (string.IsNullOrEmpty(_entity.supply_ymd) == false)
                //{
                //    if (ExCast.IsDate(_entity.supply_ymd) == false)
                //    {
                //        errMessage += "納入指定日の形式が不正です。(yyyy/mm/dd形式で入力(選択)して下さい)" + Environment.NewLine;
                //        if (errCtl == null) errCtl = this.datNokiYmd;
                //    }
                //}

                #endregion

                #region 日付変換

                // 受注日
                //if (string.IsNullOrEmpty(_entity.order_ymd) == false)
                //{
                //    _entity.order_ymd = ExCast.zConvertToDate(_entity.order_ymd).ToString("yyyy/MM/dd");

                //}

                #endregion

                #region 数値チェック

                //if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                //{
                //    if (ExCast.IsNumeric(this.utlID.txtID.Text.Trim()) == false)
                //    {
                //        errMessage += "IDには数値を入力して下さい。" + Environment.NewLine;
                //    }
                //}

                #endregion

                #region 正数チェック

                //if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                //{
                //    if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) < 0)
                //    {
                //        errMessage += "IDには正の整数を入力して下さい。" + Environment.NewLine;
                //    }
                //}

                #endregion

                #region  更チェック

                if (before_intidFigureCustomer > _entity._id_figure_customer)
                {
                    warnMessage += "得意先/納入先ID桁数が" + before_intidFigureCustomer.ToString() + "から" + _entity._id_figure_customer + "に変更されています。" + Environment.NewLine;
                    warnMessage += "得意先/納入先ID桁数" + (_entity._id_figure_customer + 1).ToString() + "桁以上のデータの登録・参照ができなくなります。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtCustomerIdFg;
                    }
                }

                if (before_intidFigureCommodity > _entity._id_figure_commodity)
                {
                    warnMessage += "商品ID桁数が" + before_intidFigureCommodity.ToString() + "から" + _entity._id_figure_commodity + "に変更されています。" + Environment.NewLine;
                    warnMessage += "商品ID桁数" + (_entity._id_figure_commodity + 1).ToString() + "桁以上のデータの登録・参照ができなくなります。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtCommdityIdFg;
                    }
                }

                if (before_intidFigurePurchase > _entity._id_figure_purchase)
                {
                    warnMessage += "仕入先ID桁数が" + before_intidFigurePurchase.ToString() + "から" + _entity._id_figure_purchase + "に変更されています。" + Environment.NewLine;
                    warnMessage += "仕入先ID桁数" + (_entity._id_figure_purchase + 1).ToString() + "桁以上のデータの登録・参照ができなくなります。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtPurchaseIdFg;
                    }
                }

                if (before_intidFigureSlipNo > _entity._id_figure_slip_no)
                {
                    warnMessage += "伝票No桁数が" + before_intidFigureSlipNo.ToString() + "から" + _entity._id_figure_slip_no + "に変更されています。" + Environment.NewLine;
                    warnMessage += "伝票No桁数" + (_entity._id_figure_slip_no + 1).ToString() + "桁以上のデータの登録・参照ができなくなります。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtDenNoFg;
                    }
                }

                #endregion

                #region 範囲チェック

                if (!(ExCast.zCInt(this.txtCustomerIdFg.Text.Trim()) >= 4 && ExCast.zCInt(this.txtCustomerIdFg.Text.Trim()) <= 15))
                {
                    errMessage += "得意先/納入先ID桁数には4から15の整数を入力して下さい。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtCustomerIdFg;
                    }
                }

                if (!(ExCast.zCInt(this.txtCommdityIdFg.Text.Trim()) >= 4 && ExCast.zCInt(this.txtCommdityIdFg.Text.Trim()) <= 15))
                {
                    errMessage += "商品ID桁数には4から15の整数を入力して下さい。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtCommdityIdFg;
                    }
                }

                if (!(ExCast.zCInt(this.txtPurchaseIdFg.Text.Trim()) >= 4 && ExCast.zCInt(this.txtPurchaseIdFg.Text.Trim()) <= 15))
                {
                    errMessage += "仕入先ID桁数には4から15の整数を入力して下さい。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtPurchaseIdFg;
                    }
                }

                if (!(ExCast.zCInt(this.txtDenNoFg.Text.Trim()) >= 4 && ExCast.zCInt(this.txtDenNoFg.Text.Trim()) <= 15))
                {
                    errMessage += "伝票No桁数には4から15の整数を入力して下さい。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtDenNoFg;
                    }
                }

                #endregion

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                    //if (ExMessageBox.ResultShow(warnMessage) == MessageBoxResult.No)
                    //{
                    //    flg = false;
                    //}
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                    }
                    return;
                }

                #endregion

                #region 更新処理

                UpdateData(Common.geUpdateType.Update);

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            string  errMessage    = "";
            string  warnMessage   = "";
            int     _selectIndex  = 0;
            int     _selectColumn = 0;
            Control errCtl        = null;

            #endregion

            try
            {
                #region 必須チェック

                #endregion

                #region 適正値入力チェック

                #endregion

                #region 日付チェック

                //// 納入指定日
                //if (string.IsNullOrEmpty(_entity.supply_ymd) == false)
                //{
                //    if (ExCast.IsDate(_entity.supply_ymd) == false)
                //    {
                //        errMessage += "納入指定日の形式が不正です。(yyyy/mm/dd形式で入力(選択)して下さい)" + Environment.NewLine;
                //        if (errCtl == null) errCtl = this.datNokiYmd;
                //    }
                //}

                #endregion

                #region 日付変換

                // 受注日
                //if (string.IsNullOrEmpty(_entity.order_ymd) == false)
                //{
                //    _entity.order_ymd = ExCast.zConvertToDate(_entity.order_ymd).ToString("yyyy/MM/dd");

                //}

                #endregion

                #region 数値チェック

                #endregion

                #region 正数チェック

                #endregion

                #region 範囲チェック

                #endregion

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                    //if (ExMessageBox.ResultShow(warnMessage) == MessageBoxResult.No)
                    //{
                    //    flg = false;
                    //}
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                    }
                    return;
                }

                #endregion

                #region Entity Set

                if (this.cmbReportSize.SelectedIndex == -1)
                {
                    _entity._size = 0;
                }
                else
                {
                    _entity._size = this.cmbReportSize.SelectedIndex;
                }

                if (this.rdoVertical.IsChecked == true)
                {
                    _entity._orientation = 1;
                }
                else if (this.rdoHorizontal.IsChecked == true)
                {
                    _entity._orientation = 2;
                }
                else
                {
                    _entity._orientation = 0;
                }

                if (this.rdoGroupTotalKbnNasi.IsChecked == true)
                {
                    _entity._group_total = 0;
                }
                else if (this.rdoGroupTotalKbnAri.IsChecked == true)
                {
                    _entity._group_total = 1;
                }
                else
                {
                    _entity._group_total = 0;
                }

                if (this.cmbTotalKbn.SelectedIndex == -1)
                {
                    _entity._total_kbn = 0;
                }
                else
                {
                    _entity._total_kbn = this.cmbTotalKbn.SelectedIndex;
                }

                #endregion

                #region 更新処理

                UpdateData(Common.geUpdateType.Update);

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
        // 入力チェック
        public override void InputCheckUpdate()
        {
            #region Field

            string        errMessage          = "";
            string        warnMessage         = "";
            int           _selectIndex        = 0;
            int           _selectColumn       = 0;
            bool          IsDetailExists      = false;
            Control       errCtl              = null;
            List <string> list_warn_commodity = new List <string>();

            #endregion

            #region 必須チェック

            // 問い合わせ内容
            if (string.IsNullOrEmpty(this.txtContent.Text.Trim()))
            {
                errMessage += "問い合わせ内容が入力されていません。" + Environment.NewLine;
                if (errCtl == null)
                {
                    errCtl = this.txtTitle;
                }
            }

            // 担当
            if (this.cmbPerson.SelectedIndex == -1)
            {
                errMessage += "担当が選択されていません。" + Environment.NewLine;
                if (errCtl == null)
                {
                    errCtl = this.cmbPerson;
                }
            }

            #endregion

            #region 範囲チェック

            //if (ExCast.zCLng(_entityH._no) > 999999999999999)
            //{
            //    errMessage += "受注番号には15桁以内の正の整数を入力して下さい。" + Environment.NewLine;
            //}

            //if (ExCast.zCLng(_entityH._estimateno) > 999999999999999)
            //{
            //    errMessage += "見積番号には15桁以内の正の整数を入力して下さい。" + Environment.NewLine;
            //    if (errCtl == null) errCtl = this.utlEstimateNo.txtID;
            //}

            if (ExString.LenB(this.txtContent.Text) > 1000)
            {
                errMessage += "問い合わせ内容には全角500桁文字以内(半角1000桁文字以内)を入力して下さい。" + Environment.NewLine;
                if (errCtl == null)
                {
                    errCtl = this.txtContent;
                }
            }

            #endregion

            #region アップロードチェック

            if (this.tblUpload.Text == "※ファイルアップロードに失敗しました。")
            {
                warnMessage += "ファイルアップロードに失敗しています。" + Environment.NewLine;
            }

            #endregion

            #region エラー or 警告時処理

            bool flg = true;

            if (!string.IsNullOrEmpty(errMessage))
            {
                ExMessageBox.Show(errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                flg = false;
            }
            else
            {
                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;    // ResultMessageBoxにてResult処理
                }
            }

            this.txtDummy.IsTabStop = false;

            if (flg == false)
            {
                if (errCtl != null)
                {
                    ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                }
                return;
            }

            #endregion

            #region 更新処理

            UpdateData(Common.geUpdateType.Update);

            #endregion
        }
Exemple #8
0
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            string  errMessage    = "";
            string  warnMessage   = "";
            int     _selectIndex  = 0;
            int     _selectColumn = 0;
            Control errCtl        = null;

            #endregion

            try
            {
                #region 必須チェック

                if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                {
                    // ID
                    if (string.IsNullOrEmpty(this.utlID.txtID.Text.Trim()))
                    {
                        errMessage += "IDが入力されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.utlID.txtID;
                        }
                    }
                }

                // 名称
                if (string.IsNullOrEmpty(_entity._name))
                {
                    errMessage += "名称が入力されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtName;
                    }
                }

                //// 会社グループ
                //if (string.IsNullOrEmpty(ExCast.zCStr(_entity._group_id)))
                //{
                //    errMessage += "会社グループが入力(選択)されていません。" + Environment.NewLine;
                //    if (errCtl == null) errCtl = this.utlCompanyGroup.txtID;
                //}

                // 表示区分
                if (string.IsNullOrEmpty(ExCast.zCStr(_entity._display_division_id)))
                {
                    errMessage += "表示区分が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlDisplay.txtID;
                    }
                }

                #endregion

                #region 適正値入力チェック

                // 会社グループ
                if (string.IsNullOrEmpty(_entity._group_id) == false && string.IsNullOrEmpty(_entity._group_nm))
                {
                    errMessage += "会社グループが適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlCompanyGroup.txtID;
                    }
                }

                // 表示区分
                if (ExCast.zCInt(_entity._display_division_id) != 0 && string.IsNullOrEmpty(_entity._display_division_nm))
                {
                    errMessage += "表示区分が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlDisplay.txtID;
                    }
                }

                #endregion

                #region 日付チェック

                //// 納入指定日
                //if (string.IsNullOrEmpty(_entity.supply_ymd) == false)
                //{
                //    if (ExCast.IsDate(_entity.supply_ymd) == false)
                //    {
                //        errMessage += "納入指定日の形式が不正です。(yyyy/mm/dd形式で入力(選択)して下さい)" + Environment.NewLine;
                //        if (errCtl == null) errCtl = this.datNokiYmd;
                //    }
                //}

                #endregion

                #region 日付変換

                // 受注日
                //if (string.IsNullOrEmpty(_entity.order_ymd) == false)
                //{
                //    _entity.order_ymd = ExCast.zConvertToDate(_entity.order_ymd).ToString("yyyy/MM/dd");

                //}

                #endregion

                #region 数値チェック

                if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                {
                    if (ExCast.IsNumeric(this.utlID.txtID.Text.Trim()) == false)
                    {
                        errMessage += "IDには数値を入力して下さい。" + Environment.NewLine;
                    }
                }

                #endregion

                #region 正数チェック

                if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                {
                    if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) < 0)
                    {
                        errMessage += "IDには正の整数を入力して下さい。" + Environment.NewLine;
                    }
                }

                #endregion

                #region 範囲チェック

                if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) > 9999)
                {
                    errMessage += "IDには4桁の正の整数を入力して下さい。" + Environment.NewLine;
                }

                #endregion

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                    //if (ExMessageBox.ResultShow(warnMessage) == MessageBoxResult.No)
                    //{
                    //    flg = false;
                    //}
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                    }
                    return;
                }

                #endregion

                #region 更新処理

                switch (this.utlFunctionKey.gFunctionKeyEnable)
                {
                case Utl_FunctionKey.geFunctionKeyEnable.New:
                case Utl_FunctionKey.geFunctionKeyEnable.Init:
                    UpdateData(Common.geUpdateType.Insert);
                    break;

                case Utl_FunctionKey.geFunctionKeyEnable.Upd:
                    UpdateData(Common.geUpdateType.Update);
                    break;

                default:
                    break;
                }

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
Exemple #9
0
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            string  errMessage    = "";
            string  warnMessage   = "";
            int     _selectIndex  = 0;
            int     _selectColumn = 0;
            Control errCtl        = null;

            #endregion

            try
            {
                #region 必須チェック

                // ID
                if (this.cmbLoginId.SelectedIndex == -1)
                {
                    errMessage += "ログインIDが選択されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.cmbLoginId;
                    }
                }

                // 変更ログインID
                if (string.IsNullOrEmpty(_entity._after_login_id))
                {
                    errMessage += "変更ログインIDが入力されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtLoginId;
                    }
                }

                // ログインパスワード
                if (string.IsNullOrEmpty(_entity._login_password))
                {
                    errMessage += "ログインパスワードが入力されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtLoginId;
                    }
                }

                // ログインパスワード確認
                if (string.IsNullOrEmpty(txtLoginPasswordConfirm.Password))
                {
                    errMessage += "ログインパスワード確認が入力されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtLoginId;
                    }
                }

                // 名称
                if (string.IsNullOrEmpty(_entity._name))
                {
                    errMessage += "ユーザー名が入力されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtName;
                    }
                }

                // 会社グループ
                if (string.IsNullOrEmpty(ExCast.zCStr(_entity._group_id)))
                {
                    errMessage += "グループが入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlCompanyGroup.txtID;
                    }
                }

                // デフォルト入力担当
                if (string.IsNullOrEmpty(ExCast.zCStr(_entity._person_id)))
                {
                    errMessage += "デフォルト入力担当が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlPerson.txtID;
                    }
                }

                //// 表示区分
                //if (string.IsNullOrEmpty(ExCast.zCStr(_entity._display_division_id)))
                //{
                //    errMessage += "表示区分が入力(選択)されていません。" + Environment.NewLine;
                //    if (errCtl == null) errCtl = this.utlDisplay.txtID;
                //}

                #endregion

                #region 適正値入力チェック

                // パスワード
                if (this.txtLoginPassword.Password != this.txtLoginPasswordConfirm.Password)
                {
                    errMessage += "パスワードが一致しません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtLoginPasswordConfirm;
                    }
                }

                // 会社グループ
                if (ExCast.zCInt(_entity._group_id) != 0 && string.IsNullOrEmpty(_entity._group_nm))
                {
                    errMessage += "会社グループが適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlCompanyGroup.txtID;
                    }
                }

                // 担当
                if (ExCast.zCInt(_entity._person_id) != 0 && string.IsNullOrEmpty(_entity._person_nm))
                {
                    errMessage += "デフォルト入力担当が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlPerson.txtID;
                    }
                }

                // 表示区分
                if (ExCast.zCInt(_entity._display_division_id) != 0 && string.IsNullOrEmpty(_entity._display_division_nm))
                {
                    errMessage += "表示区分が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlDisplay.txtID;
                    }
                }

                #endregion

                #region 日付チェック

                //// 納入指定日
                //if (string.IsNullOrEmpty(_entity.supply_ymd) == false)
                //{
                //    if (ExCast.IsDate(_entity.supply_ymd) == false)
                //    {
                //        errMessage += "納入指定日の形式が不正です。(yyyy/mm/dd形式で入力(選択)して下さい)" + Environment.NewLine;
                //        if (errCtl == null) errCtl = this.datNokiYmd;
                //    }
                //}

                #endregion

                #region 日付変換

                // 受注日
                //if (string.IsNullOrEmpty(_entity.order_ymd) == false)
                //{
                //    _entity.order_ymd = ExCast.zConvertToDate(_entity.order_ymd).ToString("yyyy/MM/dd");

                //}

                #endregion

                #region 数値チェック

                #endregion

                #region 正数チェック

                #endregion

                #region 範囲チェック

                if (ExString.LenB(_entity._after_login_id) < 4)
                {
                    errMessage += "変更ログインIDには半角英数4桁以上を入力して下さい。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtLoginId;
                    }
                }

                if (ExString.LenB(_entity._after_login_id) > 10)
                {
                    errMessage += "変更ログインIDには半角英数10桁以内を入力して下さい。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtLoginId;
                    }
                }

                if (ExString.LenB(_entity._login_password) < 4)
                {
                    errMessage += "ログインパスワードには半角英数4桁以上を入力して下さい。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtLoginPassword;
                    }
                }

                if (ExString.LenB(_entity._login_password) > 10)
                {
                    errMessage += "ログインパスワードには半角英数20桁以内を入力して下さい。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtLoginPassword;
                    }
                }


                #endregion

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                    //if (ExMessageBox.ResultShow(warnMessage) == MessageBoxResult.No)
                    //{
                    //    flg = false;
                    //}
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                    }
                    return;
                }

                #endregion

                #region 更新処理

                switch (this.utlFunctionKey.gFunctionKeyEnable)
                {
                case Utl_FunctionKey.geFunctionKeyEnable.New:
                case Utl_FunctionKey.geFunctionKeyEnable.Init:
                    //UpdateData(Common.geUpdateType.Insert);
                    break;

                case Utl_FunctionKey.geFunctionKeyEnable.Upd:
                    UpdateData(Common.geUpdateType.Update);
                    break;

                default:
                    break;
                }

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            string  errMessage    = "";
            string  warnMessage   = "";
            int     _selectIndex  = 0;
            int     _selectColumn = 0;
            Control errCtl        = null;

            #endregion

            try
            {
                #region 必須チェック

                if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                {
                    // ID
                    if (string.IsNullOrEmpty(this.utlID.txtID.Text.Trim()))
                    {
                        errMessage += "IDが入力されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.utlID.txtID;
                        }
                    }
                }

                // 名称
                if (string.IsNullOrEmpty(_entity._name))
                {
                    errMessage += "名称が入力されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtName;
                    }
                }

                // 表示区分
                if (string.IsNullOrEmpty(ExCast.zCStr(_entity._display_division_nm)))
                {
                    errMessage += "表示区分が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlDisplay.txtID;
                    }
                }

                // 取引区分
                if (ExCast.zCInt(_entity._business_division_id) == 0)
                {
                    errMessage += "取引区分が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlBusiness.txtID;
                    }
                }

                // 単価種類
                if (ExCast.zCInt(_entity._unit_kind_id) == 0)
                {
                    errMessage += "単価種類が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlUnitKind.txtID;
                    }
                }

                // 税転換
                if (ExCast.zCInt(_entity._tax_change_id) == (int)Common.geTaxChange.None)
                {
                    errMessage += "税転換が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlTaxChange.txtID;
                    }
                }

                // 金額端数処理
                if (ExCast.zCInt(_entity._price_fraction_proc_id) == 0)
                {
                    errMessage += "金額端数処理が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlPriceFractionProc.txtID;
                    }
                }

                // 税端数処理
                if (ExCast.zCInt(_entity._tax_fraction_proc_id) == 0)
                {
                    errMessage += "税端数処理が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlTaxFractionProc.txtID;
                    }
                }

                // 取引区分が掛売上の場合
                if (ExCast.zCInt(_entity._business_division_id) == 1)
                {
                    // 掛率
                    if (ExCast.zCInt(_entity._credit_rate) == 0)
                    {
                        errMessage += "掛率が入力されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.txtCreditRate;
                        }
                    }

                    // 締区分
                    if (ExCast.zCStr(_entity._summing_up_group_id) == "")
                    {
                        errMessage += "締区分が入力(選択)されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.utlSummingUp.txtID;
                        }
                    }

                    // 出金区分
                    if (ExCast.zCStr(_entity._payment_division_id) == "")
                    {
                        errMessage += "出金区分が入力(選択)されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.utlPaymentDivision.txtID;
                        }
                    }

                    // 支払サイクル
                    if (ExCast.zCInt(_entity._payment_cycle_id) == 0)
                    {
                        errMessage += "支払サイクルが入力(選択)されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.utlPaymentCycle.txtID;
                        }
                    }

                    // 支払日
                    if (ExCast.zCInt(_entity._payment_day) == 0)
                    {
                        errMessage += "支払日が入力されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.txtPaymentDay;
                        }
                    }
                }

                // 入金区分が手形の場合
                if (ExCast.zCStr(_entity._payment_division_id) == "401" || ExCast.zCStr(_entity._payment_division_id) == "402" || ExCast.zCStr(_entity._payment_division_nm).IndexOf("手形") != -1)
                {
                    // 手形サイト
                    if (ExCast.zCInt(_entity._bill_site) == 0)
                    {
                        errMessage += "手形サイトが入力されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.txtBillSite;
                        }
                    }
                }

                #endregion

                #region 適正値入力チェック

                // 郵便番号上記3桁のみはNG
                if (!string.IsNullOrEmpty(_entity._zip_code_from) && string.IsNullOrEmpty(_entity._zip_code_to))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtZipNo1;
                    }
                }

                // 郵便番号下記4桁のみはNG
                if (string.IsNullOrEmpty(_entity._zip_code_from) && !string.IsNullOrEmpty(_entity._zip_code_to))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtZipNo2;
                    }
                }

                // 郵便番号のみはNG
                if ((!string.IsNullOrEmpty(_entity._zip_code_from) && !string.IsNullOrEmpty(_entity._zip_code_to)) && (string.IsNullOrEmpty(_entity._adress1)))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtAdress1;
                    }
                }

                // 敬称
                if (ExCast.zCInt(_entity._title_id) != 0 && string.IsNullOrEmpty(_entity._title_name))
                {
                    errMessage += "敬称が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlTitle.txtID;
                    }
                }

                // 取引区分
                if (ExCast.zCInt(_entity._business_division_id) != 0 && string.IsNullOrEmpty(_entity._business_division_nm))
                {
                    errMessage += "取引区分が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlBusiness.txtID;
                    }
                }

                // 単価種類
                if (ExCast.zCInt(_entity._unit_kind_id) != 0 && string.IsNullOrEmpty(_entity._unit_kind_nm))
                {
                    errMessage += "単価種類が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlUnitKind.txtID;
                    }
                }

                // 税転換
                if (ExCast.zCInt(_entity._tax_change_id) != (int)Common.geTaxChange.None && string.IsNullOrEmpty(_entity._tax_change_nm))
                {
                    errMessage += "税転換が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlTaxChange.txtID;
                    }
                }

                // 締区分
                if (ExCast.zCStr(_entity._summing_up_group_id) != "" && string.IsNullOrEmpty(_entity._summing_up_group_nm))
                {
                    errMessage += "締区分が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlSummingUp.txtID;
                    }
                }

                // 金額端数処理
                if (ExCast.zCInt(_entity._price_fraction_proc_id) != 0 && string.IsNullOrEmpty(_entity._price_fraction_proc_nm))
                {
                    errMessage += "金額端数処理が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlPriceFractionProc.txtID;
                    }
                }

                // 税端数処理
                if (ExCast.zCInt(_entity._tax_fraction_proc_id) != 0 && string.IsNullOrEmpty(_entity._tax_fraction_proc_nm))
                {
                    errMessage += "税端数処理が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlTaxFractionProc.txtID;
                    }
                }

                // 支払区分
                if (ExCast.zCStr(_entity._payment_division_id) != "" && string.IsNullOrEmpty(_entity._payment_division_id))
                {
                    errMessage += "支払区分が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlPaymentDivision.txtID;
                    }
                }

                // 支払サイクル
                if (ExCast.zCInt(_entity._payment_cycle_id) != 0 && string.IsNullOrEmpty(_entity._payment_cycle_nm))
                {
                    errMessage += "支払サイクルが適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlPaymentCycle.txtID;
                    }
                }

                // 得意先分類
                if (ExCast.zCStr(_entity._group1_id) != "" && string.IsNullOrEmpty(_entity._group1_nm))
                {
                    errMessage += "得意先分類が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlGroup1.txtID;
                    }
                }

                // 表示区分
                if (ExCast.zCInt(_entity._display_division_id) > 1 && string.IsNullOrEmpty(_entity._display_division_nm))
                {
                    errMessage += "表示区分が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlDisplay.txtID;
                    }
                }

                #endregion

                #region 日付チェック

                //// 納入指定日
                //if (string.IsNullOrEmpty(_entity.supply_ymd) == false)
                //{
                //    if (ExCast.IsDate(_entity.supply_ymd) == false)
                //    {
                //        errMessage += "納入指定日の形式が不正です。(yyyy/mm/dd形式で入力(選択)して下さい)" + Environment.NewLine;
                //        if (errCtl == null) errCtl = this.datNokiYmd;
                //    }
                //}

                #endregion

                #region 日付変換

                // 受注日
                //if (string.IsNullOrEmpty(_entity.order_ymd) == false)
                //{
                //    _entity.order_ymd = ExCast.zConvertToDate(_entity.order_ymd).ToString("yyyy/MM/dd");

                //}

                #endregion

                #region 数値チェック

                //if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                //{
                //    if (ExCast.IsNumeric(this.utlID.txtID.Text.Trim()) == false)
                //    {
                //        errMessage += "IDには数値を入力して下さい。" + Environment.NewLine;
                //    }
                //}

                #endregion

                #region 正数チェック

                //if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                //{
                //    if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) < 0)
                //    {
                //        errMessage += "IDには正の整数を入力して下さい。" + Environment.NewLine;
                //    }
                //}

                #endregion

                #region 範囲チェック

                //if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) > 9999)
                //{
                //    errMessage += "IDには4桁の正の整数を入力して下さい。" + Environment.NewLine;
                //}

                //if (ExString.LenB(_entity._memo) > 32)
                //{
                //    errMessage += "備考には全角16桁文字以内(半角32桁文字以内)を入力して下さい。" + Environment.NewLine;
                //    if (errCtl == null) errCtl = this.txtMemo;
                //}

                #endregion

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                    //if (ExMessageBox.ResultShow(warnMessage) == MessageBoxResult.No)
                    //{
                    //    flg = false;
                    //}
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                    }
                    return;
                }

                #endregion

                #region 更新処理

                switch (this.utlFunctionKey.gFunctionKeyEnable)
                {
                case Utl_FunctionKey.geFunctionKeyEnable.New:
                case Utl_FunctionKey.geFunctionKeyEnable.Init:
                    UpdateData(Common.geUpdateType.Insert);
                    break;

                case Utl_FunctionKey.geFunctionKeyEnable.Upd:
                    UpdateData(Common.geUpdateType.Update);
                    break;

                default:
                    break;
                }

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
        // 入力チェック(更新時)
        public override void InputCheckUpdate()
        {
            #region Field

            string  errMessage    = "";
            string  warnMessage   = "";
            int     _selectIndex  = 0;
            int     _selectColumn = 0;
            Control errCtl        = null;

            #endregion

            try
            {
                #region 必須チェック

                if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                {
                    // ID
                    if (string.IsNullOrEmpty(this.utlID.txtID.Text.Trim()))
                    {
                        errMessage += "IDが入力されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.utlID.txtID;
                        }
                    }
                }

                // 名称
                if (string.IsNullOrEmpty(_entity._name))
                {
                    errMessage += "名称が入力されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.txtName;
                    }
                }

                // 表示区分
                if (string.IsNullOrEmpty(ExCast.zCStr(_entity._display_division_nm)))
                {
                    errMessage += "表示区分が入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlDisplay.txtID;
                    }
                }

                #endregion

                #region 適正値入力チェック

                // 郵便番号上記3桁のみはNG
                if (!string.IsNullOrEmpty(_entity._zip_code_from) && string.IsNullOrEmpty(_entity._zip_code_to))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtZipNo1;
                    }
                }

                // 郵便番号下記4桁のみはNG
                if (string.IsNullOrEmpty(_entity._zip_code_from) && !string.IsNullOrEmpty(_entity._zip_code_to))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtZipNo2;
                    }
                }

                // 郵便番号のみはNG
                if ((!string.IsNullOrEmpty(_entity._zip_code_from) && !string.IsNullOrEmpty(_entity._zip_code_to)) && (string.IsNullOrEmpty(_entity._adress1)))
                {
                    errMessage += "郵便番号が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlZip.txtAdress1;
                    }
                }

                // 表示区分
                if (ExCast.zCInt(_entity._display_division_id) > 1 && string.IsNullOrEmpty(_entity._display_division_nm))
                {
                    errMessage += "表示区分が適切に入力(選択)されていません。" + Environment.NewLine;
                    if (errCtl == null)
                    {
                        errCtl = this.utlDisplay.txtID;
                    }
                }

                #endregion

                #region 日付チェック

                //// 納入指定日
                //if (string.IsNullOrEmpty(_entity.supply_ymd) == false)
                //{
                //    if (ExCast.IsDate(_entity.supply_ymd) == false)
                //    {
                //        errMessage += "納入指定日の形式が不正です。(yyyy/mm/dd形式で入力(選択)して下さい)" + Environment.NewLine;
                //        if (errCtl == null) errCtl = this.datNokiYmd;
                //    }
                //}

                #endregion

                #region 日付変換

                // 受注日
                //if (string.IsNullOrEmpty(_entity.order_ymd) == false)
                //{
                //    _entity.order_ymd = ExCast.zConvertToDate(_entity.order_ymd).ToString("yyyy/MM/dd");

                //}

                #endregion

                #region 数値チェック

                //if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                //{
                //    if (ExCast.IsNumeric(this.utlID.txtID.Text.Trim()) == false)
                //    {
                //        errMessage += "IDには数値を入力して下さい。" + Environment.NewLine;
                //    }
                //}

                #endregion

                #region 正数チェック

                //if (this.utlMode.Mode != Utl_FunctionKey.geFunctionKeyEnable.Init)
                //{
                //    if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) < 0)
                //    {
                //        errMessage += "IDには正の整数を入力して下さい。" + Environment.NewLine;
                //    }
                //}

                #endregion

                #region 範囲チェック

                //if (ExCast.zCLng(this.utlID.txtID.Text.Trim()) > 9999)
                //{
                //    errMessage += "IDには4桁の正の整数を入力して下さい。" + Environment.NewLine;
                //}

                //if (ExString.LenB(_entity._memo) > 32)
                //{
                //    errMessage += "備考には全角16桁文字以内(半角32桁文字以内)を入力して下さい。" + Environment.NewLine;
                //    if (errCtl == null) errCtl = this.txtMemo;
                //}

                #endregion

                #region 値セット

                if (this.rdoApprovalAri.IsChecked == true)
                {
                    _entity._estimate_approval_flg = 1;
                }
                else
                {
                    _entity._estimate_approval_flg = 0;
                }

                if (this.rdoInvvoicePrintAri.IsChecked == true)
                {
                    _entity._invoice_print_flg = 1;
                }
                else
                {
                    _entity._invoice_print_flg = 0;
                }

                #endregion

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }

                if (!string.IsNullOrEmpty(warnMessage))
                {
                    warnMessage += "このまま登録を続行してもよろしいですか?" + Environment.NewLine;
                    ExMessageBox.ResultShow(this, errCtl, warnMessage);
                    flg = false;
                    //if (ExMessageBox.ResultShow(warnMessage) == MessageBoxResult.No)
                    //{
                    //    flg = false;
                    //}
                }

                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                    }
                    return;
                }

                #endregion

                #region 更新処理

                switch (this.utlFunctionKey.gFunctionKeyEnable)
                {
                case Utl_FunctionKey.geFunctionKeyEnable.New:
                case Utl_FunctionKey.geFunctionKeyEnable.Init:
                    UpdateData(Common.geUpdateType.Insert);
                    break;

                case Utl_FunctionKey.geFunctionKeyEnable.Upd:
                    UpdateData(Common.geUpdateType.Update);
                    break;

                default:
                    break;
                }

                #endregion
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }
        // 入力チェック
        public override void InputCheckUpdate()
        {
            string  errMessage = "";
            Control errCtl     = null;

            try
            {
                switch (this.ProcKbn)
                {
                case eProcKbn.Search:
                case eProcKbn.Report:

                    #region 検索時チェック

                    #region 必須チェック

                    // 対象年月
                    if (string.IsNullOrEmpty(this.datYm.Text.Trim()))
                    {
                        errMessage += "対象年月を入力(選択)して下さい" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.datYm;
                        }
                    }

                    #endregion

                    #region 入力チェック

                    // 請求先
                    if (this.utlInvoice_F.txtID.Text.Trim() != "" && string.IsNullOrEmpty(this.utlInvoice_F.txtNm.Text.Trim()))
                    {
                        errMessage += "請求先が適切に入力(選択)されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.utlInvoice_F.txtID;
                        }
                    }
                    if (this.utlInvoice_T.txtID.Text.Trim() != "" && string.IsNullOrEmpty(this.utlInvoice_T.txtNm.Text.Trim()))
                    {
                        errMessage += "請求先が適切に入力(選択)されていません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.utlInvoice_T.txtID;
                        }
                    }

                    #endregion

                    #region 範囲チェック

                    // 請求先
                    if ((ExCast.IsNumeric(this.utlInvoice_F.txtID.Text.Trim()) && ExCast.IsNumeric(this.utlInvoice_T.txtID.Text.Trim())) &&
                        (!string.IsNullOrEmpty(this.utlInvoice_F.txtID.Text.Trim()) && !string.IsNullOrEmpty(this.utlInvoice_T.txtID.Text.Trim())))
                    {
                        if (ExCast.zCLng(this.utlInvoice_F.txtID.Text.Trim()) > ExCast.zCLng(this.utlInvoice_T.txtID.Text.Trim()))
                        {
                            errMessage += "請求先の範囲指定が不正です。" + Environment.NewLine;
                            if (errCtl == null)
                            {
                                errCtl = this.utlInvoice_F.txtID;
                            }
                        }
                    }

                    #endregion

                    #region 日付チェック

                    // 対象年月
                    if (string.IsNullOrEmpty(this.datYm.Text.Trim()) == false)
                    {
                        if (ExCast.IsDateYm(this.datYm.Text.Trim()) == false)
                        {
                            errMessage += "対象年月の形式が不正です。(yyyy/mm形式で入力(選択)して下さい)" + Environment.NewLine;
                            if (errCtl == null)
                            {
                                errCtl = this.datYm;
                            }
                        }
                    }

                    #endregion

                    #endregion

                    break;

                case eProcKbn.Update:

                    #region 更新チェック

                    #region 必須チェック

                    //if (this.datIssueYmd.SelectedDate == null)
                    //{
                    //    errMessage += "出力発行日が入力されていません。" + Environment.NewLine;
                    //    if (errCtl == null) errCtl = this.datIssueYmd;
                    //}

                    #endregion

                    #region 選択チェック

                    if (this.entityList == null)
                    {
                        errMessage += "表示データがありません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.datYm;
                        }
                    }
                    if (this.entityList.Count == 0)
                    {
                        errMessage += "表示データがありません。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.datYm;
                        }
                    }

                    bool _exec_flg = false;
                    for (int i = 0; i <= this.entityList.Count - 1; i++)
                    {
                        if (this.entityList[i]._exec_flg == true)
                        {
                            _exec_flg = true;
                        }
                    }
                    if (_exec_flg == false)
                    {
                        errMessage += "登録対象データを選択して下さい。" + Environment.NewLine;
                        if (errCtl == null)
                        {
                            errCtl = this.datYm;
                        }
                    }

                    #endregion

                    #endregion

                    break;
                }

                #region エラー or 警告時処理

                bool flg = true;

                if (!string.IsNullOrEmpty(errMessage))
                {
                    ExMessageBox.Show(errMessage, Dlg.MessageBox.MessageBoxIcon.Error);
                    flg = false;
                }
                this.txtDummy.IsTabStop = false;

                if (flg == false)
                {
                    if (errCtl != null)
                    {
                        ExBackgroundWorker.DoWork_Focus(errCtl, 10);
                    }
                    return;
                }

                #endregion

                if (this.utlReport.rptKbn == DataReport.geReportKbn.None)
                {
                    GetListData();
                }
                else
                {
                    if (this.ProcKbn == eProcKbn.Update)
                    {
                        ExMessageBox.ResultShow(this, null, "処理対象となる請求先のすべての請求データの残高が更新されます。" + Environment.NewLine + "このまま登録を続行してもよろしいですか?");
                        return;
                    }

                    this.utlReport.utlParentFKey = this.utlFKey;

                    switch (Common.gWinGroupType)
                    {
                    case Common.geWinGroupType.InpListReport:
                        this.utlReport.pgId = DataPgEvidence.PGName.SalesManagement.InvoiceBalancePrint;
                        break;

                    default:
                        break;
                    }

                    this.utlReport.sqlWhere   = GetSQLWhere();
                    this.utlReport.sqlOrderBy = GetSQLOrderBy();
                    this.utlReport.ReportStart();
                }
            }
            finally
            {
                Common.gblnBtnProcLock          = false;
                Common.gblnBtnDesynchronizeLock = false;
            }
        }