Ejemplo n.º 1
0
        /// <summary>
        /// データベース更新要求処理
        /// </summary>
        public void UpdateDbProc()
        {
            switch (this._updateDbNotifyCtrl.notifyStatus)
            {
            case UpdateDbNotifyCtrl.eStatus.Init:
                // 初期処理
                this._updateDbNotifyCtrl.notifyStatus = UpdateDbNotifyCtrl.eStatus.SendUpdateDb;
                break;

            case UpdateDbNotifyCtrl.eStatus.SendUpdateDb:
                // データベース更新要求
                this._updateDbNotifyCtrl.updateDbMsg                = new CellMonTabMsgGetUpdateDb();
                this._updateDbNotifyCtrl.updateDbMsg.layDataPath    = this._updateDbNotifyCtrl.layDataPath;
                this._updateDbNotifyCtrl.updateDbMsg.masterDataPath = this._updateDbNotifyCtrl.masterDataPath;

                Console.WriteLine("データベース更新要求送信");
                // データベース更新要求メッセージ送信
                if (true == this._cellMonTabMsgCtrl.SendMessage(this._updateDbNotifyCtrl.updateDbMsg))
                {
                    this._updateDbNotifyCtrl.notifyStatus = UpdateDbNotifyCtrl.eStatus.WaitResponse;
                }
                break;

            case UpdateDbNotifyCtrl.eStatus.WaitResponse:
                // データベース更新要求答待ち
                if (this._updateDbNotifyCtrl.updateDbMsg.SendStatus == CellMonTabMessage.eSendStatus.SendNg)
                {
                    // 送信失敗
                    this._updateDbNotifyCtrl.updateDbMsg  = null;
                    this._updateDbNotifyCtrl.notifyStatus = UpdateDbNotifyCtrl.eStatus.Error;
                }
                else if (this._updateDbNotifyCtrl.ResError != CellMonTabMsgError.eCmdError.None)
                {
                    // 異常応答
                    this._updateDbNotifyCtrl.updateDbMsg  = null;
                    this._updateDbNotifyCtrl.notifyStatus = UpdateDbNotifyCtrl.eStatus.Error;
                }
                else if (this._updateDbNotifyCtrl.updateDbMsg.SendStatus == CellMonTabMessage.eSendStatus.RecvRes)
                {
                    // 応答受信
                    this._updateDbNotifyCtrl.updateDbMsg  = null;
                    this._updateDbNotifyCtrl.notifyStatus = UpdateDbNotifyCtrl.eStatus.Complete;
                }
                break;

            case UpdateDbNotifyCtrl.eStatus.Complete:
                // データベース更新要求完了
                this._updateDbNotifyCtrl = null;
                break;

            case UpdateDbNotifyCtrl.eStatus.Error:
                // データベース更新要求異常
                this._updateDbNotifyCtrl = null;
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// データベース更新要求
        /// </summary>
        /// <param name="layDataPath"></param>
        /// <param name="masterDataPath"></param>
        /// <returns></returns>
        public bool ReqUpdateDb(string layDataPath, string masterDataPath)
        {
            bool ret = false;

            if (this._updateDbNotifyCtrl == null)
            {
                this._updateDbNotifyCtrl                = new UpdateDbNotifyCtrl();
                this._updateDbNotifyCtrl.layDataPath    = layDataPath;
                this._updateDbNotifyCtrl.masterDataPath = masterDataPath;

                ret = true;
            }

            return(ret);
        }