当前位置: 首页>>代码示例>>C++>>正文


C++ Procedure::GetProjectProcedureId方法代码示例

本文整理汇总了C++中Procedure::GetProjectProcedureId方法的典型用法代码示例。如果您正苦于以下问题:C++ Procedure::GetProjectProcedureId方法的具体用法?C++ Procedure::GetProjectProcedureId怎么用?C++ Procedure::GetProjectProcedureId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Procedure的用法示例。


在下文中一共展示了Procedure::GetProjectProcedureId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RemoveProcedure

bool ProcedureController::RemoveProcedure(const ProcedureCacheKey &id, const Procedure &procedure)
{
    if(procedure.IsTemplateProcedure() && !procedure.IsPureTemplateProcedure())
    {
        qint32 procedureId = procedure.GetProcedureId();

        if(m_proceduresFromTemplate.count(procedureId) != 0)
        {
            std::set<qint32> &procedureSet = m_proceduresFromTemplate.at(procedureId);
            procedureSet.erase(procedure.GetProjectProcedureId());

            if(procedureSet.size() == 0)
            {
                m_proceduresFromTemplate.erase(procedureId);
                // procedureSet is now invalid.
            }
        }
        //else
        //{
        //  // Should never happen.
        //}
    }

    return m_cache.Remove(id);
}
开发者ID:mrtryhard,项目名称:plm2014,代码行数:25,代码来源:procedurecontroller.cpp

示例2: UpdateProcedure

bool ProcedureController::UpdateProcedure(const Procedure &procedure)
{
    QSqlQuery procedureUpdate = GetDb().CreateQuery();
    procedureUpdate.prepare("UPDATE \"Procedure\" "
        "SET \"Description\"=:description "
        "WHERE \"ProcedureId\"=:procedureId;");
    procedureUpdate.bindValue(":procedureId", procedure.GetProcedureId());
    procedureUpdate.bindValue(":description", procedure.GetDescription());
    if(!procedureUpdate.exec())
    {
        return false;
    }

    if(!procedure.IsTemplateProcedure())
    {
        QSqlQuery projectProcedureUpdate = GetDb().CreateQuery();
        projectProcedureUpdate.prepare("UPDATE \"ProjectProcedure\" "
            "SET \"IsDone\"=:isDone "
            "WHERE \"ProjectProcedureId\"=:projectProcedureId;");
        projectProcedureUpdate.bindValue(":projectProcedureId", procedure.GetProjectProcedureId());
        projectProcedureUpdate.bindValue(":isDone", procedure.GetDoneState() ? 1 : 0);
        if(!projectProcedureUpdate.exec())
        {
            return false;
        }

        emit sigProcedureModified(procedure);
    }

    // Update linked project procedures from template.
    if(procedure.IsPureTemplateProcedure())
    {
        qint32 templateProcedureId = procedure.GetProcedureId();
        if(m_proceduresFromTemplate.count(templateProcedureId) != 0)
        {
            std::set<qint32> &procedureSet = m_proceduresFromTemplate.at(templateProcedureId);

            for(auto it = procedureSet.begin(); it != procedureSet.end(); it++)
            {
                qint32 projectProcedureId = *it;
                ProcedureCacheKey key(ProcedureType::PT_PROJECT, projectProcedureId);

                std::shared_ptr<Procedure> projectProcedure = m_cache.Lookup(key);
                if(!projectProcedure)
                {
                    continue;
                }

                projectProcedure->SetDescription(procedure.GetDescription());
                emit sigProcedureModified(*projectProcedure);
            }
        }

        emit sigProcedureModified(procedure);
    }

    return true;
}
开发者ID:mrtryhard,项目名称:plm2014,代码行数:58,代码来源:procedurecontroller.cpp

示例3: GetCacheKey

ProcedureController::ProcedureCacheKey ProcedureController::GetCacheKey(const Procedure &procedure)
{
    if(!procedure.IsPureTemplateProcedure())
    {
        return ProcedureCacheKey(ProcedureType::PT_PROJECT, procedure.GetProjectProcedureId());
    }
    else
    {
        return ProcedureCacheKey(ProcedureType::PT_PROJECT_TYPE, procedure.GetProcedureId());
    }
}
开发者ID:mrtryhard,项目名称:plm2014,代码行数:11,代码来源:procedurecontroller.cpp


注:本文中的Procedure::GetProjectProcedureId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。