|
|
|
|
@ -22,14 +22,15 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
public pageSize = 1;
|
|
|
|
|
public pageLength = 0;
|
|
|
|
|
public lengthCounter = 5;
|
|
|
|
|
public detialData: {
|
|
|
|
|
id: number,
|
|
|
|
|
title_EN: string,
|
|
|
|
|
title_AR: string,
|
|
|
|
|
body_EN: string,
|
|
|
|
|
body_AR: string,
|
|
|
|
|
img?: string,
|
|
|
|
|
date: Date};
|
|
|
|
|
public detailData: {
|
|
|
|
|
id: number,
|
|
|
|
|
title_EN: string,
|
|
|
|
|
title_AR: string,
|
|
|
|
|
body_EN: string,
|
|
|
|
|
body_AR: string,
|
|
|
|
|
img?: string,
|
|
|
|
|
date: Date
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public announcementService: AnnouncementService,
|
|
|
|
|
@ -63,21 +64,21 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
holdData = JSON.parse(result.Mohemm_ITG_ResponseItem);
|
|
|
|
|
data = JSON.parse(holdData.result.data)[0];
|
|
|
|
|
data = holdData.result.data[0];
|
|
|
|
|
console.log(data);
|
|
|
|
|
this.detialData = {
|
|
|
|
|
this.detailData = {
|
|
|
|
|
id: data.rowID,
|
|
|
|
|
title_EN: data.Title_EN,
|
|
|
|
|
title_AR: data.Title_AR,
|
|
|
|
|
body_EN: data.Body_EN,
|
|
|
|
|
body_AR: data.Body_AR,
|
|
|
|
|
title_EN: data.titleEn,
|
|
|
|
|
title_AR: data.titleAr,
|
|
|
|
|
body_EN: data.descriptionEn,
|
|
|
|
|
body_AR: data.descriptionAr,
|
|
|
|
|
date: data.created,
|
|
|
|
|
img: data.Banner_Image
|
|
|
|
|
img: data.imageContent
|
|
|
|
|
};
|
|
|
|
|
element.isOpen = !element.isOpen;
|
|
|
|
|
// this.common.stopLoading();
|
|
|
|
|
}
|
|
|
|
|
console.log(this.detialData);
|
|
|
|
|
console.log(this.detailData);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
element.isOpen = false;
|
|
|
|
|
@ -86,7 +87,7 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
closeAnnouncement(item){
|
|
|
|
|
closeAnnouncement(item) {
|
|
|
|
|
item.isOpen = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -97,24 +98,24 @@ export class AnnouncementComponent implements OnInit {
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
holdData = JSON.parse(result.Mohemm_ITG_ResponseItem);
|
|
|
|
|
this.listOfAnnouncement = JSON.parse(holdData.result.data);
|
|
|
|
|
this.listOfAnnouncement = holdData.result.data;
|
|
|
|
|
this.pageLength = this.listOfAnnouncement[0].TotalItems;
|
|
|
|
|
for (let i = 0; i < this.listOfAnnouncement.length; i++) {
|
|
|
|
|
this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN;
|
|
|
|
|
this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].Title_AR;
|
|
|
|
|
this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].EmailBody_EN;
|
|
|
|
|
this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].EmailBody_AR;
|
|
|
|
|
this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].titleEn;
|
|
|
|
|
this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].titleAr;
|
|
|
|
|
this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].descriptionEn;
|
|
|
|
|
this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].descriptionAr;
|
|
|
|
|
this.arr[i] = {
|
|
|
|
|
id: this.listOfAnnouncement[i].rowID,
|
|
|
|
|
title_EN: this.listOfAnnouncement[i].Title_EN,
|
|
|
|
|
title_AR: this.listOfAnnouncement[i].Title_AR,
|
|
|
|
|
body_EN: this.listOfAnnouncement[i].EmailBody_EN,
|
|
|
|
|
body_AR: this.listOfAnnouncement[i].EmailBody_AR,
|
|
|
|
|
title_EN: this.listOfAnnouncement[i].titleEn,
|
|
|
|
|
title_AR: this.listOfAnnouncement[i].titleAr,
|
|
|
|
|
body_EN: this.listOfAnnouncement[i].descriptionEn,
|
|
|
|
|
body_AR: this.listOfAnnouncement[i].descriptionAr,
|
|
|
|
|
date: this.listOfAnnouncement[i].created,
|
|
|
|
|
img: this.listOfAnnouncement[i].Banner_Image,
|
|
|
|
|
img: this.listOfAnnouncement[i].imageContent,
|
|
|
|
|
isopen: false
|
|
|
|
|
};
|
|
|
|
|
if ( i < this.numberOfListLength){
|
|
|
|
|
if (i < this.numberOfListLength) {
|
|
|
|
|
this.announcementList.push(this.arr[i]);
|
|
|
|
|
}
|
|
|
|
|
this.arrList.push(this.arr[i]);
|
|
|
|
|
|