basic details

merge-requests/1/merge
Sultan Khan 3 years ago
parent b10e6184d6
commit 3c777d220e

@ -17,6 +17,7 @@ import 'package:mohem_flutter_app/models/profile/submit_address_transaction.dart
import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart';
import 'package:mohem_flutter_app/models/profile/submit_basic_details_transaction_model.dart';
import 'package:mohem_flutter_app/models/profile/submit_contact_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/profile/submit_contact_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/profile/submit_phone_transactions.dart'; import 'package:mohem_flutter_app/models/profile/submit_phone_transactions.dart';
import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart'; import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart';
@ -94,7 +95,7 @@ class ProfileApiClient {
Future<GenericResponseModel> getDffStructure(String pFunctionName, String uRL, String requestType) async { Future<GenericResponseModel> getDffStructure(String pFunctionName, String uRL, String requestType) async {
String url = ApiConsts.erpRest + uRL; String url = ApiConsts.erpRest + uRL;
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_FUNCTION_NAME": pFunctionName, "P_COUNTRY_CODE": "SA"}; Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_REQUEST_TYPE": pFunctionName, "P_COUNTRY_CODE": "SA"};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json); GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
@ -244,7 +245,7 @@ class ProfileApiClient {
}, url, postParams); }, url, postParams);
} }
Future<Map<String, dynamic>> submitBasicDetailsTransaction(String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list, int correctOrNew) async { Future<SubmitBasicDetailsTransactionList> submitBasicDetailsTransaction(String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list, int correctOrNew) async {
String url = "${ApiConsts.erpRest}SUBMIT_BASIC_DET_TRANSACTION"; String url = "${ApiConsts.erpRest}SUBMIT_BASIC_DET_TRANSACTION";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999, "P_SELECTED_RESP_ID": -999,
@ -264,6 +265,23 @@ class ProfileApiClient {
}, url, postParams); }, url, postParams);
} }
Future<StartAddressApprovalProcess?> startBasicDetailsApprovalProcess(String action, String comments, String itemKey, int transactionId) async {
String url = "${ApiConsts.erpRest}START_BASIC_DET_APPR_PROCESS";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_ACTION_MODE": action,
"P_COMMENTS": comments,
"P_ITEM_KEY": itemKey,
"P_TRANSACTION_ID": transactionId,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.startAddressApprovalProcessList;
}, url, postParams);
}
Future<SubmitAddressTransaction> submitAddressTransaction( Future<SubmitAddressTransaction> submitAddressTransaction(
String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list, int correctOrNew, String countryCode, String effectiveDate) async { String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list, int correctOrNew, String countryCode, String effectiveDate) async {
String url = "${ApiConsts.erpRest}SUBMIT_ADDRESS_TRANSACTION"; String url = "${ApiConsts.erpRest}SUBMIT_ADDRESS_TRANSACTION";

@ -291,7 +291,9 @@ class CodegenLoader extends AssetLoader{
"basicDetails": "تفاصيل أساسية", "basicDetails": "تفاصيل أساسية",
"address": "تبوك", "address": "تبوك",
"contactDetails": "بيانات التواصل", "contactDetails": "بيانات التواصل",
"familyDetails": "تفاصيل عائلية" "familyDetails": "تفاصيل عائلية",
"effectiveDate": "تاريخ النفاذ",
"country": "دولة"
}, },
"clicked": { "clicked": {
"zero": "You clicked {} times!", "zero": "You clicked {} times!",
@ -589,7 +591,9 @@ static const Map<String,dynamic> en_US = {
"basicDetails": "Basic Details", "basicDetails": "Basic Details",
"address": "Address", "address": "Address",
"contactDetails": "Contact Details", "contactDetails": "Contact Details",
"familyDetails": "Family Members" "familyDetails": "Family Members",
"effectiveDate": "Effective Date",
"country": "Country"
}, },
"clicked": { "clicked": {
"zero": "You clicked {} times!", "zero": "You clicked {} times!",

@ -1,6 +1,6 @@
// DO NOT EDIT. This is code generated via package:easy_localization/generate.dart // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
abstract class LocaleKeys { abstract class LocaleKeys {
static const mohemm = 'mohemm'; static const mohemm = 'mohemm';
static const english = 'english'; static const english = 'english';
static const arabic = 'arabic'; static const arabic = 'arabic';
@ -243,7 +243,7 @@ abstract class LocaleKeys {
static const Payroll = 'Payroll'; static const Payroll = 'Payroll';
static const civilIdentityNumber = 'civilIdentityNumber'; static const civilIdentityNumber = 'civilIdentityNumber';
static const dateOfBirth = 'dateOfBirth'; static const dateOfBirth = 'dateOfBirth';
static const maritalStatus = 'maritalStatus '; static const maritalStatus = 'maritalStatus ';
static const fullName = 'fullName'; static const fullName = 'fullName';
static const remove = 'remove'; static const remove = 'remove';
static const submit = 'submit'; static const submit = 'submit';
@ -265,8 +265,6 @@ abstract class LocaleKeys {
static const paymentInformation = 'paymentInformation'; static const paymentInformation = 'paymentInformation';
static const amount = 'amount'; static const amount = 'amount';
static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_label = 'profile.reset_password.label';
static const profile_effectiveDate = 'profile.effectiveDate';
static const profile_country = 'profile.country';
static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_username = 'profile.reset_password.username';
static const profile_reset_password_password = 'profile.reset_password.password'; static const profile_reset_password_password = 'profile.reset_password.password';
static const profile_reset_password = 'profile.reset_password'; static const profile_reset_password = 'profile.reset_password';
@ -277,9 +275,12 @@ abstract class LocaleKeys {
static const profile_address = 'profile.address'; static const profile_address = 'profile.address';
static const profile_contactDetails = 'profile.contactDetails'; static const profile_contactDetails = 'profile.contactDetails';
static const profile_familyDetails = 'profile.familyDetails'; static const profile_familyDetails = 'profile.familyDetails';
static const profile_effectiveDate = 'profile.effectiveDate';
static const profile_country = 'profile.country';
static const profile = 'profile'; static const profile = 'profile';
static const clicked = 'clicked'; static const clicked = 'clicked';
static const gender_with_arg = 'gender.with_arg'; static const gender_with_arg = 'gender.with_arg';
static const gender = 'gender'; static const gender = 'gender';
static const reset_locale = 'reset_locale'; static const reset_locale = 'reset_locale';
} }

@ -61,6 +61,7 @@ import 'package:mohem_flutter_app/models/profile/start_address_approval_process_
import 'package:mohem_flutter_app/models/profile/submit_address_transaction.dart'; import 'package:mohem_flutter_app/models/profile/submit_address_transaction.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart';
import 'package:mohem_flutter_app/models/profile/submit_basic_details_transaction_model.dart';
import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart'; import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart';
import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart'; import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
@ -304,7 +305,7 @@ class GenericResponseModel {
String? startSitApprovalProcess; String? startSitApprovalProcess;
String? startTermApprovalProcessList; String? startTermApprovalProcessList;
SubmitAddressTransaction? submitAddressTransactionList; SubmitAddressTransaction? submitAddressTransactionList;
Map<String, dynamic>? submitBasicDetTransactionList; SubmitBasicDetailsTransactionList? submitBasicDetTransactionList;
String? submitCEITransactionList; String? submitCEITransactionList;
String? submitCcpTransactionList; String? submitCcpTransactionList;
SubmitContactTransactionList? submitContactTransactionList; SubmitContactTransactionList? submitContactTransactionList;
@ -1153,7 +1154,7 @@ class GenericResponseModel {
startTermApprovalProcessList = json['StartTermApprovalProcessList']; startTermApprovalProcessList = json['StartTermApprovalProcessList'];
submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? new SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null; submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? new SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null;
submitBasicDetTransactionList = json['SubmitBasicDetTransactionList']; submitBasicDetTransactionList = json['SubmitBasicDetTransactionList'] != null ? new SubmitBasicDetailsTransactionList.fromJson(json['SubmitBasicDetTransactionList']) : null;
submitCEITransactionList = json['SubmitCEITransactionList']; submitCEITransactionList = json['SubmitCEITransactionList'];
submitCcpTransactionList = json['SubmitCcpTransactionList']; submitCcpTransactionList = json['SubmitCcpTransactionList'];
submitContactTransactionList = json['SubmitContactTransactionList'] != null ? new SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null; submitContactTransactionList = json['SubmitContactTransactionList'] != null ? new SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null;
@ -1545,7 +1546,10 @@ class GenericResponseModel {
if (this.submitAddressTransactionList != null) { if (this.submitAddressTransactionList != null) {
data['SubmitAddressTransactionList'] = this.submitAddressTransactionList!.toJson(); data['SubmitAddressTransactionList'] = this.submitAddressTransactionList!.toJson();
} }
data['SubmitBasicDetTransactionList'] = this.submitBasicDetTransactionList; if (this.submitBasicDetTransactionList != null) {
data['SubmitBasicDetTransactionList'] = this.submitBasicDetTransactionList!.toJson();
}
data['SubmitCEITransactionList'] = this.submitCEITransactionList; data['SubmitCEITransactionList'] = this.submitCEITransactionList;
data['SubmitCcpTransactionList'] = this.submitCcpTransactionList; data['SubmitCcpTransactionList'] = this.submitCcpTransactionList;
data['SubmitContactTransactionList'] = this.submitContactTransactionList; data['SubmitContactTransactionList'] = this.submitContactTransactionList;

@ -0,0 +1,24 @@
class SubmitBasicDetailsTransactionList {
String? pITEMKEY;
String? pRETURNMSG;
String? pRETURNSTATUS;
int? pTRANSACTIONID;
SubmitBasicDetailsTransactionList({this.pITEMKEY, this.pRETURNMSG, this.pRETURNSTATUS, this.pTRANSACTIONID});
SubmitBasicDetailsTransactionList.fromJson(Map<String, dynamic> json) {
pITEMKEY = json['P_ITEM_KEY'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
pTRANSACTIONID = json['P_TRANSACTION_ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_ITEM_KEY'] = this.pITEMKEY;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
data['P_TRANSACTION_ID'] = this.pTRANSACTIONID;
return data;
}
}

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
class ProfileMenu { class ProfileMenu {
final String name; final String name;
@ -8,5 +9,6 @@ class ProfileMenu {
final String dynamicUrl; final String dynamicUrl;
final String functionName; final String functionName;
final String requestID; final String requestID;
ProfileMenu({this.name = '', this.icon = '', this.route = '', this.dynamicUrl = '', this.functionName = '', this.requestID = ''}); final GetMenuEntriesList menuEntries;
ProfileMenu({this.name = '', this.icon = '', this.route = '', this.dynamicUrl = '', this.functionName = '', this.requestID = '', required this.menuEntries});
} }

@ -106,6 +106,13 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
params!.transactionId!.toInt(), params!.transactionId!.toInt(),
params!.pItemId.toString(), params!.pItemId.toString(),
); );
} else if (params!.approvalFlag == 'basicDetails') {
await ProfileApiClient().startBasicDetailsApprovalProcess(
"SUBMIT",
comments.text,
params!.pItemId,
params!.transactionId,
);
} else { } else {
await MyAttendanceApiClient().startEitApprovalProcess( await MyAttendanceApiClient().startEitApprovalProcess(
"SUBMIT", "SUBMIT",

@ -36,7 +36,7 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
List<GetContactDetailsList?> getContactDetailsList = []; List<GetContactDetailsList?> getContactDetailsList = [];
SubmitContactTransactionList? submitContactTransactionList; SubmitContactTransactionList? submitContactTransactionList;
dynamic args; dynamic args;
String? date="MM/DD/YYYY"; String? date = "MM/DD/YYYY";
// String actionType = "UPDATE"; // String actionType = "UPDATE";
GetApprovesList? getApprovesList; GetApprovesList? getApprovesList;
@ -65,33 +65,30 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
getBasicDetDffStructureList = await ProfileApiClient().getBasicDetDffStructure(); getBasicDetDffStructureList = await ProfileApiClient().getBasicDetDffStructure();
getContactColsStructureList = await ProfileApiClient().getContactColsStructureList(args['actionType']); getContactColsStructureList = await ProfileApiClient().getContactColsStructureList(args['actionType']);
getContactDffStructureList = await ProfileApiClient().getContactDffStructureList(); getContactDffStructureList = await ProfileApiClient().getContactDffStructureList();
if(args['actionType']== "ADD"){ if (args['actionType'] == "ADD") {
getBasicDetDffStructureList?.forEach((element) {
getBasicDetDffStructureList?.forEach((element) { element?.getContactDetailsList = new GetContactDetailsList();
element?.getContactDetailsList = new GetContactDetailsList(); });
}); getContactColsStructureList?.forEach((element) {
getContactColsStructureList?.forEach((element) { element?.getContactDetailsList = new GetContactDetailsList();
element?.getContactDetailsList = new GetContactDetailsList(); });
}); getContactDffStructureList?.forEach((element) {
getContactDffStructureList?.forEach((element) { element?.getContactDetailsList = new GetContactDetailsList();
element?.getContactDetailsList = new GetContactDetailsList(); });
}); } else if (args['actionType'] == "UPDATE") {
} getContactDetailsList = await ProfileApiClient().getContactDetailsList(args['relationID']);
else if(args['actionType']== "UPDATE") {
getContactDetailsList = await ProfileApiClient().getContactDetailsList(args['relationID']);
getBasicDetDffStructureList?.forEach((element) {
element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME);
});
getContactColsStructureList?.forEach((element) {
element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME);
});
getBasicDetDffStructureList?.forEach((element) {
element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME);
});
getContactColsStructureList?.forEach((element) {
element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME);
});
getContactDffStructureList?.forEach((element) { getContactDffStructureList?.forEach((element) {
element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME); element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME);
}); });
} }
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
@ -100,13 +97,11 @@ else if(args['actionType']== "UPDATE") {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (args == null) { if (args == null) {
args = ModalRoute.of(context)!.settings.arguments; args = ModalRoute.of(context)!.settings.arguments;
callAddAndUpdateFamilyMember(); callAddAndUpdateFamilyMember();
} }
return Scaffold( return Scaffold(
appBar: AppBarWidget( appBar: AppBarWidget(
@ -136,7 +131,7 @@ else if(args['actionType']== "UPDATE") {
}, },
separatorBuilder: (cxt, index) => 0.height, separatorBuilder: (cxt, index) => 0.height,
itemCount: getBasicDetDffStructureList!.length), itemCount: getBasicDetDffStructureList!.length),
ListView.separated( ListView.separated(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (BuildContext cxt, int parentIndex) { itemBuilder: (BuildContext cxt, int parentIndex) {
@ -145,9 +140,9 @@ else if(args['actionType']== "UPDATE") {
separatorBuilder: (cxt, index) => 0.height, separatorBuilder: (cxt, index) => 0.height,
itemCount: getContactDffStructureList!.length), itemCount: getContactDffStructureList!.length),
]).expanded, ]).expanded,
SizedBox( SizedBox(
height: 50, height: 50,
), ),
], ],
) )
: args['flag'] == 2 : args['flag'] == 2
@ -205,14 +200,13 @@ else if(args['actionType']== "UPDATE") {
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => itemBuilder: (_) => <PopupMenuItem<int>>[
<PopupMenuItem<int>>[ for (int i = 0; i < getContactColsStructureList[index]!.objectValuesList!.length; i++)
for (int i = 0; i < getContactColsStructureList[index]!.objectValuesList!.length; i++) PopupMenuItem<int>(child: Text(getContactColsStructureList[index]!.objectValuesList![i].mEANING.toString()), value: i),
PopupMenuItem<int>(child: Text(getContactColsStructureList[index]!.objectValuesList![i].mEANING.toString()), value: i), ],
],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
model.getContactDetailsList!.sEGMENTVALUEDSP = getContactColsStructureList[index]!.objectValuesList![popupIndex].mEANING.toString(); model.getContactDetailsList!.sEGMENTVALUEDSP = getContactColsStructureList[index]!.objectValuesList![popupIndex].mEANING.toString();
model.getContactDetailsList!.vARCHAR2VALUE = getContactColsStructureList[index]!.objectValuesList![popupIndex].cODE.toString(); model.getContactDetailsList!.vARCHAR2VALUE = getContactColsStructureList[index]!.objectValuesList![popupIndex].cODE.toString();
setState(() {}); setState(() {});
}); });
} else { } else {
@ -224,7 +218,7 @@ else if(args['actionType']== "UPDATE") {
}, },
).paddingOnly(bottom: 12); ).paddingOnly(bottom: 12);
} }
}else if (model.dATATYPE == "DATE") { } else if (model.dATATYPE == "DATE") {
return DynamicTextFieldWidget( return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "", model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "",
@ -256,12 +250,12 @@ else if(args['actionType']== "UPDATE") {
isPopup: true, isPopup: true,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[ itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < getBasicDetDffStructureList[index]!.eSERVICESVS!.length; i++) for (int i = 0; i < getBasicDetDffStructureList[index]!.eSERVICESVS!.length; i++)
PopupMenuItem<int>(child: Text(getBasicDetDffStructureList[index]!.eSERVICESVS![i].vALUECOLUMNNAME.toString()), value: i), PopupMenuItem<int>(child: Text(getBasicDetDffStructureList[index]!.eSERVICESVS![i].vALUECOLUMNNAME.toString()), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
model.getContactDetailsList!.sEGMENTVALUEDSP = getBasicDetDffStructureList[index]!.eSERVICESVS![popupIndex].vALUECOLUMNNAME.toString(); model.getContactDetailsList!.sEGMENTVALUEDSP = getBasicDetDffStructureList[index]!.eSERVICESVS![popupIndex].vALUECOLUMNNAME.toString();
model.getContactDetailsList!.vARCHAR2VALUE = getBasicDetDffStructureList[index]!.eSERVICESVS![popupIndex].iDCOLUMNNAME.toString(); model.getContactDetailsList!.vARCHAR2VALUE = getBasicDetDffStructureList[index]!.eSERVICESVS![popupIndex].iDCOLUMNNAME.toString();
setState(() {}); setState(() {});
}); });
@ -274,7 +268,7 @@ else if(args['actionType']== "UPDATE") {
}, },
).paddingOnly(bottom: 12); ).paddingOnly(bottom: 12);
} }
}else if (model.fORMATTYPE == "X") { } else if (model.fORMATTYPE == "X") {
return DynamicTextFieldWidget( return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "", model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "",
@ -305,13 +299,13 @@ else if(args['actionType']== "UPDATE") {
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[ itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < getContactDffStructureList[index]!.eSERVICESVS!.length; i++) for (int i = 0; i < getContactDffStructureList[index]!.eSERVICESVS!.length; i++)
PopupMenuItem<int>(child: Text(getContactDffStructureList[index]!.eSERVICESVS![i].vALUECOLUMNNAME.toString()), value: i), PopupMenuItem<int>(child: Text(getContactDffStructureList[index]!.eSERVICESVS![i].vALUECOLUMNNAME.toString()), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
model.getContactDetailsList!.sEGMENTVALUEDSP = getContactDffStructureList[index]!.eSERVICESVS![popupIndex].vALUECOLUMNNAME.toString(); model.getContactDetailsList!.sEGMENTVALUEDSP = getContactDffStructureList[index]!.eSERVICESVS![popupIndex].vALUECOLUMNNAME.toString();
model.getContactDetailsList!.vARCHAR2VALUE = getContactDffStructureList[index]!.eSERVICESVS![popupIndex].iDCOLUMNNAME.toString(); model.getContactDetailsList!.vARCHAR2VALUE = getContactDffStructureList[index]!.eSERVICESVS![popupIndex].iDCOLUMNNAME.toString();
setState(() {}); setState(() {});
}); });
} else { } else {
@ -323,7 +317,7 @@ else if(args['actionType']== "UPDATE") {
}, },
).paddingOnly(bottom: 12); ).paddingOnly(bottom: 12);
} }
}else if (model.fORMATTYPE == "X") { } else if (model.fORMATTYPE == "X") {
return DynamicTextFieldWidget( return DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "", model!.getContactDetailsList!.sEGMENTVALUEDSP ?? "",
@ -364,7 +358,7 @@ else if(args['actionType']== "UPDATE") {
); );
} else { } else {
final DateTime? picked = final DateTime? picked =
await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
if (picked != null && picked != selectedDate) { if (picked != null && picked != selectedDate) {
time = picked; time = picked;
} }
@ -372,7 +366,7 @@ else if(args['actionType']== "UPDATE") {
return time; return time;
} }
footer() { Widget footer() {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -399,85 +393,83 @@ else if(args['actionType']== "UPDATE") {
} }
void submitUpdateForm() async { void submitUpdateForm() async {
try { try {
List<Map<String, dynamic>> values1 = getBasicDetDffStructureList!.map((e) { List<Map<String, dynamic>> values1 = getBasicDetDffStructureList!.map((e) {
String? dateVal =''; String? dateVal = '';
String? vatcherVal =''; String? vatcherVal = '';
int? numberVal; int? numberVal;
if(e!.fORMATTYPE =='N'){ if (e!.fORMATTYPE == 'N') {
dateVal= null; dateVal = null;
vatcherVal= null; vatcherVal = null;
numberVal = e!.getContactDetailsList!.nUMBERVALUE; numberVal = e!.getContactDetailsList!.nUMBERVALUE;
} else if(e.fORMATTYPE =='X'){ } else if (e.fORMATTYPE == 'X') {
dateVal= e!.getContactDetailsList!.dATEVALUE.toString(); dateVal = e!.getContactDetailsList!.dATEVALUE.toString();
vatcherVal= null; vatcherVal = null;
numberVal = null; numberVal = null;
}else{ } else {
dateVal= null; dateVal = null;
vatcherVal= e!.getContactDetailsList!.vARCHAR2VALUE.toString(); vatcherVal = e!.getContactDetailsList!.vARCHAR2VALUE.toString();
numberVal = null; numberVal = null;
} }
return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson();
}).toList(); }).toList();
List<Map<String, dynamic>> values2 = getContactDffStructureList!.map((e) { List<Map<String, dynamic>> values2 = getContactDffStructureList!.map((e) {
//String tempVar = e!.getContactDetailsList!.vARCHAR2VALUE ?? ""; //String tempVar = e!.getContactDetailsList!.vARCHAR2VALUE ?? "";
String? dateVal =''; String? dateVal = '';
String? vatcherVal =''; String? vatcherVal = '';
int? numberVal; int? numberVal;
if(e!.fORMATTYPE =='N'){ if (e!.fORMATTYPE == 'N') {
dateVal= null; dateVal = null;
vatcherVal= null; vatcherVal = null;
numberVal= e!.getContactDetailsList!.nUMBERVALUE; numberVal = e!.getContactDetailsList!.nUMBERVALUE;
} else if(e.fORMATTYPE =='X'){ } else if (e.fORMATTYPE == 'X') {
dateVal= e!.getContactDetailsList!.dATEVALUE.toString(); dateVal = e!.getContactDetailsList!.dATEVALUE.toString();
vatcherVal= null; vatcherVal = null;
numberVal= null; numberVal = null;
}else{ } else {
dateVal= null; dateVal = null;
numberVal= null; numberVal = null;
vatcherVal= e!.getContactDetailsList!.vARCHAR2VALUE.toString(); vatcherVal = e!.getContactDetailsList!.vARCHAR2VALUE.toString();
} }
return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson();
}).toList(); }).toList();
List<Map<String, dynamic>> values3 = getContactColsStructureList!.map((e) { List<Map<String, dynamic>> values3 = getContactColsStructureList!.map((e) {
// String tempVar = e!.getContactDetailsList!.sEGMENTVALUEDSP ?? ""; // String tempVar = e!.getContactDetailsList!.sEGMENTVALUEDSP ?? "";
String? dateVal =''; String? dateVal = '';
String? vatcherVal =''; String? vatcherVal = '';
int? numberVal; int? numberVal;
if(e!.dATATYPE =='VARCHAR2'){ if (e!.dATATYPE == 'VARCHAR2') {
dateVal= null; dateVal = null;
numberVal= null; numberVal = null;
vatcherVal= e!.getContactDetailsList!.vARCHAR2VALUE.toString(); vatcherVal = e!.getContactDetailsList!.vARCHAR2VALUE.toString();
} else if(e.dATATYPE =='DATE'){ } else if (e.dATATYPE == 'DATE') {
dateVal= e!.getContactDetailsList!.dATEVALUE.toString(); dateVal = e!.getContactDetailsList!.dATEVALUE.toString();
vatcherVal= null; vatcherVal = null;
numberVal= null; numberVal = null;
}else if(e.dATATYPE =='NUMBER'){ } else if (e.dATATYPE == 'NUMBER') {
dateVal= null; dateVal = null;
vatcherVal= null; vatcherVal = null;
numberVal= e!.getContactDetailsList!.nUMBERVALUE; numberVal = e!.getContactDetailsList!.nUMBERVALUE;
}else{ } else {}
} return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson();
return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); }).toList();
}).toList(); List<Map<String, dynamic>> valuesFinal = [...values1, ...values2, ...values3];
List<Map<String, dynamic>> valuesFinal = [...values1, ...values2,...values3]; Utils.showLoading(context);
Utils.showLoading(context); if (args['actionType'] == "ADD") {
if(args['actionType']== "ADD") { var relationID = null;
var relationID = null; submitContactTransactionList = await ProfileApiClient().submetConatctTransactionAddAndUpdate(args['actionType'], relationID, valuesFinal);
submitContactTransactionList = await ProfileApiClient().submetConatctTransactionAddAndUpdate(args['actionType'], relationID, valuesFinal); } else if (args['actionType'] == "UPDATE") {
}else if(args['actionType']== "UPDATE"){ submitContactTransactionList = await ProfileApiClient().submetConatctTransactionAddAndUpdate(args['actionType'], args['relationID'], valuesFinal);
submitContactTransactionList = await ProfileApiClient().submetConatctTransactionAddAndUpdate(args['actionType'], args['relationID'], valuesFinal);
}
var transactionId = submitContactTransactionList!.pTRANSACTIONID;
var itemKey = submitContactTransactionList!.pITEMKEY;
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member'));
setState(() {}
);
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
} }
var transactionId = submitContactTransactionList!.pTRANSACTIONID;
var itemKey = submitContactTransactionList!.pITEMKEY;
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member'));
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
} }
} }

