Add delivery point entity
This commit is contained in:
parent
ecd5d3ae4e
commit
b1333c74a5
3 changed files with 48 additions and 0 deletions
21
entities/dpoint_entity.cpp
Normal file
21
entities/dpoint_entity.cpp
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#include "dpoint_entity.h"
|
||||||
|
|
||||||
|
dpoint_entity::dpoint_entity(const QString &title) : _title(title) {
|
||||||
|
this->_id = 0;
|
||||||
|
auto hash = QCryptographicHash::hash(title.toLocal8Bit(), QCryptographicHash::Md5);
|
||||||
|
for (auto bit : hash) {
|
||||||
|
this->_id += bit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long long dpoint_entity::id() {
|
||||||
|
return this->_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString dpoint_entity::title() {
|
||||||
|
return this->_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QVector<unsigned long long> dpoint_entity::storages_ids() {
|
||||||
|
return this->_storages_ids;
|
||||||
|
}
|
||||||
25
entities/dpoint_entity.h
Normal file
25
entities/dpoint_entity.h
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef DPOINT_ENTITY_H
|
||||||
|
#define DPOINT_ENTITY_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QVector>
|
||||||
|
#include <QCryptographicHash>
|
||||||
|
|
||||||
|
|
||||||
|
class dpoint_entity
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
unsigned long long _id;
|
||||||
|
QString _title;
|
||||||
|
QVector<unsigned long long> _storages_ids;
|
||||||
|
|
||||||
|
public:
|
||||||
|
dpoint_entity() = default;
|
||||||
|
dpoint_entity(const QString &title);
|
||||||
|
|
||||||
|
unsigned long long id();
|
||||||
|
QString title();
|
||||||
|
const QVector<unsigned long long> storages_ids();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DPOINT_ENTITY_H
|
||||||
|
|
@ -13,6 +13,7 @@ SOURCES += \
|
||||||
cargoeditdialog.cpp \
|
cargoeditdialog.cpp \
|
||||||
deliverypointeditdialog.cpp \
|
deliverypointeditdialog.cpp \
|
||||||
entities/cargo_entity.cpp \
|
entities/cargo_entity.cpp \
|
||||||
|
entities/dpoint_entity.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
storageeditdialog.cpp \
|
storageeditdialog.cpp \
|
||||||
usereditdialog.cpp \
|
usereditdialog.cpp \
|
||||||
|
|
@ -23,6 +24,7 @@ HEADERS += \
|
||||||
cargoeditdialog.h \
|
cargoeditdialog.h \
|
||||||
deliverypointeditdialog.h \
|
deliverypointeditdialog.h \
|
||||||
entities/cargo_entity.h \
|
entities/cargo_entity.h \
|
||||||
|
entities/dpoint_entity.h \
|
||||||
storageeditdialog.h \
|
storageeditdialog.h \
|
||||||
usereditdialog.h \
|
usereditdialog.h \
|
||||||
vesseleditdialog.h
|
vesseleditdialog.h
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue