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


C++ Section::GetBuilding方法代码示例

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


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

示例1: AddSection

// administrator adds a section
bool Administrator::AddSection(const Section &s) const
{
    /*insert a record into the section table*/

    QSqlQuery query;
    query.prepare("insert into Section (courseID, secID, semester, year, capacity, vacancy, building, roomNo, timeSlotID) values (?, ?, ? ,?, ?, ?, ?, ?, ?)");
    query.addBindValue(s.GetCourseID());
    query.addBindValue(s.GetSecID());
    query.addBindValue(s.GetSemester().data());
    query.addBindValue(s.GetYear());
    query.addBindValue(s.GetCapacity());
    query.addBindValue(s.GetVacancy());
    query.addBindValue(s.GetBuilding().data());
    query.addBindValue(s.GetRoomNo());
    query.addBindValue(s.GetTimeSlotID());

    if(!query.exec())
        return false;

    return true;
}
开发者ID:buguake,项目名称:cms,代码行数:22,代码来源:administrator.cpp

示例2: RemoveSection

// administrator removes a section
bool Administrator::RemoveSection(const Section &s) const
{
    /*delete a record from the section table*/

    QString str;
    str = "delete from Section where courseID = ";
    str += QString::number(s.GetCourseID());
    str += " and secID = ";
    str += QString::number(s.GetSecID());
    str += " and semester = '";
    str += s.GetSemester().data();
    str += "' and year = ";
    str += QString::number(s.GetYear());
    str += " and building = '";
    str += s.GetBuilding().data();
    str += "'";

    QSqlQuery query;
    if(!query.exec(str))
       return false;

    return true;
}
开发者ID:buguake,项目名称:cms,代码行数:24,代码来源:administrator.cpp

示例3: UpdateSection

bool Administrator::UpdateSection(const Section &s) const
{
    /*update the section's capacity*/

    QString str;
    str = "update Section set capacity = ";
    str += QString::number(s.GetCapacity());
    str += " where courseID = ";
    str += QString::number(s.GetCourseID());
    str += " and secID = ";
    str += QString::number(s.GetSecID());
    str += " and semester = '";
    str += s.GetSemester().data();
    str += "' and year = ";
    str += QString::number(s.GetYear());

    QSqlQuery query;
    if(!query.exec(str))
        return false;

    /*update the section's building*/

    str = "update Section set building = '";
    str += s.GetBuilding().data();
    str += "' where courseID = ";
    str += QString::number(s.GetCourseID());
    str += " and secID = ";
    str += QString::number(s.GetSecID());
    str += " and semester = '";
    str += s.GetSemester().data();
    str += "' and year = ";
    str += QString::number(s.GetYear());

    if(!query.exec(str))
        return false;

    /*update the section's roomNo*/

    str = "update Section set roomNo = ";
    str += QString::number(s.GetRoomNo());
    str += " where courseID = ";
    str += QString::number(s.GetCourseID());
    str += " and secID = ";
    str += QString::number(s.GetSecID());
    str += " and semester = '";
    str += s.GetSemester().data();
    str += "' and year = ";
    str += QString::number(s.GetYear());
    if(!query.exec(str))
        return false;

    /*update the section's timeSlotID*/

    str = "update Section set timeSlotID = ";
    str += QString::number(s.GetTimeSlotID());
    str += " where courseID = ";
    str += QString::number(s.GetCourseID());
    str += " and secID = ";
    str += QString::number(s.GetSecID());
    str += " and semester = '";
    str += s.GetSemester().data();
    str += "' and year = ";
    str += QString::number(s.GetYear());

    if(!query.exec(str))
        return false;

    return true;
}
开发者ID:buguake,项目名称:cms,代码行数:69,代码来源:administrator.cpp


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