insert call info updates

merge-update-with-lab-changes
haroon amjad 3 years ago
parent 7bc105c6c7
commit 31d8443f87

@ -18,9 +18,8 @@ class AskDoctorService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { localRes = response;
localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -29,11 +28,10 @@ class AskDoctorService extends BaseService {
} }
Future getCallRequestTypeLOV() async { Future getCallRequestTypeLOV() async {
hasError =false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
askDoctorReqTypes.clear(); askDoctorReqTypes.clear();
response['ListReqTypes'].forEach((reqType) { response['ListReqTypes'].forEach((reqType) {
askDoctorReqTypes.add(AskDoctorReqTypes.fromJson(reqType)); askDoctorReqTypes.add(AskDoctorReqTypes.fromJson(reqType));
@ -45,15 +43,12 @@ class AskDoctorService extends BaseService {
} }
Future getDoctorResponse() async { Future getDoctorResponse() async {
hasError =false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['from'] = body['from'] = "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00";
"${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00"; body['from'] = "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00";
body['from'] = await baseAppClient.post(GET_DOCTOR_RESPONSE, onSuccess: (dynamic response, int statusCode) {
"${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00";
await baseAppClient.post(GET_DOCTOR_RESPONSE,
onSuccess: (dynamic response, int statusCode) {
doctorResponseList.clear(); doctorResponseList.clear();
response['List_DoctorResponse'].forEach((reqType) { response['List_DoctorResponse'].forEach((reqType) {
doctorResponseList.add(DoctorResponse.fromJson(reqType)); doctorResponseList.add(DoctorResponse.fromJson(reqType));
@ -65,12 +60,11 @@ class AskDoctorService extends BaseService {
} }
Future updateReadStatus({int transactionNo}) async { Future updateReadStatus({int transactionNo}) async {
hasError =false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['TransactionNo'] = transactionNo; body['TransactionNo'] = transactionNo;
await baseAppClient.post(UPDATE_READ_STATUS, await baseAppClient.post(UPDATE_READ_STATUS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
//TODO fix it //TODO fix it
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -78,9 +72,8 @@ class AskDoctorService extends BaseService {
}, body: body); }, body: body);
} }
Future sendRequestLOV({DoctorList doctorList, String requestType, String remark}) async {
Future sendRequestLOV({DoctorList doctorList,String requestType,String remark}) async { hasError = false;
hasError =false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['ProjectID'] = doctorList.projectID; body['ProjectID'] = doctorList.projectID;
body['SetupID'] = doctorList.setupID; body['SetupID'] = doctorList.setupID;
@ -90,20 +83,18 @@ class AskDoctorService extends BaseService {
body['RequestDate'] = DateUtil.yearMonthDay(DateTime.now()); body['RequestDate'] = DateUtil.yearMonthDay(DateTime.now());
body['RequestTime'] = DateUtil.time(DateTime.now()); body['RequestTime'] = DateUtil.time(DateTime.now());
body['Remarks'] = remark; body['Remarks'] = remark;
body['Status'] = 2;// 4 for testing only.."cancelled status insert" else should be changed to 1 in live version body['Status'] = 2; // 4 for testing only.."cancelled status insert" else should be changed to 1 in live version
body['CreatedBy'] = 102; body['CreatedBy'] = 102;
body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now()); body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now());
body['EditedBy'] = 102; body['EditedBy'] = 102;
body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now()); body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now());
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['QuestionType'] = num.parse(requestType); body['QuestionType'] = num.parse(requestType);
await baseAppClient.post(INSERT_CALL_INFO, body['RequestType'] = num.parse(requestType);
onSuccess: (dynamic response, int statusCode) { body['RequestTypeID'] = num.parse(requestType);
await baseAppClient.post(INSERT_CALL_INFO, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { hasError = true;
hasError = true; super.error = error;
super.error = error; }, body: body);
}, body: body);
} }
} }

Loading…
Cancel
Save