コード例 #1
0
        public void _createStatus(Account nAccount, StatusCreateS nStatusCreateS, StatusCreateC nStatusCreateC)
        {
            AccountMgr   accountMgr_      = nAccount._getAccountMgr();
            uint         statusServiceId_ = StatusService._classId();
            StatusOption statusOption_    = accountMgr_._getProperty <StatusOption>(statusServiceId_);
            uint         tableId_         = statusOption_._getTableId();
            uint         accountMgrId_    = accountMgr_._getId();
            SqlCommand   sqlCommand_      = new SqlCommand();

            if (statusOption_._createTable())
            {
                tableId_ = statusOption_._generateTableId();
                StatusTableCreateB statusTableCreateB_ = new StatusTableCreateB(tableId_, accountMgrId_);
                sqlCommand_._addHeadstream(statusTableCreateB_);
            }
            StatusCreateB statusCreateB_ = new StatusCreateB(nAccount, tableId_, accountMgrId_, nStatusCreateS);

            sqlCommand_._addHeadstream(statusCreateB_);
            SqlService sqlService_ = __singleton <SqlService> ._instance();

            if (sqlService_._runSqlCommand(sqlCommand_))
            {
                long statusId_ = statusCreateB_._statusId();
                mTicks = statusCreateB_._getTicks();
                nStatusCreateC.m_tErrorCode = StatusError_.mSucess_;
                nStatusCreateC.m_tStatusId  = statusId_;
                nStatusCreateC.m_tTicks     = mTicks;
                mStatusIds.Add(new StatusId(tableId_, statusId_, mTicks));
            }
            else
            {
                nStatusCreateC.m_tErrorCode = StatusError_.mSql_;
            }
        }
コード例 #2
0
        public StatusCreateC _createStatus(StatusCreateS nStatusCreateS)
        {
            StatusCreateC result_ = new StatusCreateC();

            result_.m_tId = nStatusCreateS.m_tId;
            AccountService accountService_ = __singleton <AccountService> ._instance();

            Account account_ = accountService_._getAccount(nStatusCreateS.m_tAccount);

            if (null != account_)
            {
                uint propertyId_ = PropertyId <StatusMgr> ._classId();

                StatusMgr statusMgr_ = account_._getProperty <StatusMgr>(propertyId_);
                statusMgr_._createStatus(account_, nStatusCreateS, result_);
            }
            else
            {
                result_.m_tErrorCode = StatusError_.mAccount_;
            }
            return(result_);
        }