本文整理汇总了C++中Procedure::GetProcedureId方法的典型用法代码示例。如果您正苦于以下问题:C++ Procedure::GetProcedureId方法的具体用法?C++ Procedure::GetProcedureId怎么用?C++ Procedure::GetProcedureId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Procedure
的用法示例。
在下文中一共展示了Procedure::GetProcedureId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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);
}
示例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());
}
}