master issues fixes : ps

This commit is contained in:
venbatechnologies@gmail.com 2018-10-05 20:51:44 +05:30
parent 3a0e22c3fc
commit 0b46834933
29 changed files with 131 additions and 93 deletions

View File

@ -4294,12 +4294,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -4314,17 +4316,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -4441,7 +4446,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -4453,6 +4459,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -4467,6 +4474,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -4474,12 +4482,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -4498,6 +4508,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -4578,7 +4589,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -4590,6 +4602,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -4711,6 +4724,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addBranch()"> + Add Branch</button>
<button mat-stroked-button [color]="color" (click)="addBranch()"> + Add Branch</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addCity()"> + Add City</button>
<button mat-stroked-button [color]="color" (click)="addCity()"> + Add City</button>
</div>
<br>
<div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addCommentsOnLocality()" > + Add Comments On Locality</button>
<button mat-stroked-button [color]="color" (click)="addCommentsOnLocality()" > + Add Comments On Locality</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addCompany()" > + Add Company</button>
<button mat-stroked-button [color]="color" (click)="addCompany()" > + Add Company</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addCustomerBehaviour()" > + Add CustomerBehaviour</button>
<button mat-stroked-button [color]="color" (click)="addCustomerBehaviour()" > + Add CustomerBehaviour</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addCustomerSegment()" > + Add CustomerSegment</button>
<button mat-stroked-button [color]="color" (click)="addCustomerSegment()" > + Add CustomerSegment</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addDesignation()" > + Add Designation</button>
<button mat-stroked-button [color]="color" (click)="addDesignation()" > + Add Designation</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addFrequency()" > + Add Frequency</button>
<button mat-stroked-button [color]="color" (click)="addFrequency()" > + Add Frequency</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addIndustryClassification()" > + Add Industry Classification</button>
<button mat-stroked-button [color]="color" (click)="addIndustryClassification()" > + Add Industry Classification</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addLenderHierarchy()" > + Add LenderHierarchy</button>
<button mat-stroked-button [color]="color" (click)="addLenderHierarchy()" > + Add LenderHierarchy</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addMemberOccupation()" > + Add Member's Occupation</button>
<button mat-stroked-button [color]="color" (click)="addMemberOccupation()" > + Add Member's Occupation</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addPdLocationApproach()" > + Add Pd Location Approach</button>
<button mat-stroked-button [color]="color" (click)="addPdLocationApproach()" > + Add Pd Location Approach</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -69,7 +69,7 @@
</table>
</div>
<br>
@ -87,4 +87,4 @@
</mat-dialog-content>
</div>
</form>
</form>

View File

@ -29,6 +29,7 @@ selectedValueForLender: any;
selectedValueForCity: any;
tempArray: Array<{lenderid: number, cityid: number}> = [];
PDTeamMapping: any[];
AllPDTeamMapData: any[];
PDTeamMaplen:any = 0;
@ -43,15 +44,22 @@ ngOnInit() {
this.PdTeamFormDatas();
if(isNaN(this.data.pdteam_id)){}
else{
this._pdTeamService.getAllPdTeamMapList(this.data.pdteam_id) // note, removed this.countries =
this._pdTeamService.getAllPdTeamMapListWithPK(this.data.pdteam_id) // note, removed this.countries =
.subscribe(
dataresult => {
if(dataresult.dataStatus == true){
this.PDTeamMapping = dataresult.records;
this.PDTeamMaplen = this.PDTeamMapping.length;
}
});
});
}
this._pdTeamService.getAllPdTeamMapList() // note, removed this.countries =
.subscribe(
dataresult => {
if(dataresult.dataStatus == true){
this.AllPDTeamMapData = dataresult.records;
}
});
/** For City Drop Datas*/
this._masterService.getAllMasterData('CITY')
@ -141,40 +149,52 @@ removevalue(i:number) {
if (i !== -1) {
this.tempArray.splice(i, 1);
}
console.log('delete function',this.tempArray);
//console.log('delete function',this.tempArray);
}
doSomething(){
var check = 0 ;
// console.log(this.selectedValueForLender);
// console.log(this.selectedValueForCity);
if((this._pdTeamForm.controls['fk_city_id'].value.city_id != null)
&&(this._pdTeamForm.controls['fk_lender_id'].value.entity_id) != null)
{
this.tempArray.forEach(item => {
if((item.cityid['city_id'] == this._pdTeamForm.controls['fk_city_id'].value.city_id) &&
(item.lenderid['entity_id'] == this._pdTeamForm.controls['fk_lender_id'].value.entity_id))
{
check++;
alert('Already Exists');
}
{
check++;
alert('Already Exists');
}
});
if(this.AllPDTeamMapData !== undefined){
this.AllPDTeamMapData.forEach(item => {
if((item.fk_city_id == this._pdTeamForm.controls['fk_city_id'].value.city_id) &&
(item.fk_lender_id == this._pdTeamForm.controls['fk_lender_id'].value.entity_id))
{
check++;
alert('Already Exists on Other Team "'+item.team_name+'"');
}
});
}
if(isNaN(this.data.pdteam_id)) {}
else{
//console.log(this.PDTeamMapping);
// console.log(this.PDTeamMapping.length);
if(this.PDTeamMapping !== undefined){
this.PDTeamMapping.forEach(item => {
if((item.fk_city_id == this._pdTeamForm.controls['fk_city_id'].value.city_id) &&
(item.fk_lender_id == this._pdTeamForm.controls['fk_lender_id'].value.entity_id))
(item.fk_lender_id == this._pdTeamForm.controls['fk_lender_id'].value.entity_id))
{
check++;
alert('Already Exists');
}
});
}
}
}
}
// this.tempArray.forEach(this.data, function (value, key) {
// if((value.cityid.city_id == this._pdTeamForm.controls['fk_city_id'].value.city_id) &&

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addPdTeam()" > + Add PD Team</button>
<button mat-stroked-button [color]="color" (click)="addPdTeam()" > + Add PD Team</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addPDType()" > + Add PDType</button>
<button mat-stroked-button [color]="color" (click)="addPDType()" > + Add PDType</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addProductMaster()" > + Add Product</button>
<button mat-stroked-button [color]="color" (click)="addProductMaster()" > + Add Product</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addQuestionCategory()" > + Add Question Category</button>
<button mat-stroked-button [color]="color" (click)="addQuestionCategory()" > + Add Question Category</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addregions()" > + Add regions</button>
<button mat-stroked-button [color]="color" (click)="addregions()" > + Add regions</button>
</div>
<br>
<!-- <div *ngIf="loader">
@ -96,17 +96,17 @@
class="example-margin"
matTooltip="Active" matTooltipPosition="above"
checked="true" [color]="color"
(change)="isactiveregions(row.regions_id,row.isactive)"
(change)="isactiveregions(row.region_id,row.isactive)"
onclick="return confirm('Are you sure?')">
</mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveregions(row.regions_id,row.isactive)"
onclick="return confirm('Are you sure?')">
</mat-slide-toggle></ng-template>
</mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveregions(row.region_id,row.isactive)"
onclick="return confirm('Are you sure?')">
</mat-slide-toggle></ng-template>
</mat-cell>
</ng-container>

View File

