edit card_position.dart
parent
a41dd736c4
commit
368db03ab8
@ -0,0 +1,79 @@
|
|||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
class PatientER_RRT_GetAllTransportationMethodListModel {
|
||||||
|
int id;
|
||||||
|
DateTime createDate;
|
||||||
|
DateTime lastEditDate;
|
||||||
|
int createdBy;
|
||||||
|
int lastEditBy;
|
||||||
|
bool isActive;
|
||||||
|
String title;
|
||||||
|
String titleAR;
|
||||||
|
int price;
|
||||||
|
Null isDefault;
|
||||||
|
int visibility;
|
||||||
|
Null durationId;
|
||||||
|
String description;
|
||||||
|
String descriptionAR;
|
||||||
|
int totalPrice;
|
||||||
|
int vAT;
|
||||||
|
|
||||||
|
PatientER_RRT_GetAllTransportationMethodListModel(
|
||||||
|
{
|
||||||
|
this.id,
|
||||||
|
this.createDate,
|
||||||
|
this.lastEditDate,
|
||||||
|
this.createdBy,
|
||||||
|
this.lastEditBy,
|
||||||
|
this.isActive,
|
||||||
|
this.title,
|
||||||
|
this.titleAR,
|
||||||
|
this.price,
|
||||||
|
this.isDefault,
|
||||||
|
this.visibility,
|
||||||
|
this.durationId,
|
||||||
|
this.description,
|
||||||
|
this.descriptionAR,
|
||||||
|
this.totalPrice,
|
||||||
|
this.vAT});
|
||||||
|
|
||||||
|
PatientER_RRT_GetAllTransportationMethodListModel.fromJson(
|
||||||
|
Map<String, dynamic> json) {
|
||||||
|
id = json['Id'];
|
||||||
|
createDate = DateUtil.convertStringToDate(json['CreateDate']);
|
||||||
|
lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']);
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
lastEditBy = json['LastEditBy'];
|
||||||
|
isActive = json['IsActive'];
|
||||||
|
title = json['Title'];
|
||||||
|
titleAR = json['TitleAR'];
|
||||||
|
price = json['Price'];
|
||||||
|
isDefault = json['isDefault'];
|
||||||
|
visibility = json['Visibility'];
|
||||||
|
durationId = json['DurationId'];
|
||||||
|
description = json['Description'];
|
||||||
|
descriptionAR = json['DescriptionAR'];
|
||||||
|
totalPrice = json['TotalPrice'];
|
||||||
|
vAT = json['VAT'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['Id'] = this.id;
|
||||||
|
data['CreateDate'] = this.createDate;
|
||||||
|
data['LastEditDate'] = this.lastEditDate;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['LastEditBy'] = this.lastEditBy;
|
||||||
|
data['IsActive'] = this.isActive;
|
||||||
|
data['Title'] = this.title;
|
||||||
|
data['TitleAR'] = this.titleAR;
|
||||||
|
data['Price'] = this.price;
|
||||||
|
data['isDefault'] = this.isDefault;
|
||||||
|
data['Visibility'] = this.visibility;
|
||||||
|
data['DurationId'] = this.durationId;
|
||||||
|
data['Description'] = this.description;
|
||||||
|
data['DescriptionAR'] = this.descriptionAR;
|
||||||
|
data['TotalPrice'] = this.totalPrice;
|
||||||
|
data['VAT'] = this.vAT;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
|
||||||
|
import '../base_service.dart';
|
||||||
|
|
||||||
|
class AmService extends BaseService {
|
||||||
|
List<PatientER_RRT_GetAllTransportationMethodListModel> AmModelList = List();
|
||||||
|
Map<String, dynamic> body = Map();
|
||||||
|
|
||||||
|
Future getAllTransportationOrders() async {
|
||||||
|
hasError = false;
|
||||||
|
|
||||||
|
await baseAppClient.post(GET_AMBULANCE_REQUEST,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
AmModelList.clear();
|
||||||
|
response['AmModelList'].forEach((vital) {
|
||||||
|
AmModelList.add(
|
||||||
|
PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/er/am_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import '../base_view_model.dart';
|
||||||
|
import '../../../locator.dart';
|
||||||
|
|
||||||
|
class AmRequestViewModel extends BaseViewModel{
|
||||||
|
|
||||||
|
|
||||||
|
AmService _amService = locator<AmService>();
|
||||||
|
|
||||||
|
List<PatientER_RRT_GetAllTransportationMethodListModel> get AmRequestModeList=>
|
||||||
|
_amService.AmModelList;
|
||||||
|
|
||||||
|
getAmRequestOrders({int id, int projectID}) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
|
||||||
|
|
||||||
|
await _amService.getAllTransportationOrders();
|
||||||
|
|
||||||
|
if ( _amService.hasError) {
|
||||||
|
error = _amService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue