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