From d706ece7b6968482e630f2a82349c944f7d122ec Mon Sep 17 00:00:00 2001 From: ashwaq Date: Tue, 17 Mar 2020 17:10:25 +0300 Subject: [PATCH] fix --- .../vacation-type/vacation-type.component.ts | 29 ++++++++++++++----- Mohem/src/assets/localization/i18n.json | 9 ++++++ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts index 04823ce6..4a3cc594 100644 --- a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts +++ b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts @@ -299,7 +299,8 @@ export class VacationTypeComponent implements OnInit { else{ - alert("please select vaction rule"); + let msg = this.ts.trPK('vacation-rule', 'fill-vacation-type'); + this.cs.presentAlert(msg); } }//////////////////////////////// @@ -617,16 +618,20 @@ ApplyFunc() { } }); let msg: string = ""; - if (this.notifTypeSel == undefined) { + if (this.notifTypeSel == undefined ) { msg = this.ts.trPK('vacation-rule', 'fillAction'); this.cs.presentAlert(msg); - } else if (this.msgVal == undefined) { + } else if (this.msgVal == undefined ) { msg = this.ts.trPK('vacation-rule', 'fillMsg'); this.cs.presentAlert(msg); - } else if (this.Sdate == undefined) { + } else if (this.Sdate == undefined || this.Sdate == '') { msg = this.ts.trPK('vacation-rule', 'fillSDate'); this.cs.presentAlert(msg); + }else if (this.Edate == undefined || this.Edate =='') { + msg = this.ts.trPK('vacation-rule', 'fillEDate'); + this.cs.presentAlert(msg); } + // else if (this.selEmployeeID == undefined) { // msg = this.ts.trPK('vacation-rule', 'fillReplacement'); // this.cs.presentAlert(msg); @@ -730,13 +735,23 @@ updateVacationRule() { } }); let msg: string = ""; - if (this.notifTypeSel == undefined) { + if (this.notifTypeSel == undefined ) { msg = this.ts.trPK('vacation-rule', 'fillAction'); + this.cs.presentAlert(msg); + } else if (this.msgVal == undefined) { msg = this.ts.trPK('vacation-rule', 'fillMsg'); - } else if (this.Sdate == undefined) { + this.cs.presentAlert(msg); + + } else if (this.Sdate == undefined || this.Sdate == '') { msg = this.ts.trPK('vacation-rule', 'fillSDate'); - } else { + this.cs.presentAlert(msg); + + }else if (this.Edate == undefined || this.Edate =='') { + msg = this.ts.trPK('vacation-rule', 'fillEDate'); + this.cs.presentAlert(msg); + } + else { var responseAttrDic = this.exampleJsonObject; this.P_RESPOND_ATTRIBUTES_TBL = []; for (let key in responseAttrDic) { diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 63efad4b..d219a9d4 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -1275,6 +1275,10 @@ "en": "Please fill start date", "ar": "يرجى ملء تاريخ البدء" }, + "fillEDate": { + "en": "Please fill End date", + "ar": "يرجى ملء تاريخ النهاية" + }, "fillAction": { "en": "Please fill action field", "ar": "يرجى ملء حقل العمل" @@ -1283,6 +1287,11 @@ "en": "Please select a replacement ", "ar": "يرجى إختيار بديل" }, + + "fill-vacation-type": { + "en": "Please select a Vacation Type", + "ar": "يرجى إختيار نوع العطلة" + }, "deliver": { "en": "Deliver notifications to me regardless of any general rules", "ar": "تسليم الإخطارات لي بغض النظر عن أي قواعد عامة"