@ -26,9 +26,9 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
String pFunctionName = "HR_PERINFO_SS"; String pFunctionName = "HR_PERINFO_SS";
String actionType = "DELETE"; String actionType = "DELETE";
// int? contactRelationId; // int? contactRelationId;
String? date="MM/DD/YYYY"; String? date = "MM/DD/YYYY";
String? datePar; String? datePar;
// String? itemKey; // String? itemKey;
SubmitContactTransactionList? submitContactTransactionList; SubmitContactTransactionList? submitContactTransactionList;
GetApprovesList? getApprovesList; GetApprovesList? getApprovesList;
@ -44,11 +44,12 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
submitContactTransactionList = await ProfileApiClient().submetConatctTransaction(pFunctionName.toString(), actionType.toString(), widget.relationId!.toInt(), datePar.toString()); submitContactTransactionList = await ProfileApiClient().submetConatctTransaction(pFunctionName.toString(), actionType.toString(), widget.relationId!.toInt(), datePar.toString());
var transactionId = submitContactTransactionList!.pTRANSACTIONID; var transactionId = submitContactTransactionList!.pTRANSACTIONID;
var itemKey = submitContactTransactionList!.pITEMKEY; var itemKey = submitContactTransactionList!.pITEMKEY;
Utils.hideLoading(context); Utils.hideLoading(context);
// getApprovesList = await ProfileApiClient().getApproves(transactionId!.toInt(), itemKey.toString() ); // getApprovesList = await ProfileApiClient().getApproves(transactionId!.toInt(), itemKey.toString() );
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member')); Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member'));
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
@ -74,9 +75,9 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
isEnable: false, isEnable: false,
onTap: () async { onTap: () async {
DateTime dateValue = await _selectDate(context); DateTime dateValue = await _selectDate(context);
// DateTime date1 = DateTime(dateValue.year, dateValue.month, dateValue.day); // DateTime date1 = DateTime(dateValue.year, dateValue.month, dateValue.day);
date = DateFormat('yyyy/MM/dd').format(dateValue); date = DateFormat('yyyy/MM/dd').format(dateValue);
datePar = DateFormat('yyyy/MM/dd hh:mm:ss').format(dateValue); datePar = DateFormat('yyyy/MM/dd hh:mm:ss').format(dateValue);
setState(() {}); setState(() {});
// if (date !=null) { // if (date !=null) {
// print(datePar); // print(datePar);
@ -88,13 +89,13 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
)); ));
} }
footer() { Widget footer() {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Container(
color: MyColors.gradiantEndColor, color: MyColors.gradiantEndColor,
margin: EdgeInsets.only(bottom: 20, top: 20), margin: EdgeInsets.only(bottom: 20, top: 20),
padding: EdgeInsets.only(left: 50, right: 50), padding: EdgeInsets.only(left: 50, right: 50),
child: TextButton( child: TextButton(
style: TextButton.styleFrom( style: TextButton.styleFrom(
@ -104,7 +105,6 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
), ),
onPressed: () { onPressed: () {
deleteFamilyMember(datePar); deleteFamilyMember(datePar);
}, },
child: Text( child: Text(
LocaleKeys.next.tr(), LocaleKeys.next.tr(),

@ -194,7 +194,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i), for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME!; model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME;
model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].dESCRIPTION; model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].dESCRIPTION;
setState(() {}); setState(() {});
}); });
@ -218,8 +218,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].dESCRIPTION!), value: i), for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].dESCRIPTION!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].dESCRIPTION!; model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].dESCRIPTION;
model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME!; model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME;
setState(() {}); setState(() {});
}); });
} }

