child Vaccines
parent
37b817e0c8
commit
e14d619edd
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
@ -0,0 +1,45 @@
|
|||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
class List_BabyInformationModel {
|
||||||
|
int alertBy;
|
||||||
|
int babyID;
|
||||||
|
String babyName;
|
||||||
|
DateTime dOB;
|
||||||
|
int gender;
|
||||||
|
String genderDescription;
|
||||||
|
int patientID;
|
||||||
|
int userID;
|
||||||
|
|
||||||
|
List_BabyInformationModel(
|
||||||
|
{this.alertBy,
|
||||||
|
this.babyID,
|
||||||
|
this.babyName,
|
||||||
|
this.dOB,
|
||||||
|
this.gender,
|
||||||
|
this.genderDescription,
|
||||||
|
this.patientID,
|
||||||
|
this.userID});
|
||||||
|
|
||||||
|
List_BabyInformationModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
alertBy = json['AlertBy'];
|
||||||
|
babyID = json['BabyID'];
|
||||||
|
babyName = json['BabyName'];
|
||||||
|
dOB = DateUtil.convertStringToDate(json['DOB']);
|
||||||
|
gender = json['Gender'];
|
||||||
|
genderDescription = json['GenderDescription'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
userID = json['UserID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['AlertBy'] = this.alertBy;
|
||||||
|
data['BabyID'] = this.babyID;
|
||||||
|
data['BabyName'] = this.babyName;
|
||||||
|
data['DOB'] = this.dOB;
|
||||||
|
data['Gender'] = this.gender;
|
||||||
|
data['GenderDescription'] = this.genderDescription;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['UserID'] = this.userID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
class List_UserInformationModel {
|
||||||
|
int userID;
|
||||||
|
String mobileNumber;
|
||||||
|
String nationalID;
|
||||||
|
String emailAddress;
|
||||||
|
int patientID;
|
||||||
|
int patientType;
|
||||||
|
bool patientOutSA;
|
||||||
|
int createdBy;
|
||||||
|
int editedBy;
|
||||||
|
|
||||||
|
List_UserInformationModel(
|
||||||
|
{this.userID,
|
||||||
|
this.mobileNumber,
|
||||||
|
this.nationalID,
|
||||||
|
this.emailAddress,
|
||||||
|
this.patientID,
|
||||||
|
this.patientType,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.createdBy,
|
||||||
|
this.editedBy});
|
||||||
|
|
||||||
|
List_UserInformationModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
userID = json['UserID'];
|
||||||
|
mobileNumber = json['MobileNumber'];
|
||||||
|
nationalID = json['NationalID'];
|
||||||
|
emailAddress = json['EmailAddress'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['UserID'] = this.userID;
|
||||||
|
data['MobileNumber'] = this.mobileNumber;
|
||||||
|
data['NationalID'] = this.nationalID;
|
||||||
|
data['EmailAddress'] = this.emailAddress;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
||||||
|
import '../base_service.dart';
|
||||||
|
|
||||||
|
class UserInformationService extends BaseService{
|
||||||
|
|
||||||
|
List<List_UserInformationModel> userInformationModelList = List();
|
||||||
|
Map<String, dynamic> body = Map();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Future getUserInformationOrders() async {
|
||||||
|
hasError = false;
|
||||||
|
// body['isDentalAllowedBackend'] = false;
|
||||||
|
// body['IsLogin'] = true;
|
||||||
|
// body['UserID'] = 42843;
|
||||||
|
|
||||||
|
|
||||||
|
await baseAppClient.post(GET_USERINFORMATION_REQUEST,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
userInformationModelList.clear();
|
||||||
|
|
||||||
|
response['List_UserInformationModel_New'].forEach((vital) {
|
||||||
|
userInformationModelList.add(List_UserInformationModel.fromJson(vital));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart';
|
||||||
|
|
||||||
|
import '../../../locator.dart';
|
||||||
|
import '../base_view_model.dart';
|
||||||
|
|
||||||
|
class ChildVaccinesViewModel extends BaseViewModel{
|
||||||
|
|
||||||
|
|
||||||
|
ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<List_BabyInformationModel> get babyInformationModelList=> _childVaccinesService.babyInformationModelList;//BabyInformationModelList;
|
||||||
|
getBabyInformatioRequestOrders() async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
|
||||||
|
await _childVaccinesService.getAllBabyInformationOrders();
|
||||||
|
|
||||||
|
if (_childVaccinesService.hasError) {
|
||||||
|
error = _childVaccinesService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/childvaccines/user_information_service.dart';
|
||||||
|
import '../../../locator.dart';
|
||||||
|
import '../base_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
|
||||||
|
class UserInformationViewModel extends BaseViewModel {
|
||||||
|
UserInformationService _userInformationService =
|
||||||
|
locator<UserInformationService>();
|
||||||
|
|
||||||
|
List<List_UserInformationModel> get userInformationModelList =>
|
||||||
|
_userInformationService.userInformationModelList;
|
||||||
|
|
||||||
|
getUserInformatioRequestOrders() async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
|
||||||
|
await _userInformationService.getUserInformationOrders();
|
||||||
|
|
||||||
|
if (_userInformationService.hasError) {
|
||||||
|
error = _userInformationService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue