diff --git a/ng6-seed/src/app/AwsService/aws.service.ts b/ng6-seed/src/app/AwsService/aws.service.ts
index 745763590..c915fa886 100755
--- a/ng6-seed/src/app/AwsService/aws.service.ts
+++ b/ng6-seed/src/app/AwsService/aws.service.ts
@@ -51,7 +51,8 @@ const sineedgeIdentity = "ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";//"ap
const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907";
const vendorIdenttiy = "";
// serviceProvider
-const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
+ const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
+//const apiurl = "http://localhost/sparqapi/api/";
@Injectable({
providedIn: "root"
diff --git a/ng6-seed/src/app/AwsService/cognito.service.ts b/ng6-seed/src/app/AwsService/cognito.service.ts
index 33bcc3b64..52ff48707 100644
--- a/ng6-seed/src/app/AwsService/cognito.service.ts
+++ b/ng6-seed/src/app/AwsService/cognito.service.ts
@@ -39,7 +39,9 @@ const sineedgeIdentity = "ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";//"ap
const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907";
const vendorIdenttiy = "";
// serviceProvider
-const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
+ const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
+//const apiurl = "http://localhost/sparqapi/api/";
+
export interface Callback {
callback(): void;
diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html
index 31947f667..ac5acaaae 100644
--- a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html
+++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html
@@ -16,7 +16,7 @@
Sl
- {{i+1}}
+ {{i+1}}
-
Occupation of Non earning members
-
-
+fxLayout="row">
+
Occupation of Non earning members
+
diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts
index ddec6a778..36e91baf7 100644
--- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts
+++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts
@@ -102,7 +102,7 @@ export class MembersOccupationListComponent implements OnInit {
this._memberService.getAllMasterData('OCCUPATIONMEMBERS').subscribe(
data => {
- if(data.status === 200){
+ if(data.dataStatus == true){
this.noRecordFound = false;
this.userData = data.records;
this.dataLength = data.records.length;
diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html
index adce34a0c..73929e94a 100644
--- a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html
+++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html
@@ -6,67 +6,14 @@
-
-
+
-
-
-
+
Sl
@@ -81,36 +28,49 @@
PD Allocation Logic
{{row.pd_allocation_logic}}
-
-
+
+
-
- Default
-
+
+
+
+ Default
+
+
+
+
+
+
+
+
+
-
-
-
-
+
diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss
index 9a6e69625..860d6b073 100644
--- a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss
+++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss
@@ -118,11 +118,6 @@
font-size: 16px;
text-align: center;
}
-.active:hover{
- color: green;
- font-size: 20px;
-}
-.deactive:hover{
- color: red;
- font-size: 20px;
+.example-margin {
+ margin: 10px;
}
\ No newline at end of file
diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts
index 4429b8f4e..a7ac8c42d 100644
--- a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts
+++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts
@@ -1,17 +1,17 @@
-import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
-import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
-
-import { Observable, Subject } from 'rxjs';
-import { Http, Response } from '@angular/http';
-import 'rxjs/add/operator/map';
-
-import { DataSource } from '@angular/cdk/collections';
-import { map } from 'rxjs/operators';
-import { of as observableOf, merge } from 'rxjs';
-
-
+/** Common Imports */
+import { Component,
+ OnInit,
+ OnDestroy,
+ ViewChild } from '@angular/core';
+import { MatDialog,
+ MatDialogRef,
+ MatDialogConfig,
+ MatPaginator,
+ MatSort,
+MatTableDataSource } from '@angular/material';
+/** Service */
import { MastersService } from '../../../../service/masters/masters.service';
-import { PdAllocationTypeDialogComponent } from '../pd-allocation-type-dialog/pd-allocation-type-dialog.component';
+/** Model */
import { PdAllocationType } from '../../../model/pd';
@@ -22,73 +22,38 @@ import { PdAllocationType } from '../../../model/pd';
})
export class PdAllocationTypeListComponent implements OnInit {
- isPopupOpened = true;
+ //isPopupOpened = true;
loader: boolean = false;
PDAllocationTypeList: any = [];
-
noRecordFound: boolean = false;
-
userData = null;
-
+ defaultdatas : any = [];
+ defdatas : any = [];
+
+
public dataLength: number;
public dataSource = new MatTableDataSource();
//displayedColumns = ['SerialNo','PDALLOCATIONTYPE','pdallocationlogic','IsActive'];
- displayedColumns = ['serialno','pd_allocation_type_name','isactive','pd_allocation_logic','default'];
+ displayedColumns = ['serialno','pd_allocation_type_name','pd_allocation_logic','default'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
- constructor(private dialog: MatDialog,
- private _MastersService: MastersService) {
- this.getPDAllocationType();
-
-
+ constructor(private _MastersService: MastersService) {
+ this.getPDAllocationType();
}
- // get PDAllocationTypeList() {
- // return this._MastersService.getAllPDAllocationType();
- // }
+ ngOnInit() {}
+
- //dataSource = new UserDataSource(this._MastersService);
- ngOnInit() {
-
- }
-
-
- addPDAllocationType() {
- this.isPopupOpened = true;
- const dialogRef = this.dialog.open(PdAllocationTypeDialogComponent, {
- data: {}
- });
-
-
- dialogRef.afterClosed().subscribe(result => {
- this.getPDAllocationType();
- this.isPopupOpened = false;
- });
- }
-
- editPDAllocationType(arr: any[]) {
- this.isPopupOpened = true;
- //const contact = this._MastersService.getAllPDAllocationType().find(c => c.ID === id);
- const dialogRef = this.dialog.open(PdAllocationTypeDialogComponent, {
- data: arr
- });
-
-
- dialogRef.afterClosed().subscribe(result => {
- this.getPDAllocationType();
- this.isPopupOpened = false;
- });
- }
-
+
//To get data for listing
getPDAllocationType() {
this._MastersService.getAllMasterData('PDALLOCATIONTYPE').subscribe(
data => {
- if(data.status === 200){
+ if(data.dataStatus == true){
this.noRecordFound = false;
this.userData = data.records;
this.dataLength = data.records.length;
@@ -100,12 +65,48 @@ export class PdAllocationTypeListComponent implements OnInit {
})
}
- deletePDAllocationType(id: number) {
- var PrimaryKeyWithValue ={'pd_allocation_type_id':id};
- this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDALLOCATIONTYPE')
- .subscribe( data => { this.getPDAllocationType();})
- //this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDALLOCATIONTYPE');
- }
+ /** For Changing Default Value.,
+ * To Set Value Default Value '1' For Only One Record
+ * And Remaining All are set to '0'
+ */
+ defaultPDAllocationType(id: number){
+
+ var defaultDatas = [];//Empty array to store defaultDatas
+
+ defaultDatas.push({'pd_allocation_type_id':id,'default': 1});
+
+ this._MastersService.getAllMasterData('PDALLOCATIONTYPE').subscribe(
+ data => {
+ if(data.dataStatus == true){
+ let allDefaultDatas = data.records;
+ allDefaultDatas = allDefaultDatas.filter(Datas=>Datas.default == 1 );
+
+ allDefaultDatas.forEach((item, index) => {
+ // console.log('id',item.pd_allocation_type_id);
+ // console.log('value',item.default);
+ let dataChanges = {
+ pd_allocation_type_id:item.pd_allocation_type_id,
+ default:0
+ };
+ defaultDatas.push(dataChanges);
+ });
+ }
+ });
+
+ //console.log(defaultDatas);
+
+ this._MastersService.editMasterDetails(defaultDatas,'PDALLOCATIONTYPE')
+ .subscribe(dataresult=>{
+ if (dataresult.dataStatus == true){
+ //alert("my check");
+ this.getPDAllocationType();
+ }
+ else{
+ alert("SomeThing Wents Wrong Try Again !");
+ }
+ });
+}
+
/** For Display Tables Pagination And Sorting */
ngAfterViewInit() {
this.dataSource.paginator = this.paginator;
@@ -120,19 +121,4 @@ applyFilter(filterValue: string) {
}
}
-
-export class UserDataSource extends DataSource {
-
-
- constructor(private _bs: MastersService) {
- super();
- }
-
- connect(): Observable {
- //return this.userService.getUser();
- //return this._bs.getAllPDAllocationType();
- return this._bs.getAllMasterData('PDALLOCATIONTYPE');
- }
- disconnect() {}
-}
-
+/**End Of List Component */
\ No newline at end of file
diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html
index 8108ea0ae..5a29d76e9 100644
--- a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html
+++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html
@@ -16,8 +16,8 @@
-
PD Location Approach
-
+
PD Location Approach
+
diff --git a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html
index fe64fd52f..1f75ab2cf 100644
--- a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html
+++ b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html
@@ -16,8 +16,7 @@
-
Product Details
-
+
Product Details
diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html
index 9b0efdbf0..40a463c7d 100644
--- a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html
+++ b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html
@@ -16,9 +16,9 @@
-
Region
-
-
diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html
index 3e5e20681..e2d4e0529 100644
--- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html
+++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html
@@ -16,9 +16,9 @@
-
Relation Ship
-
-
+
Relation Ship
+
+
diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html
index ef4b96dc5..840cbfd1d 100644
--- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html
+++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html
@@ -17,9 +17,8 @@
-
Sub Product Details
-
-
+
Sub Product Details
+
@@ -31,7 +30,6 @@ fxLayoutAlign="center">