diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts index d3e1ac557..f22985fb0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/map-pd-view/map-pd-view.component.ts @@ -21,6 +21,7 @@ export class MapPdViewComponent implements OnInit, OnDestroy { lng:string mapDetails:any[] = []; recordStatus: boolean; + noRecordFound: boolean = true; errorMessage: any; // pagination variable details length = 50; diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-add/pd-team-add.component.html b/ng6-seed/src/app/settings/pd-team/pd-team-add/pd-team-add.component.html index f34cb0948..58d91ba13 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-add/pd-team-add.component.html +++ b/ng6-seed/src/app/settings/pd-team/pd-team-add/pd-team-add.component.html @@ -13,14 +13,16 @@
- You must Include Team Name. + + Team Name Requried. {{ ld.short_name }} {{ ld.full_name }} - You must Select Lender Name. + + Lender Name Requried.
@@ -30,7 +32,8 @@ {{ cd.name }} - You must Select Cities. + + City Name Requried.
The Selected Cities are.,
@@ -49,7 +52,8 @@ {{ pd.name }} - You must Select Product. + + Product Name Requried.
The Selected Products are.,
@@ -66,7 +70,9 @@ {{csd.name}} - You must Select Customer Segment. + + CustomerSegment Name Requried. +
The Selected Customer segment are.,
@@ -78,7 +84,7 @@
- +
diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-add/pd-team-add.component.ts b/ng6-seed/src/app/settings/pd-team/pd-team-add/pd-team-add.component.ts index e58143060..f81dedde9 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-add/pd-team-add.component.ts +++ b/ng6-seed/src/app/settings/pd-team/pd-team-add/pd-team-add.component.ts @@ -15,7 +15,6 @@ import { Router } from '@angular/router'; import { empty } from 'rxjs'; /**sweet alert */ import Swal from 'sweetalert2'; - @Component({ selector: 'app-pd-team-add', templateUrl: './pd-team-add.component.html', @@ -25,7 +24,7 @@ export class PdTeamAddComponent implements OnInit { public _pdTeamForm: FormGroup; private notifier: NotifierService; -public submitted = false; +//public submitted = false; color = 'primary'; errorMessage:string; @@ -46,12 +45,12 @@ selectedProductDatas : any=[]; selectedSegmentDatas : any=[]; constructor(private _formBuilder: FormBuilder, - private _notifier: NotifierService, + notifier: NotifierService, private _pdTeamService: PdTeamService, private _router: Router, private _masterService: MastersService) { - this.notifier = _notifier; + this.notifier = notifier; } @@ -110,7 +109,7 @@ this._masterService.getAllMasterData('CUSTOMERSEGMENT').subscribe( /** Pd Team Form Datas */ PdTeamFormDatas(){ this._pdTeamForm = this._formBuilder.group({ - pdteam_id: [null, Validators.compose([Validators.required])], + //pdteam_id: [null, Validators.compose([Validators.required])], team_name: [null, Validators.compose([Validators.required])], fk_lender: [null, Validators.compose([Validators.required])], fk_city: [null, Validators.compose([Validators.required])], @@ -131,29 +130,25 @@ onNoClick(): void { /** To Save/Edited Popup Data */ onSubmit() { - this.submitted = true; - var pdTeamFormValues = this._pdTeamForm.value; - Object.keys(pdTeamFormValues).forEach( - (key) => ( pdTeamFormValues[key] == null) && delete pdTeamFormValues[key]); - // stop here if form is invalid - // if (pdTeamFormValues.invalid) { - // // this.errorMessage = "Please Fill All Mandate Fields."; - // // return; - // alert('Please Fill All Mandate Fields.'); - // } else { - - + var pdTeamFormValues = this._pdTeamForm.value; + //stop here if form is invalid + if (pdTeamFormValues.invalid) { + alert('Please Fill All Mandate Fields.'); + } else { + + Object.keys(pdTeamFormValues).forEach( + (key) => ( pdTeamFormValues[key] == null) && delete pdTeamFormValues[key]); + //To Remove The "Null" With Key also this._pdTeamService.addPdTeamDetail(this._pdTeamForm.value).subscribe( dataresult => { if (dataresult.status == 200) { - - this.notifier.notify('success', 'Record Edited Successfully.!'); - Swal('Success.!'); - this._router.navigate(['/setting/pdteam/pdteamlist']); + //this.notifier.notify('success', 'Record Saved Successfully.!'); + Swal('Record Saved Successfully.!','success'); this._pdTeamForm.reset(); + this._router.navigate(['/setting/pdteam/pdteamlist']); } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); @@ -162,7 +157,7 @@ onSubmit() { //this.errorMessage = "Some Thing Wents Wrong Try Again !"; } }); - + } } @@ -197,7 +192,7 @@ onChangeCityDatas($event){ for(let data of dup_cityname){ if(data.name == cityName.name){ - Swal('
"'+data.name+'" already existing with "'+ teamname +'"
'); + alert('"'+data.name+'" Already Existing with "'+ teamname +'"'); $event.source._selected = false; mycheck++; } diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.html b/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.html index 6feb49934..4b699ce97 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.html +++ b/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.html @@ -51,22 +51,13 @@ Active - - - - - + class="example-margin" [color]="color" + [checked] ="row.isactive==1?true:false" + [matTooltip]="row.isactive==1?'Active':'Inactive'" + matTooltipPosition="above" + (click)="isactivePdTeam(row.pdteam_id,row.isactive)"> + @@ -86,6 +77,10 @@ + + + + diff --git a/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.ts b/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.ts index 378307360..5ae66f824 100644 --- a/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.ts +++ b/ng6-seed/src/app/settings/pd-team/pd-team-list/pd-team-list.component.ts @@ -30,6 +30,8 @@ export class PdTeamListComponent implements OnInit { //Variable Declaration part isPopupOpened: boolean = true; loader: boolean = false; + SwalButtonText: string; + SwalMessage: string; PdTeamList: any = []; color = 'primary'; pageSize = 10; @@ -102,61 +104,49 @@ managepdteam(){ } }) } +isactivePdTeam(id: number,isactive : number) { - /** For Changing Active States., which means both Changing Active And Inactive alternatively */ - isactivePdTeam(id: number,isactive : number) { - - let ActiveDatas = isactive == 0 + let ActiveDatas = isactive == 0 ? { 'pdteam_id':id,'isactive': '1'} : { 'pdteam_id':id,'isactive': '0'} - this._MasterService.editMasterDetails(ActiveDatas,'PDTEAM') - .subscribe(dataresult=>{ - if (dataresult.dataStatus == true){ - //alert("my check"); - this.getPdTeam(); - } - else{ - alert("SomeThing Wents Wrong Try Again !"); - } - }); -} - //Sweetalert2 for active and deactive -active(){ + //if is active '1' have TO deactive So deactive messages + if(isactive == 1){ + this.SwalButtonText = 'Yes, deactivate it!'; + this.SwalMessage = 'Deactivated!'; + } + else{ + this.SwalButtonText = 'Yes, activate it!'; + this.SwalMessage = 'Activated!'; + } + Swal({ - title: 'Are you sure?', - type: 'warning', - showCancelButton: true, - confirmButtonColor: '#3085d6', - cancelButtonColor: '#d33', - confirmButtonText: 'Yes, activate it!' - }).then((result) => { - if (result.value) { - Swal( - 'Activated!', - 'success' - ) + title: 'Are you sure?', + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: this.SwalButtonText + }).then((result) => { + if (result.value) { + this._MasterService.editMasterDetails(ActiveDatas,'PDTEAM') + .subscribe(dataresult=>{ + if (dataresult.dataStatus == true){ + Swal(this.SwalMessage,'success'); + this.getPdTeam(); + } + else{ + Swal("Sorry Try Again !"); + } + }); + } + else{ + this.getPdTeam(); + } + }) } - }) -} -deactive() -{ - Swal({ - title: 'Are you sure?', - type: 'warning', - showCancelButton: true, - confirmButtonColor: '#3085d6', - cancelButtonColor: '#d33', - confirmButtonText: 'Yes, deactivate it!' - }).then((result) => { - if (result.value) { - Swal( - 'Deactivated!', - 'success' - ) - } - }) -} + + /** For Display Tables Pagination And Sorting */ ngAfterViewInit() { this.dataSource.paginator = this.paginator; diff --git a/ng6-seed/src/app/template/questions/add/add.component.html b/ng6-seed/src/app/template/questions/add/add.component.html index 029b2a39b..e6f7dff30 100644 --- a/ng6-seed/src/app/template/questions/add/add.component.html +++ b/ng6-seed/src/app/template/questions/add/add.component.html @@ -11,10 +11,10 @@
- + {{ ct.category_name }} - You must Select Category. + You must Select Category.
diff --git a/ng6-seed/src/app/template/questions/add/add.component.ts b/ng6-seed/src/app/template/questions/add/add.component.ts index c8824cd9e..657254038 100644 --- a/ng6-seed/src/app/template/questions/add/add.component.ts +++ b/ng6-seed/src/app/template/questions/add/add.component.ts @@ -61,7 +61,7 @@ export class AddComponent implements OnInit { this._addQuesFrom = this._formBuilder.group({ question: [null, Validators.compose([Validators.required])], description: [null, Validators.compose([Validators.required])], - fk_question_catagory: [null, Validators.compose([Validators.required])], + fk_question_category: [null, Validators.compose([Validators.required])], fk_question_answertype: [null, Validators.compose([Validators.required])], answers: this._formBuilder.array([ this.initAnswers(), diff --git a/ng6-seed/src/app/template/questions/edit/edit.component.html b/ng6-seed/src/app/template/questions/edit/edit.component.html index caa24924f..1dc628246 100644 --- a/ng6-seed/src/app/template/questions/edit/edit.component.html +++ b/ng6-seed/src/app/template/questions/edit/edit.component.html @@ -12,10 +12,10 @@
- + {{ ct.category_name }} - You must Select Category. + You must Select Category.
diff --git a/ng6-seed/src/app/template/questions/edit/edit.component.ts b/ng6-seed/src/app/template/questions/edit/edit.component.ts index 20dd63a40..cd8fddab7 100644 --- a/ng6-seed/src/app/template/questions/edit/edit.component.ts +++ b/ng6-seed/src/app/template/questions/edit/edit.component.ts @@ -90,7 +90,7 @@ export class EditComponent implements OnInit { question_id: [this.data.question_id], question: [this.data.question, Validators.compose([Validators.required])], description: [this.data.description, Validators.compose([Validators.required])], - fk_question_catagory: [this.data.fk_question_catagory, Validators.compose([Validators.required])], + fk_question_category: [this.data.fk_question_category, Validators.compose([Validators.required])], fk_question_answertype: [this.data.fk_question_answertype, Validators.compose([Validators.required])], isactive: [this.data.isactive], answers: this._formBuilder.array([