@ -9,7 +9,7 @@ import { MatDialog,
MatSort,
MatTableDataSource } from '@angular/material';
import 'rxjs/add/operator/map';
/** Service */
import { MastersService } from '../../../../service/masters/masters.service';
/** Dialog Component */
@ -39,22 +39,12 @@ export class RegionsListComponent implements OnInit {
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
ngOnInit() {}
constructor(private dialog: MatDialog,
private _regionsService: MastersService) {
this.getregions();
this.getregions();
}
// get regionsList() {
// return this._regionsService.getAllregions();
// }
//dataSource = new UserDataSource(this._regionsService);
ngOnInit() {
//
}
addregions() {
this.isPopupOpened = true;
@ -78,31 +68,12 @@ this.getregions();
dialogRef.afterClosed().subscribe(result => {
this.getregions();
this.isPopupOpened = false;
});
}
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
isactiveregions(id: number,isactive : number) {
let ActiveDatas = isactive == 0
? { 'region_id':id,'isactive': '1'}
: { 'region_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
this._regionsService.editMasterDetails(ActiveDatas,'REGIONS')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getregions();
}
else{
alert("SomeThing Wents Wrong Try Again !");
}
});
}
//To get data for listing
getregions() {
getregions() {
this._regionsService.getAllMasterData('REGIONS').subscribe(
data => {
if(data.dataStatus == true){
@ -122,12 +93,36 @@ this.getregions();
}
})}
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
isactiveregions(id: number,isactive : number) {
let ActiveDatas = isactive == 0
? { 'region_id':id,'isactive': '1'}
: { 'region_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
this._regionsService.editMasterDetails(ActiveDatas,'REGIONS')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
this.getregions();
}
else{
alert("SomeThing Wents Wrong Try Again !");
}
});
}
deleteregions(id: number) {
var PrimaryKeyWithValue ={'region_id':id};
this._regionsService.deleteMasterDetails(PrimaryKeyWithValue,'REGIONS').subscribe( data => { });
this.getregions();
//this._regionsService.deleteMasterDetails('region_id',id,'REGIONS');
}
/** For Display Tables Pagination And Sorting */
ngAfterViewInit() {
this.dataSource.paginator = this.paginator;

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addRelationShip()" > + Add Relation ship</button>
<button mat-stroked-button [color]="color" (click)="addRelationShip()" > + Add Relation ship</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button color="primary" (click)="addState()" > + Add State</button>
<button mat-stroked-button color="primary" (click)="addState()" > + Add State</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addSubProductMaster()" > + Add Sub Product</button>
<button mat-stroked-button [color]="color" (click)="addSubProductMaster()" > + Add Sub Product</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addTitle()" > + Add Title</button>
<button mat-stroked-button [color]="color" (click)="addTitle()" > + Add Title</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addActivity()" > + Add Activity</button>
<button mat-stroked-button [color]="color" (click)="addActivity()" > + Add Activity</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -1,6 +1,6 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button [color]="color" (click)="addUOM()" > + Add UOM</button>
<button mat-stroked-button [color]="color" (click)="addUOM()" > + Add UOM</button>
</div>
<br>
<!-- <div *ngIf="loader">

View File

@ -66,7 +66,7 @@ return this._http.post<any>(this.apiUrl+"saveMaster", ArrayData)
* 2nd argument is "MasterName" :string - Table Name
*/
editMasterDetails(Records: any,MasterName:string): Observable<any> {
console.log('Service Data',Records);
Records.fk_updatedby = this._aws.getlocale();//to get user id for who is update the record
Records.updatedon = currentdate;//to get Current date and Time for when the Record is updated

View File

@ -144,18 +144,27 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
/** Get All PD Team Child Data using API call With master Keyword */
getAllPdTeamMapList(Primarykey): Observable<any> {
getAllPdTeamMapListWithPK(Primarykey): Observable<any> {
var pk = { "primary_key":Primarykey }
//var Primar = Primarykey
//console.log('FromServiceArrayData',ArrayData);
return this._http.post<any>(this.apiUrl+'getListOfPDTeamMap',pk)
return this._http.post<any>('http://localhost/sparqapi/api/getListOfPDTeamMap',pk)
.pipe(
catchError(this.handleError('role', []))
)
}
/** Get All PD Team Child Data using API call With master Keyword */
getAllPdTeamMapList(): Observable<any> {
return this._http.post<any>('http://localhost/sparqapi/api/getListOfPDTeamMap','')
.pipe(
catchError(this.handleError('role', []))
)
}
/**