room model & gas refill request number added.

main_design2.0
Sikander Saleem 2 years ago
parent 2932796068
commit 4d0b18b5a8

@ -16,7 +16,7 @@ class AssetTransfer {
this.destBuildingId, this.destBuildingId,
this.destFloorId, this.destFloorId,
this.destDepartmentId, this.destDepartmentId,
this.destRoom, this.destRoomId,
this.senderSiteId, this.senderSiteId,
this.senderBuildingId, this.senderBuildingId,
this.senderFloorId, this.senderFloorId,
@ -80,7 +80,7 @@ class AssetTransfer {
destBuildingId = json['destBuildingId']; destBuildingId = json['destBuildingId'];
destFloorId = json['destFloorId']; destFloorId = json['destFloorId'];
destDepartmentId = json['destDepartmentId']; destDepartmentId = json['destDepartmentId'];
destRoom = json['destRoom']; destRoomId = json['destRoomId'];
senderSiteId = json['senderSiteId']; senderSiteId = json['senderSiteId'];
senderBuildingId = json['senderBuildingId']; senderBuildingId = json['senderBuildingId'];
senderFloorId = json['senderFloorId']; senderFloorId = json['senderFloorId'];
@ -172,7 +172,7 @@ class AssetTransfer {
num destBuildingId; num destBuildingId;
num destFloorId; num destFloorId;
num destDepartmentId; num destDepartmentId;
num destRoom; num destRoomId;
num senderSiteId; num senderSiteId;
num senderBuildingId; num senderBuildingId;
num senderFloorId; num senderFloorId;
@ -228,7 +228,7 @@ class AssetTransfer {
num destBuildingId, num destBuildingId,
num destFloorId, num destFloorId,
num destDepartmentId, num destDepartmentId,
String destRoom, String destRoomId,
num senderSiteId, num senderSiteId,
num senderBuildingId, num senderBuildingId,
num senderFloorId, num senderFloorId,
@ -292,7 +292,7 @@ class AssetTransfer {
destBuildingId: destBuildingId ?? this.destBuildingId, destBuildingId: destBuildingId ?? this.destBuildingId,
destFloorId: destFloorId ?? this.destFloorId, destFloorId: destFloorId ?? this.destFloorId,
destDepartmentId: destDepartmentId ?? this.destDepartmentId, destDepartmentId: destDepartmentId ?? this.destDepartmentId,
destRoom: destRoom ?? this.destRoom, destRoomId: destRoomId ?? this.destRoomId,
senderSiteId: senderSiteId ?? this.senderSiteId, senderSiteId: senderSiteId ?? this.senderSiteId,
senderBuildingId: senderBuildingId ?? this.senderBuildingId, senderBuildingId: senderBuildingId ?? this.senderBuildingId,
senderFloorId: senderFloorId ?? this.senderFloorId, senderFloorId: senderFloorId ?? this.senderFloorId,
@ -356,7 +356,7 @@ class AssetTransfer {
map['destBuildingId'] = destBuildingId; map['destBuildingId'] = destBuildingId;
map['destFloorId'] = destFloorId; map['destFloorId'] = destFloorId;
map['destDepartmentId'] = destDepartmentId; map['destDepartmentId'] = destDepartmentId;
map['destRoom'] = destRoom; map['destRoomId'] = destRoomId;
map['senderSiteId'] = senderSiteId; map['senderSiteId'] = senderSiteId;
map['senderBuildingId'] = senderBuildingId; map['senderBuildingId'] = senderBuildingId;
map['senderFloorId'] = senderFloorId; map['senderFloorId'] = senderFloorId;
@ -424,7 +424,7 @@ class AssetTransfer {
map['destBuildingId'] = destBuildingId; map['destBuildingId'] = destBuildingId;
map['destFloorId'] = destFloorId; map['destFloorId'] = destFloorId;
map['destDepartmentId'] = destDepartmentId; map['destDepartmentId'] = destDepartmentId;
map['destRoom'] = destRoom; map['destRoomId'] = destRoomId;
map['senderSiteId'] = asset?.site?.id; map['senderSiteId'] = asset?.site?.id;
map['senderBuildingId'] = asset?.building?.id; map['senderBuildingId'] = asset?.building?.id;
map['senderFloorId'] = asset?.floor?.id; map['senderFloorId'] = asset?.floor?.id;
@ -466,7 +466,7 @@ class AssetTransfer {
destBuildingId = assetTransfer.destBuildingId; destBuildingId = assetTransfer.destBuildingId;
destFloorId = assetTransfer.destFloorId; destFloorId = assetTransfer.destFloorId;
destDepartmentId = assetTransfer.destDepartmentId; destDepartmentId = assetTransfer.destDepartmentId;
destRoom = assetTransfer.destRoom; destRoomId = assetTransfer.destRoomId;
senderSiteId = assetTransfer.senderSiteId; senderSiteId = assetTransfer.senderSiteId;
senderBuildingId = assetTransfer.senderBuildingId; senderBuildingId = assetTransfer.senderBuildingId;
senderFloorId = assetTransfer.senderFloorId; senderFloorId = assetTransfer.senderFloorId;

@ -18,7 +18,7 @@ class AssetTransferSearch extends AssetTransfer {
map['destBuildingId'] = destBuildingId; map['destBuildingId'] = destBuildingId;
map['destFloorId'] = destFloorId; map['destFloorId'] = destFloorId;
map['destDepartmentId'] = destDepartmentId; map['destDepartmentId'] = destDepartmentId;
map['destRoom'] = destRoom; map['destRoomId'] = destRoomId;
map['senderSiteId'] = senderSiteId; map['senderSiteId'] = senderSiteId;
map['senderBuildingId'] = senderBuildingId; map['senderBuildingId'] = senderBuildingId;
map['senderFloorId'] = senderFloorId; map['senderFloorId'] = senderFloorId;

@ -2,25 +2,47 @@ import 'package:test_sa/models/base.dart';
class Rooms extends Base { class Rooms extends Base {
int id; int id;
int departmentId; String name;
int clientRoomId; int value;
String roomName;
Rooms({this.id, this.departmentId, this.clientRoomId, this.roomName}); Rooms({this.id, this.name, this.value});
Rooms.fromJson(Map<String, dynamic> json) { Rooms.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
departmentId = json['departmentId']; name = json['name'];
clientRoomId = json['clientRoomId']; value = json['value'];
roomName = json['roomName'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id; data['id'] = this.id;
data['departmentId'] = this.departmentId; data['name'] = this.name;
data['clientRoomId'] = this.clientRoomId; data['value'] = this.value;
data['roomName'] = this.roomName;
return data; return data;
} }
} }
//
// class Rooms extends Base {
// int id;
// int departmentId;
// int clientRoomId;
// String roomName;
//
// Rooms({this.id, this.departmentId, this.clientRoomId, this.roomName});
//
// Rooms.fromJson(Map<String, dynamic> json) {
// id = json['id'];
// departmentId = json['departmentId'];
// clientRoomId = json['clientRoomId'];
// roomName = json['roomName'];
// }
//
// Map<String, dynamic> toJson() {
// final Map<String, dynamic> data = new Map<String, dynamic>();
// data['id'] = this.id;
// data['departmentId'] = this.departmentId;
// data['clientRoomId'] = this.clientRoomId;
// data['roomName'] = this.roomName;
// return data;
// }
// }

@ -56,7 +56,7 @@ class _RequestDeviceTransferState extends State<RequestDeviceTransfer> {
_transferModel.destBuildingId = _assetDestination.building?.id; _transferModel.destBuildingId = _assetDestination.building?.id;
_transferModel.destFloorId = _assetDestination.floor?.id; _transferModel.destFloorId = _assetDestination.floor?.id;
_transferModel.destDepartmentId = _assetDestination.department?.id; _transferModel.destDepartmentId = _assetDestination.department?.id;
_transferModel.destRoom = _assetDestination.room?.clientRoomId; _transferModel.destRoomId = _assetDestination.room?.id;
if (!_formKey.currentState.validate() || !(await _transferModel.validate(context))) { if (!_formKey.currentState.validate() || !(await _transferModel.validate(context))) {
return; return;
} }
@ -158,6 +158,8 @@ class _RequestDeviceTransferState extends State<RequestDeviceTransfer> {
staticData: _assetDestination?.floor?.departments ?? [], staticData: _assetDestination?.floor?.departments ?? [],
onSelect: (value) { onSelect: (value) {
_assetDestination?.department = value; _assetDestination?.department = value;
_assetDestination?.room = null;
setState(() {});
}, },
), ),
8.height, 8.height,
@ -169,7 +171,7 @@ class _RequestDeviceTransferState extends State<RequestDeviceTransfer> {
staticData: _assetDestination?.department?.rooms ?? [], staticData: _assetDestination?.department?.rooms ?? [],
onSelect: (value) { onSelect: (value) {
_assetDestination?.room = value; _assetDestination?.room = value;
_transferModel.destRoom = value.clientRoomId; setState(() {});
}, },
), ),
8.height, 8.height,

@ -107,6 +107,7 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
8.height, 8.height,
context.translation.gasRefillRequest.heading5(context), context.translation.gasRefillRequest.heading5(context),
8.height, 8.height,
'${context.translation.requestNo}: ${gasRefillModel.gazRefillNo}'.bodyText(context),
'${context.translation.gasRequest}: ${gasRefillModel.gazRefillDetails[0].gasType?.name}'.bodyText(context), '${context.translation.gasRequest}: ${gasRefillModel.gazRefillDetails[0].gasType?.name}'.bodyText(context),
'${context.translation.cylinderSize}: ${gasRefillModel.gazRefillDetails[0].cylinderSize?.name}'.bodyText(context), '${context.translation.cylinderSize}: ${gasRefillModel.gazRefillDetails[0].cylinderSize?.name}'.bodyText(context),
'${context.translation.site}: ${gasRefillModel.site?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.bodyText(context), '${context.translation.site}: ${gasRefillModel.site?.name?.cleanupWhitespace?.capitalizeFirstOfEach}'.bodyText(context),

Loading…
Cancel
Save