|
@@ -19,7 +19,9 @@ export class FormUserComponent implements OnInit {
|
|
private route: ActivatedRoute,
|
|
private route: ActivatedRoute,
|
|
private authSer: AuthServiceService,
|
|
private authSer: AuthServiceService,
|
|
private location: Location,
|
|
private location: Location,
|
|
- private toastr: ToastrService) { }
|
|
|
|
|
|
+ private toastr: ToastrService) {
|
|
|
|
+ this.spineer.show();
|
|
|
|
+ }
|
|
|
|
|
|
adminstration = [];
|
|
adminstration = [];
|
|
countries = [];
|
|
countries = [];
|
|
@@ -46,13 +48,16 @@ export class FormUserComponent implements OnInit {
|
|
identity_type: number;
|
|
identity_type: number;
|
|
number_identitiy:number;
|
|
number_identitiy:number;
|
|
checkPageAppear: boolean = true;
|
|
checkPageAppear: boolean = true;
|
|
|
|
+ checkRequiredSpan:boolean = true;
|
|
urlImg: string = '../../../../assets/image/Group 299.png';
|
|
urlImg: string = '../../../../assets/image/Group 299.png';
|
|
|
|
+ higriDateVal = "";
|
|
|
|
+ bindingDateSplit;
|
|
|
|
+ checkSaveDisabled:boolean = false;
|
|
|
|
|
|
-
|
|
|
|
|
|
+ end:any;
|
|
|
|
|
|
ngOnInit() {
|
|
ngOnInit() {
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ this.spineer.show();
|
|
//show / hide notification search in header
|
|
//show / hide notification search in header
|
|
this.authSer.notificationLogin = true;
|
|
this.authSer.notificationLogin = true;
|
|
this.authSer.showSearchHeader = false;
|
|
this.authSer.showSearchHeader = false;
|
|
@@ -117,6 +122,12 @@ export class FormUserComponent implements OnInit {
|
|
this.contracts = responce['contract_types'];
|
|
this.contracts = responce['contract_types'];
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
+
|
|
|
|
+ this.userSer.getAdministration().subscribe(
|
|
|
|
+ (responce) => {
|
|
|
|
+ this.adminstration = responce['adminstrations'];
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
|
|
//get staff list
|
|
//get staff list
|
|
this.userSer.getStaff().subscribe(
|
|
this.userSer.getStaff().subscribe(
|
|
@@ -142,12 +153,10 @@ export class FormUserComponent implements OnInit {
|
|
if(this.typeCreatePage == 'user') {
|
|
if(this.typeCreatePage == 'user') {
|
|
this.typeFirstLink = 'المستخدمين';
|
|
this.typeFirstLink = 'المستخدمين';
|
|
this.typeLink = 'إنشاء جديد';
|
|
this.typeLink = 'إنشاء جديد';
|
|
- } else if(this.typeCreatePage == 'joinUs') {
|
|
|
|
- this.typeFirstLink = 'إنضم إلينا';
|
|
|
|
- this.typeLink = 'إنشاء جديد';
|
|
|
|
|
|
+ this.spineer.hide();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- )
|
|
|
|
|
|
+ );
|
|
|
|
|
|
this.route.params.subscribe(
|
|
this.route.params.subscribe(
|
|
(params:Params) => {
|
|
(params:Params) => {
|
|
@@ -155,7 +164,7 @@ export class FormUserComponent implements OnInit {
|
|
this.typeFirstLink = 'المستخدمين';
|
|
this.typeFirstLink = 'المستخدمين';
|
|
this.typeLink = 'تعديل';
|
|
this.typeLink = 'تعديل';
|
|
this.checkPageAppear = true;
|
|
this.checkPageAppear = true;
|
|
- this.spineer.show();
|
|
|
|
|
|
+ this.checkRequiredSpan = false;
|
|
this.userID = params['userEditId'];
|
|
this.userID = params['userEditId'];
|
|
this.typeMode = true;
|
|
this.typeMode = true;
|
|
this.hideConfirmPassword = false;
|
|
this.hideConfirmPassword = false;
|
|
@@ -176,7 +185,6 @@ export class FormUserComponent implements OnInit {
|
|
birthday: responce['user'].birthday,
|
|
birthday: responce['user'].birthday,
|
|
nationality_id: responce['user'].nationality_id,
|
|
nationality_id: responce['user'].nationality_id,
|
|
date_of_employment_gre: responce['user'].date_of_employment_gre,
|
|
date_of_employment_gre: responce['user'].date_of_employment_gre,
|
|
- date_of_employment_hij: responce['user'].date_of_employment_hij,
|
|
|
|
job_title_id: responce['user'].job_title_id,
|
|
job_title_id: responce['user'].job_title_id,
|
|
specialization_id: responce['user'].specialization_id,
|
|
specialization_id: responce['user'].specialization_id,
|
|
functional_number: responce['user'].functional_number,
|
|
functional_number: responce['user'].functional_number,
|
|
@@ -191,52 +199,19 @@ export class FormUserComponent implements OnInit {
|
|
);
|
|
);
|
|
this.urlImg = responce['user'].photo ? this.authSer.pathImg + responce['user'].photo : this.urlImg;
|
|
this.urlImg = responce['user'].photo ? this.authSer.pathImg + responce['user'].photo : this.urlImg;
|
|
console.log(this.urlImg);
|
|
console.log(this.urlImg);
|
|
|
|
+ const date = responce['user'].date_of_employment_hij.split('-');
|
|
|
|
+
|
|
|
|
+ this.bindingDateSplit = {
|
|
|
|
+ 'year': parseInt(date[0]),
|
|
|
|
+ 'month': parseInt(date[1]),
|
|
|
|
+ 'day': parseInt(date[2])
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ this.higriDateVal = responce['user'].date_of_employment_hij;
|
|
|
|
+ console.log(this.bindingDateSplit);
|
|
|
|
+
|
|
this.getDepartment();
|
|
this.getDepartment();
|
|
this.spineer.hide();
|
|
this.spineer.hide();
|
|
- },
|
|
|
|
- (error) => {console.log(error)},
|
|
|
|
- );
|
|
|
|
- } else if(params['typemode'] == 'editJo') {
|
|
|
|
- this.typeFirstLink = 'إنضم إلينا';
|
|
|
|
- this.typeLink = 'تعديل';
|
|
|
|
- this.checkPageAppear = false;
|
|
|
|
- this.spineer.show();
|
|
|
|
- this.userID = params['userEditId'];
|
|
|
|
- this.typeMode = true;
|
|
|
|
- this.hideConfirmPassword = false;
|
|
|
|
- this.showDepart = true;
|
|
|
|
- this.typeEditPage = 'editJo';
|
|
|
|
- this.userSer.onGetUserData(this.userID, 'editJo').subscribe(
|
|
|
|
- (responce) => {
|
|
|
|
- console.log('data join' , responce);
|
|
|
|
- this.signupForm.patchValue(
|
|
|
|
- {
|
|
|
|
- name: responce['user'].name,
|
|
|
|
- position: responce['user'].position,
|
|
|
|
- email: responce['user'].email,
|
|
|
|
- password: responce['user'].password,
|
|
|
|
- password_confirmation: responce['user'].password_confirmation,
|
|
|
|
- phone: responce['user'].phone,
|
|
|
|
- gender: responce['user'].gender,
|
|
|
|
- birthday: responce['user'].birthday,
|
|
|
|
- nationality_id: responce['user'].nationality_id,
|
|
|
|
- date_of_employment_gre: responce['user'].date_of_employment_gre,
|
|
|
|
- date_of_employment_hij: responce['user'].date_of_employment_hij,
|
|
|
|
- job_title_id: responce['user'].job_title_id,
|
|
|
|
- specialization_id: responce['user'].specialization_id,
|
|
|
|
- functional_number: responce['user'].functional_number,
|
|
|
|
- adminstration_id: responce['user'].adminstration_id,
|
|
|
|
- department_id: responce['user'].department_id,
|
|
|
|
- contract_type_id: responce['user'].contract_type_id,
|
|
|
|
- staff_id: responce['user'].staff_id,
|
|
|
|
- status: responce['user'].status,
|
|
|
|
- identity_type_id: responce['user'].identity_type_id,
|
|
|
|
- identity_number: responce['user'].identity_number,
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- this.urlImg = responce['user'].photo ? this.authSer.pathImg + responce['user'].photo : this.urlImg;
|
|
|
|
- console.log(this.urlImg);
|
|
|
|
- this.getDepartment();
|
|
|
|
this.spineer.hide();
|
|
this.spineer.hide();
|
|
},
|
|
},
|
|
(error) => {console.log(error)},
|
|
(error) => {console.log(error)},
|
|
@@ -250,19 +225,18 @@ export class FormUserComponent implements OnInit {
|
|
this.signupForm = new FormGroup({
|
|
this.signupForm = new FormGroup({
|
|
name: new FormControl(null, Validators.required),
|
|
name: new FormControl(null, Validators.required),
|
|
identity_type_id: new FormControl(null, [Validators.required]),
|
|
identity_type_id: new FormControl(null, [Validators.required]),
|
|
- identity_number: new FormControl(null, [Validators.required, Validators.minLength(10)]),
|
|
|
|
|
|
+ identity_number: new FormControl(null,Validators.required),
|
|
position: new FormControl(null, Validators.required),
|
|
position: new FormControl(null, Validators.required),
|
|
email: new FormControl(null, [Validators.required,Validators.email]),
|
|
email: new FormControl(null, [Validators.required,Validators.email]),
|
|
password: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
|
password: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
|
password_confirmation: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
|
password_confirmation: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
|
- phone: new FormControl(null, [Validators.required, Validators.minLength(10)]),
|
|
|
|
|
|
+ phone: new FormControl(null, Validators.required),
|
|
gender: new FormControl(null, Validators.required),
|
|
gender: new FormControl(null, Validators.required),
|
|
birthday: new FormControl(null, Validators.required),
|
|
birthday: new FormControl(null, Validators.required),
|
|
adminstration_id: new FormControl(null, Validators.required),
|
|
adminstration_id: new FormControl(null, Validators.required),
|
|
department_id: new FormControl(null, Validators.required),
|
|
department_id: new FormControl(null, Validators.required),
|
|
nationality_id: new FormControl(null, Validators.required),
|
|
nationality_id: new FormControl(null, Validators.required),
|
|
date_of_employment_gre: new FormControl(null, Validators.required),
|
|
date_of_employment_gre: new FormControl(null, Validators.required),
|
|
- date_of_employment_hij: new FormControl(null, Validators.required),
|
|
|
|
job_title_id: new FormControl(null),
|
|
job_title_id: new FormControl(null),
|
|
specialization_id: new FormControl(null),
|
|
specialization_id: new FormControl(null),
|
|
functional_number: new FormControl(null, Validators.required),
|
|
functional_number: new FormControl(null, Validators.required),
|
|
@@ -270,24 +244,25 @@ export class FormUserComponent implements OnInit {
|
|
staff_id: new FormControl(null),
|
|
staff_id: new FormControl(null),
|
|
status: new FormControl(null, Validators.required),
|
|
status: new FormControl(null, Validators.required),
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ this.spineer.hide();
|
|
|
|
|
|
}else{
|
|
}else{
|
|
//creating edit form user
|
|
//creating edit form user
|
|
this.signupForm = new FormGroup({
|
|
this.signupForm = new FormGroup({
|
|
name: new FormControl(null, Validators.required),
|
|
name: new FormControl(null, Validators.required),
|
|
identity_type_id: new FormControl(null, [Validators.required]),
|
|
identity_type_id: new FormControl(null, [Validators.required]),
|
|
- identity_number: new FormControl(null, [Validators.required, Validators.minLength(10)]),
|
|
|
|
|
|
+ identity_number: new FormControl(null, Validators.required),
|
|
position: new FormControl(null, Validators.required),
|
|
position: new FormControl(null, Validators.required),
|
|
email: new FormControl(null, [Validators.required,Validators.email]),
|
|
email: new FormControl(null, [Validators.required,Validators.email]),
|
|
password: new FormControl(null, [Validators.minLength(6)]),
|
|
password: new FormControl(null, [Validators.minLength(6)]),
|
|
- phone: new FormControl(null, [Validators.required, Validators.minLength(10)]),
|
|
|
|
|
|
+ phone: new FormControl(null, Validators.required),
|
|
gender: new FormControl(null, Validators.required),
|
|
gender: new FormControl(null, Validators.required),
|
|
birthday: new FormControl(null, Validators.required),
|
|
birthday: new FormControl(null, Validators.required),
|
|
adminstration_id: new FormControl(null, Validators.required),
|
|
adminstration_id: new FormControl(null, Validators.required),
|
|
department_id: new FormControl(null, Validators.required),
|
|
department_id: new FormControl(null, Validators.required),
|
|
nationality_id: new FormControl(null, Validators.required),
|
|
nationality_id: new FormControl(null, Validators.required),
|
|
date_of_employment_gre: new FormControl(null, Validators.required),
|
|
date_of_employment_gre: new FormControl(null, Validators.required),
|
|
- date_of_employment_hij: new FormControl(null, Validators.required),
|
|
|
|
job_title_id: new FormControl(null),
|
|
job_title_id: new FormControl(null),
|
|
specialization_id: new FormControl(null),
|
|
specialization_id: new FormControl(null),
|
|
functional_number: new FormControl(null, Validators.required),
|
|
functional_number: new FormControl(null, Validators.required),
|
|
@@ -298,7 +273,16 @@ export class FormUserComponent implements OnInit {
|
|
}
|
|
}
|
|
//catch params to show edit mode
|
|
//catch params to show edit mode
|
|
}
|
|
}
|
|
-//get departmants
|
|
|
|
|
|
+
|
|
|
|
+ //get value date from child component
|
|
|
|
+ public getDate(date: any):void {
|
|
|
|
+ console.log( date);
|
|
|
|
+ this.higriDateVal = date.year + '-' + date.month + '-' + date.day;
|
|
|
|
+ console.log('higrii date', this.higriDateVal);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //get departmants
|
|
getDepartment() {
|
|
getDepartment() {
|
|
const adminstrationId = this.signupForm.get('adminstration_id').value;
|
|
const adminstrationId = this.signupForm.get('adminstration_id').value;
|
|
console.log(adminstrationId);
|
|
console.log(adminstrationId);
|
|
@@ -312,9 +296,17 @@ export class FormUserComponent implements OnInit {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
//submitted form
|
|
//submitted form
|
|
onSubmittedForm() {
|
|
onSubmittedForm() {
|
|
|
|
+
|
|
|
|
+ this.checkSaveDisabled = true;
|
|
const userData = this.signupForm.value;
|
|
const userData = this.signupForm.value;
|
|
|
|
+ userData['date_of_employment_hij'] = this.higriDateVal;
|
|
|
|
+ const birthDate = userData['birthday'].split('-')[0];
|
|
|
|
+ const joinJopYear = userData['date_of_employment_gre'].split('-')[0];
|
|
|
|
+ console.log(joinJopYear);
|
|
|
|
+
|
|
|
|
|
|
if(this.checkChangeImage) {
|
|
if(this.checkChangeImage) {
|
|
userData['photo'] = this.imageBase64;
|
|
userData['photo'] = this.imageBase64;
|
|
@@ -326,22 +318,35 @@ export class FormUserComponent implements OnInit {
|
|
if(this.typeCreatePage == 'user') {
|
|
if(this.typeCreatePage == 'user') {
|
|
|
|
|
|
if(this.signupForm.get('password').value != this.signupForm.get('password_confirmation').value){
|
|
if(this.signupForm.get('password').value != this.signupForm.get('password_confirmation').value){
|
|
- this.toastr.warning('please, check password and confirm password !');
|
|
|
|
- } else if(this.signupForm.get('identity_number').value.substring(0,1) != 1 && this.signupForm.get('identity_type_id').value == 1){
|
|
|
|
|
|
+ this.toastr.warning('من فضلك تأكد أن كلمه المرور هي نفس تأكيد كلمه المرور ');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
|
|
+ } else if(userData['date_of_employment_hij'] == "") {
|
|
|
|
+ this.toastr.warning('من فضلك ، أدخل تاريخ التوظيف الهجري !');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
|
|
+ }else if(this.signupForm.get('identity_number').value.substring(0,1) != 1 && this.signupForm.get('identity_type_id').value == 1){
|
|
this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
|
|
this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
} else if(this.signupForm.get('identity_number').value.substring(0,1) != 2 && this.signupForm.get('identity_type_id').value == 3){
|
|
} else if(this.signupForm.get('identity_number').value.substring(0,1) != 2 && this.signupForm.get('identity_type_id').value == 3){
|
|
this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
|
|
this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
} else if(this.signupForm.get('phone').value.substring(0,2) != '05') {
|
|
} else if(this.signupForm.get('phone').value.substring(0,2) != '05') {
|
|
this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
|
|
this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
|
|
- } else {
|
|
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
|
|
+ } else if(birthDate > joinJopYear) {
|
|
|
|
+ this.toastr.warning('تاريخ التوظيف الميلادي أكبر من تاريخ الميلاد !');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
this.userSer.addUser(userData, 'user').subscribe(
|
|
this.userSer.addUser(userData, 'user').subscribe(
|
|
(responce) => {
|
|
(responce) => {
|
|
console.log(responce);
|
|
console.log(responce);
|
|
this.toastr.success('تم الاضافه بنجاح');
|
|
this.toastr.success('تم الاضافه بنجاح');
|
|
this.location.back();
|
|
this.location.back();
|
|
|
|
+ this.checkSaveDisabled = true;
|
|
},
|
|
},
|
|
(error) => {
|
|
(error) => {
|
|
console.log(error);
|
|
console.log(error);
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
if(error.error['error'].email) {
|
|
if(error.error['error'].email) {
|
|
this.toastr.warning('الايميل تم التسجيل به من قبل !');
|
|
this.toastr.warning('الايميل تم التسجيل به من قبل !');
|
|
} else if(error.error['error'].identity_number) {
|
|
} else if(error.error['error'].identity_number) {
|
|
@@ -351,44 +356,23 @@ export class FormUserComponent implements OnInit {
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|
|
- } else if(this.typeCreatePage == 'joinUs') {
|
|
|
|
-
|
|
|
|
- if(this.signupForm.get('password').value != this.signupForm.get('password_confirmation').value){
|
|
|
|
- this.toastr.warning('please, check password and confirm password !');
|
|
|
|
- } else if(this.signupForm.get('identity_number').value.substring(0,1) != 1 && this.signupForm.get('identity_type_id').value == 1){
|
|
|
|
- this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
|
|
|
|
- } else if(this.signupForm.get('identity_number').value.substring(0,1) != 2 && this.signupForm.get('identity_type_id').value == 3){
|
|
|
|
- this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
|
|
|
|
- } else if(this.signupForm.get('phone').value.substring(0,2) != '05') {
|
|
|
|
- this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
|
|
|
|
- } else {
|
|
|
|
- this.userSer.addUser(userData, 'joinUs').subscribe(
|
|
|
|
- (responce) => {
|
|
|
|
- console.log(responce);
|
|
|
|
- this.toastr.success('تم الاضافه بنجاح');
|
|
|
|
- this.location.back();
|
|
|
|
- },
|
|
|
|
- (error) => {
|
|
|
|
- console.log(error);
|
|
|
|
- if(error.error['error'].email) {
|
|
|
|
- this.toastr.warning('الايميل تم التسجيل به من قبل !');
|
|
|
|
- } else if(error.error['error'].identity_number) {
|
|
|
|
- this.toastr.warning('رقم الهويه تم التسجيل به من قبل !');
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
if(this.typeMode) {
|
|
if(this.typeMode) {
|
|
if(this.typeEditPage == 'editUs') {
|
|
if(this.typeEditPage == 'editUs') {
|
|
userData['id'] = this.userID;
|
|
userData['id'] = this.userID;
|
|
if(this.signupForm.get('identity_number').value.substring(0,1) != 1 && this.signupForm.get('identity_type_id').value == 1){
|
|
if(this.signupForm.get('identity_number').value.substring(0,1) != 1 && this.signupForm.get('identity_type_id').value == 1){
|
|
this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
|
|
this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
} else if(this.signupForm.get('identity_number').value.substring(0,1) != 2 && this.signupForm.get('identity_type_id').value == 3){
|
|
} else if(this.signupForm.get('identity_number').value.substring(0,1) != 2 && this.signupForm.get('identity_type_id').value == 3){
|
|
this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
|
|
this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
|
|
+ } else if(birthDate > joinJopYear) {
|
|
|
|
+ this.toastr.warning('تاريخ التوظيف الميلادي أكبر من تاريخ الميلاد !');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
} else if(this.signupForm.get('phone').value.substring(0,2) != '05') {
|
|
} else if(this.signupForm.get('phone').value.substring(0,2) != '05') {
|
|
this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
|
|
this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
|
|
|
|
+ this.checkSaveDisabled = false;
|
|
} else {
|
|
} else {
|
|
this.userSer.onEditUser(userData, 'user').subscribe(
|
|
this.userSer.onEditUser(userData, 'user').subscribe(
|
|
(responce) => {
|
|
(responce) => {
|
|
@@ -402,32 +386,8 @@ export class FormUserComponent implements OnInit {
|
|
}
|
|
}
|
|
);
|
|
);
|
|
}
|
|
}
|
|
- } else if(this.typeEditPage == 'editJo') {
|
|
|
|
- userData['id'] = this.userID;
|
|
|
|
- console.log('ediit', userData);
|
|
|
|
- if(this.signupForm.get('identity_number').value.substring(0,1) != 1 && this.signupForm.get('identity_type_id').value == 1){
|
|
|
|
- this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
|
|
|
|
- } else if(this.signupForm.get('identity_number').value.substring(0,1) != 2 && this.signupForm.get('identity_type_id').value == 3){
|
|
|
|
- this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
|
|
|
|
- } else if(this.signupForm.get('phone').value.substring(0,2) != '05') {
|
|
|
|
- this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
|
|
|
|
- } else {
|
|
|
|
- this.userSer.onEditUser(userData, 'joinUs').subscribe(
|
|
|
|
- (responce) => {
|
|
|
|
- console.log(responce);
|
|
|
|
- this.toastr.success('تم التعديل بنجاح');
|
|
|
|
- this.location.back();
|
|
|
|
- },
|
|
|
|
- (error) => {
|
|
|
|
- console.log(error);
|
|
|
|
- this.toastr.error('خطأ التعديل');
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
};
|
|
};
|
|
|
|
|
|
getSelectedOptionText(event){
|
|
getSelectedOptionText(event){
|
|
@@ -478,4 +438,5 @@ export class FormUserComponent implements OnInit {
|
|
return this.signupForm.get('password_confirmation');
|
|
return this.signupForm.get('password_confirmation');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
}
|
|
}
|