PNP_PIbd-31_Rodionov_I_A_Co.../models/department.cpp
2024-12-24 18:13:22 +04:00

32 lines
468 B
C++

#include "department.h"
Department::Department()
{}
Department::~Department()
{}
QString Department::name() const
{
return _name;
}
void Department::setName(const QString &newName)
{
_name = newName;
}
void Department::fromJson(const QJsonObject &json)
{
setId(json["id"].toInt());
setName(json["name"].toString());
}
QJsonObject Department::toJson() const
{
QJsonObject obj;
obj["id"] = id();
obj["name"] = name();
return obj;
}