@ -19,6 +19,7 @@ import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart';
import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart';
import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart';
import 'package:mohem_flutter_app/models/profile/submit_basic_details_transaction_model.dart';
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
@ -62,7 +63,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
void getTransactionsStructure() async { void getTransactionsStructure() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
genericResponseModel = await ProfileApiClient().getDffStructure(dynamicParams!.dynamicId, dynamicParams!.uRL, dynamicParams!.requestID); genericResponseModel = await ProfileApiClient().getDffStructure("BASIC_DETAILS", dynamicParams!.uRL, dynamicParams!.requestID);
getBasicDetDffStructureList = genericResponseModel?.getBasicDetDffStructureList ?? []; getBasicDetDffStructureList = genericResponseModel?.getBasicDetDffStructureList ?? [];
getBasicDetDffStructureList?.forEach((element) { getBasicDetDffStructureList?.forEach((element) {
@ -156,7 +157,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
// 12.height, // 12.height,
DefaultButton( DefaultButton(
LocaleKeys.next.tr(), LocaleKeys.next.tr(),
(getBasicDetDffStructureList ?? []).isEmpty ? null : () => {validateTransaction()}, () => {validateTransaction()},
).insideContainer, ).insideContainer,
], ],
), ),
@ -174,7 +175,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
return PopupMenuButton( return PopupMenuButton(
child: DynamicTextFieldWidget( child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.userBasicDetail?.sEGMENTVALUEDSP ?? "", model.userBasicDetail?.aPPLICATIONCOLUMNNAME ?? "",
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
@ -183,6 +184,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME; getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME;
getBasicDetDffStructureList![index].userBasicDetail!.aPPLICATIONCOLUMNNAME = model.eSERVICESVS![popupIndex].dESCRIPTION;
setState(() {}); setState(() {});
}); });
} }
@ -235,21 +237,30 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
if (model.dATATYPE == "VARCHAR2") { if (model.dATATYPE == "VARCHAR2") {
if (model.objectValuesList?.isNotEmpty ?? false) { if (model.objectValuesList?.isNotEmpty ?? false) {
return PopupMenuButton( return PopupMenuButton(
child: DynamicTextFieldWidget( child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
getBasicDetColsStructureList![index].userBasicDetail!.sEGMENTVALUEDSP ?? "", getBasicDetColsStructureList![index].userBasicDetail!.sEGMENTVALUEDSP ?? "",
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[ itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < model.objectValuesList!.length; i++) PopupMenuItem<int>(child: Text(model.objectValuesList![i].mEANING!), value: i), for (int i = 0; i < model.objectValuesList!.length; i++) PopupMenuItem<int>(child: Text(model.objectValuesList![i].mEANING!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
if (model.objectValuesList![popupIndex].cODE != '') {
ESERVICESDV eservicesdv = ESERVICESDV eservicesdv =
ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![index].dESCRIPTION, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME); ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![popupIndex].mEANING, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME);
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].dESCRIPTION; getBasicDetColsStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].mEANING;
setState(() {}); getBasicDetColsStructureList![index].userBasicDetail!.vARCHAR2VALUE = model.objectValuesList![popupIndex].cODE;
}); } else {
ESERVICESDV eservicesdv =
ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![popupIndex].dESCRIPTION, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME);
getBasicDetColsStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].dESCRIPTION;
getBasicDetColsStructureList![index].userBasicDetail!.vARCHAR2VALUE = model.objectValuesList![popupIndex].mEANING;
}
setState(() {});
},
);
} }
return DynamicTextFieldWidget( return DynamicTextFieldWidget(
@ -328,8 +339,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
void validateTransaction() async { void validateTransaction() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
int numberValue = 0;
List<Map<String, dynamic>> values = getBasicDetDffStructureList!.map((e) { List<Map<String, dynamic>> values = getBasicDetDffStructureList!.map((e) {
String tempVar = e.userBasicDetail!.vARCHAR2VALUE ?? ""; String tempVar = e.userBasicDetail!.vARCHAR2VALUE ?? "";
if (e.fORMATTYPE == "X") { if (e.fORMATTYPE == "X") {
// for date format type, date format is changed // for date format type, date format is changed
tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? ""; tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? "";
@ -343,30 +356,25 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson()); values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson());
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson());
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); //values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson());
List<Map<String, dynamic>> valuesCols = getBasicDetColsStructureList!.map((e) { List<Map<String, dynamic>> valuesCols = getBasicDetColsStructureList!.map((e) {
// String tempVar = e.userBasicDetail!.vARCHAR2VALUE ?? ""; if (e.dATATYPE == 'NUMBER') {
// if (e.dATATYPE == "DATE") { numberValue = e.userBasicDetail!.nUMBERVALUE!;
// // for date format type, date format is changed }
// tempVar = e.userBasicDetail!.dATEVALUE ?? "";
// // if (tempVar.isNotEmpty) {
// // DateTime date = DateFormat('dd-MM-yyyy').parse(tempVar);
// // tempVar = DateFormat('yyyy/MM/dd HH:mm:ss').format(date);
// // }
// }
return ValidateEitTransactionModel( return ValidateEitTransactionModel(
dATEVALUE: e.userBasicDetail!.dATEVALUE ?? "", nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: e.userBasicDetail!.vARCHAR2VALUE ?? "") dATEVALUE: e.userBasicDetail!.dATEVALUE ?? "", nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberValue, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: e.userBasicDetail!.vARCHAR2VALUE ?? "")
.toJson(); .toJson();
}).toList(); }).toList();
List<Map<String, dynamic>> transactionValues = new List.from(values)..addAll(valuesCols); List<Map<String, dynamic>> transactionValues = new List.from(values)..addAll(valuesCols);
print(transactionValues); print(transactionValues);
//genericResponseModel = await MyAttendanceApiClient().validateEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values); SubmitBasicDetailsTransactionList submitBasicDetails =
Map<String, dynamic> submitBasicDetails = await ProfileApiClient().submitBasicDetailsTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, transactionValues, dynamicParams!.correctOrNew); await ProfileApiClient().submitBasicDetailsTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, transactionValues, dynamicParams!.correctOrNew);
print(submitBasicDetails); print(submitBasicDetails);
Utils.hideLoading(context); Utils.hideLoading(context);
// Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams("title", submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit')); Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(dynamicParams!.title, submitBasicDetails.pTRANSACTIONID!, submitBasicDetails.pITEMKEY!, 'basicDetails'));
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);

@ -3,39 +3,52 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:mohem_flutter_app/models/profile_menu.model.dart'; import 'package:mohem_flutter_app/models/profile_menu.model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:provider/provider.dart';
// todo '@sultan' kindly follow structure of code written. use extension methods for widgets, also format code // todo '@sultan' kindly follow structure of code written. use extension methods for widgets, also format code
class ProfileInFo extends StatelessWidget { class ProfileInFo extends StatefulWidget {
ProfileInFo(this.memberInfo); ProfileInFo(this.memberInfo);
MemberInformationListModel memberInfo; MemberInformationListModel memberInfo;
@override
State<ProfileInFo> createState() => _ProfileInFoState();
}
class _ProfileInFoState extends State<ProfileInFo> {
static List<GetMenuEntriesList> menuData = [];
String data = '.'; String data = '.';
double sliderValue = 75; double sliderValue = 75;
List<ProfileMenu> menu = [ List<ProfileMenu> menu = [
ProfileMenu(name: LocaleKeys.profile_personalInformation.tr(), icon: 'personal-info.svg', route: AppRoutes.personalInfo, dynamicUrl: ''), ProfileMenu(name: LocaleKeys.profile_personalInformation.tr(), icon: 'personal-info.svg', route: AppRoutes.personalInfo, dynamicUrl: '', menuEntries: getMenuEntries('')),
ProfileMenu( ProfileMenu(name: LocaleKeys.profile_basicDetails.tr(), icon: 'basic-details.svg', route: AppRoutes.basicDetails, menuEntries: getMenuEntries('BASIC_DETAILS')),
name: LocaleKeys.profile_basicDetails.tr(), ProfileMenu(name: LocaleKeys.profile_contactDetails.tr(), icon: 'contact-details.svg', route: AppRoutes.contactDetails, dynamicUrl: '', menuEntries: getMenuEntries('ADDRESS')),
icon: 'basic-details.svg', ProfileMenu(name: LocaleKeys.profile_familyDetails.tr(), icon: 'family-members.svg', route: AppRoutes.familyMembers, dynamicUrl: '', menuEntries: getMenuEntries('CONTACT')),
route: AppRoutes.basicDetails,
),
ProfileMenu(name: LocaleKeys.profile_contactDetails.tr(), icon: 'contact-details.svg', route: AppRoutes.contactDetails, dynamicUrl: ''),
ProfileMenu(name: LocaleKeys.profile_familyDetails.tr(), icon: 'family-members.svg', route: AppRoutes.familyMembers, dynamicUrl: ''),
]; ];
@override
void setState(VoidCallback fn) {
List<GetMenuEntriesList> menuData = Provider.of<DashboardProviderModel>(context, listen: false).getMenuEntriesList!;
super.setState(fn);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
/// card header /// card header
customLabel(memberInfo.eMPLOYEENAME.toString(), 22, Colors.black, true), customLabel(widget.memberInfo.eMPLOYEENAME.toString(), 22, Colors.black, true),
customLabel(memberInfo.eMPLOYEENUMBER.toString() + ' | ' + memberInfo.jOBNAME.toString(), 14, Colors.grey, false), customLabel(widget.memberInfo.eMPLOYEENUMBER.toString() + ' | ' + widget.memberInfo.jOBNAME.toString(), 14, Colors.grey, false),
customLabel(memberInfo.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true), customLabel(widget.memberInfo.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true),
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)), Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
@ -45,13 +58,13 @@ class ProfileInFo extends StatelessWidget {
Container( Container(
child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [ child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [
Column( Column(
children: [customLabel(LocaleKeys.year.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEYEARS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], children: [customLabel(LocaleKeys.year.tr(), 14, const Color(0xff808080), true), customLabel(widget.memberInfo.sERVICEYEARS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
), ),
Column( Column(
children: [customLabel(LocaleKeys.month.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEMONTHS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], children: [customLabel(LocaleKeys.month.tr(), 14, const Color(0xff808080), true), customLabel(widget.memberInfo.sERVICEMONTHS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
), ),
Column( Column(
children: [customLabel(LocaleKeys.day.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEDAYS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], children: [customLabel(LocaleKeys.day.tr(), 14, const Color(0xff808080), true), customLabel(widget.memberInfo.sERVICEDAYS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
) )
])), ])),
@ -131,3 +144,12 @@ class ProfileInFo extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))])); children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))]));
} }
GetMenuEntriesList getMenuEntries(String type) {
List<GetMenuEntriesList> data = _ProfileInFoState.menuData.where((GetMenuEntriesList test) => test.functionName == type).toList();
if (data.isNotEmpty) {
return data[0];
} else {
return GetMenuEntriesList();
}
}

Loading…
Cancel
Save