73 lines
2.1 KiB
Dart
73 lines
2.1 KiB
Dart
const String Service_tableName = 'services';
|
|
const String Service_columnId = 'id';
|
|
const String Service_columnArticul = 'articul';
|
|
const String Service_columnName = 'name';
|
|
const String Service_columnPrice = 'price';
|
|
const String Service_columnCategoryId = 'category_id';
|
|
const String Service_columnEan = 'ean';
|
|
const String Service_columnAppCompanyId = 'app_company_id';
|
|
|
|
const String Service_columnDescription = 'description';
|
|
const String Service_columnShowPrice = 'show_price';
|
|
const String Service_columnOkei = 'okei';
|
|
const String Service_columnDiscount = 'discount';
|
|
|
|
|
|
class Service {
|
|
int id;
|
|
int articul;
|
|
String name;
|
|
double price;
|
|
String ean;
|
|
int appCompanyId;
|
|
String description;
|
|
double showPrice;
|
|
String okei;
|
|
double discount;
|
|
|
|
Map<String, dynamic> toMap() {
|
|
var map = <String, dynamic>{
|
|
Service_columnArticul: articul,
|
|
Service_columnName: name,
|
|
Service_columnPrice: price,
|
|
Service_columnAppCompanyId: appCompanyId,
|
|
Service_columnDescription: description,
|
|
Service_columnShowPrice: showPrice,
|
|
Service_columnOkei: okei,
|
|
Service_columnDiscount: discount
|
|
};
|
|
if (id != null) {
|
|
map[Service_columnId] = id;
|
|
}
|
|
return map;
|
|
}
|
|
|
|
Service();
|
|
|
|
Service.fromMap(Map<String, dynamic> map) {
|
|
id = map[Service_columnId];
|
|
articul = map[Service_columnArticul];
|
|
name = map[Service_columnName];
|
|
price = map[Service_columnPrice]?.toDouble();
|
|
appCompanyId = map[Service_columnAppCompanyId];
|
|
description = map[Service_columnDescription];
|
|
showPrice = map[Service_columnShowPrice]?.toDouble();
|
|
okei = map[Service_columnOkei];
|
|
discount = map[Service_columnDiscount]?.toDouble();
|
|
}
|
|
|
|
Service.fromJson(Map<String, dynamic> map) {
|
|
id = map[Service_columnId];
|
|
articul = map[Service_columnArticul];
|
|
name = map[Service_columnName];
|
|
price = map[Service_columnPrice]?.toDouble();
|
|
appCompanyId = map[Service_columnAppCompanyId];
|
|
description = map[Service_columnDescription];
|
|
showPrice = map[Service_columnShowPrice]?.toDouble();
|
|
okei = map[Service_columnOkei];
|
|
discount = map[Service_columnDiscount]?.toDouble();
|
|
}
|
|
|
|
}
|
|
|