diff --git a/api/application/config/constants.php b/api/application/config/constants.php index 39168c80..8cd2f240 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -125,6 +125,10 @@ defined('FREQUENCYID') OR define('FREQUENCYID','frequency_id'); defined('CUSTOMERBEHAVIOUR') OR define('CUSTOMERBEHAVIOUR','m_customer_behaviour'); defined('CUSTOMERBEHAVIOURID') OR define('CUSTOMERBEHAVIOURID','customer_behaviour_id'); +defined('CUSTOMERSEGMENT') OR define('CUSTOMERSEGMENT','m_customer_segment'); +defined('CUSTOMERSEGMENTID') OR define('CUSTOMERSEGMENTID','customer_segment_id'); + + defined('REGIONS') OR define('REGIONS','m_regions'); defined('REGIONSID') OR define('REGIONSID','region_id'); @@ -137,10 +141,19 @@ defined('CITYID') OR define('CITYID','city_id'); defined('BRANCH') OR define('BRANCH','m_branch'); defined('BRANCHID') OR define('BRANCHID','branch_id'); +defined('PDALLOCATIONTYPE') OR define('PDALLOCATIONTYPE','m_pd_allocation_type'); +defined('PDALLOCATIONTYPEID') OR define('PDALLOCATIONTYPEID','pd_allocation_type_id'); + defined('PDLOCATIONAPPROACH') OR define('PDLOCATIONAPPROACH','m_pd_location_approach'); defined('PDLOCATIONAPPROACHID') OR define('PDLOCATIONAPPROACHID','pd_location_approach_id'); -defined('LISTOFMASTERS') OR define('LISTOFMASTERS','m_list_of_masters'); +defined('PDSTATUS') OR define('PDSTATUS','m_pd_status'); +defined('PDSTATUSID') OR define('PDSTATUSID','pd_status_id'); + +defined('PDTYPE') OR define('PDTYPE','m_pd_type'); +defined('PDTYPEID') OR define('PDTYPEID','pd_type_id'); + +defined('LISTOFMASTERS') OR define('LISTOFMASTERS','c_list_of_masters'); defined('LISTOFMASTERSID') OR define('LISTOFMASTERSID','master_id'); defined('COMMENTSONLOCALITY') OR define('COMMENTSONLOCALITY','m_comments_on_locality'); diff --git a/api/application/controllers/Common_masters_Controller.php b/api/application/controllers/Common_Masters_Controller.php similarity index 99% rename from api/application/controllers/Common_masters_Controller.php rename to api/application/controllers/Common_Masters_Controller.php index 386eb852..86a549e8 100644 --- a/api/application/controllers/Common_masters_Controller.php +++ b/api/application/controllers/Common_Masters_Controller.php @@ -981,7 +981,7 @@ class Common_Masters_Controller extends REST_Controller { //echo $table_name; $result = $this->Common_Masters_Model->selectRecords(constant($table_name)); //print_r($result); - die(); + //die(); if(count($result) > 0) { $data['dataStatus'] = true; diff --git a/api/application/libraries/SPARQ_Model.php b/api/application/libraries/SPARQ_Model.php index 9be45c5e..e44a5197 100644 --- a/api/application/libraries/SPARQ_Model.php +++ b/api/application/libraries/SPARQ_Model.php @@ -27,11 +27,11 @@ class SPARQ_Model extends CI_Model { public function selectRecords($table_name,$where_condition_array = array(),$print_query = '') { - echo $print_query; - echo $table_name; + // echo $print_query; + // echo $table_name; $data = $this->db->get_where($table_name,$where_condition_array)->result_array();//only AND condition - print_r($data); + //print_r($data); if($print_query == 1) { print_r($this->db->last_query()); diff --git a/api/application/models/Entity_Management_Model.php b/api/application/models/Entity_Management_Model.php index 3b909d32..c1750f34 100644 --- a/api/application/models/Entity_Management_Model.php +++ b/api/application/models/Entity_Management_Model.php @@ -14,7 +14,7 @@ class Entity_Management_Model extends SPARQ_Model { { $result_data = array(); - $this->db->SELECT('ENTITY.entity_id, ENTITY.full_name, ENTITY.short_name, ENTITY.fk_region,REGIONS.name as region_name, ENTITY.fk_state,STATE.name as state_name, ENTITY.fk_city,CITY.name as city_name, ENTITY.fk_branch,BRANCH.name as branch_name, ENTITY.addressline1, ENTITY.addressline2, ENTITY.official_email, ENTITY.alt_email, ENTITY.phone_number, ENTITY.mobile_no, ENTITY.remarks, ENTITY.createdon, ENTITY.fk_createdby,concat(USERPROFILE.first_name,' ',USERPROFILE.last_name) as createdby, ENTITY.updatedon, ENTITY.fk_updatedby,concat(USERPROFILE1.first_name,' ',USERPROFILE1.last_name) as updatedby, ENTITY.isactive, ENTITY.pan, ENTITY.gst_no, ENTITY.gst_state_code, addressline3, ENTITY.tat, ENTITY.fk_entity_type_id,ENTITYTYPE.name as entity_name'); + $this->db->SELECT('ENTITY.entity_id, ENTITY.full_name, ENTITY.short_name, ENTITY.fk_region,REGIONS.name as region_name, ENTITY.fk_state,STATE.name as state_name, ENTITY.fk_city,CITY.name as city_name, ENTITY.fk_branch,BRANCH.name as branch_name, ENTITY.addressline1, ENTITY.addressline2, ENTITY.official_email, ENTITY.alt_email, ENTITY.phone_number, ENTITY.mobile_no, ENTITY.remarks, ENTITY.createdon, ENTITY.fk_createdby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby, ENTITY.updatedon, ENTITY.fk_updatedby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, ENTITY.isactive, ENTITY.pan, ENTITY.gst_no, ENTITY.gst_state_code, addressline3, ENTITY.tat, ENTITY.fk_entity_type_id,ENTITYTYPE.name as entity_name'); $this->db->FROM(ENTITY.' as ENTITY'); $this->db->JOIN(REGIONS.' as REGIONS','ENTITY.fk_region = REGIONS.region_id AND REGIONS.isactive = 1'); $this->db->JOIN(STATE.' as STATE','ENTITY.fk_state = STATE.state_id AND STATE.isactive = 1'); @@ -29,7 +29,7 @@ class Entity_Management_Model extends SPARQ_Model { foreach($result as $key => $r) { - $this->db->SELECT('ENTITYCHILD.entity_child_id,ENTITYCHILD.contact_person,ENTITYCHILD.contact_email,ENTITYCHILD.contact_mobile_no,ENTITYCHILD.contact_person,ENTITYCHILD.isactive,ENTITYCHILD.createdon,ENTITYCHILD.fk_createdby,concat(USERPROFILE.first_name,' ',USERPROFILE.last_name) as createdby,ENTITYCHILD.updatedon,ENTITYCHILD.fk_updatedby,concat(USERPROFILE1.first_name,' ',USERPROFILE1.last_name) as updatedby'); + $this->db->SELECT('ENTITYCHILD.entity_child_id,ENTITYCHILD.contact_person,ENTITYCHILD.contact_email,ENTITYCHILD.contact_mobile_no,ENTITYCHILD.contact_person,ENTITYCHILD.isactive,ENTITYCHILD.createdon,ENTITYCHILD.fk_createdby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,ENTITYCHILD.updatedon,ENTITYCHILD.fk_updatedby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby'); $this->db->FROM(ENTITYCHILD.' as ENTITYCHILD'); $this->db->JOIN(ENTITY.' as ENTITY','ENTITYCHILD.fk_entity_id = ENTITY.entity_id AND ENTITY.isactive = 1'); $this->db->JOIN(USERPROFILE.' as USERPROFILE','ENTITYCHILD.fk_createdby = USERPROFILE.userid AND USERPROFILE.isactive = 1'); diff --git a/sineedge_front/src/app/app.module.ts b/sineedge_front/src/app/app.module.ts index 763034c7..a15a09d5 100755 --- a/sineedge_front/src/app/app.module.ts +++ b/sineedge_front/src/app/app.module.ts @@ -3,6 +3,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterModule } from '@angular/router'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; +import { ReactiveFormsModule } from '@angular/forms'; import { HttpModule, Http } from '@angular/http'; import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; @@ -21,6 +22,7 @@ import {MatListModule} from '@angular/material/list'; import {MatMenuModule} from '@angular/material/menu'; import {MatToolbarModule} from '@angular/material/toolbar'; import {MatTabsModule} from '@angular/material/tabs'; +import {MatTableModule} from '@angular/material'; import {MatCheckboxModule} from '@angular/material/checkbox'; import {MatProgressBarModule} from '@angular/material/progress-bar'; import {MatSelectModule} from '@angular/material/select'; @@ -54,9 +56,9 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { AdminLayoutComponent, AuthLayoutComponent, JazzDialogComponent, - + NewPasswordDialog,ForgotPass,ChangePasswordDialog, - + ], imports: [ BrowserModule, @@ -66,6 +68,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { onSameUrlNavigation: 'reload' }), FormsModule, + ReactiveFormsModule, HttpModule, HttpClientModule, MatSidenavModule, @@ -94,7 +97,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { useClass:[{AwsService,SharedService}] } ], - entryComponents: [JazzDialogComponent, NewPasswordDialog,ForgotPass,ChangePasswordDialog ], + entryComponents: [JazzDialogComponent, NewPasswordDialog,ForgotPass,ChangePasswordDialog], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/sineedge_front/src/app/app.routing.ts b/sineedge_front/src/app/app.routing.ts index 189c664e..07bd827c 100755 --- a/sineedge_front/src/app/app.routing.ts +++ b/sineedge_front/src/app/app.routing.ts @@ -19,7 +19,8 @@ export const AppRoutes: Routes = [{ },{ path:'settings', loadChildren:'./settings/settings.module#SettingsModule' - }] + } +] }, { path: '', component: AuthLayoutComponent, diff --git a/sineedge_front/src/app/aws.service.ts b/sineedge_front/src/app/aws.service.ts index 25263057..6c880a86 100755 --- a/sineedge_front/src/app/aws.service.ts +++ b/sineedge_front/src/app/aws.service.ts @@ -20,7 +20,7 @@ import 'rxjs/add/operator/map'; import { SharedService } from './shared.service'; -let apiurl = 'localhost/sineedge/sparqapi/api/'; +let apiurl = 'localhost/sparqapi/api/'; const sineedge_poolData = { UserPoolId: "ap-south-1_y7dt3iEaX", //ap-south-1_qQ85yQZJO UserName :SPARQ_SINEEDGE_DEV ClientId: "291qt4smn5pql6o8cc2hi201lj" // ClientName: SINEEDGE_DEV_WEB @@ -48,7 +48,7 @@ const sineedgeIdentity = "ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961";//"ap const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907"; const vendorIdenttiy = ""; // serviceProvider -apiurl = "http://localhost/sineedge/sparqapi/api/"; +// apiurl = "http://localhost/sineedge/sparqapi/api/"; const currentdate = new Date().toJSON().slice(0,19).replace('T',' '); @Injectable({ diff --git a/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.html b/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.html new file mode 100644 index 00000000..62cd5c22 --- /dev/null +++ b/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.html @@ -0,0 +1,65 @@ + +
+
Branch
+
+
+
+ + + +
+ +
+ + +
+ + + + + {{ cd.name }} + + You must Pickup City Name. + + +
+ +
+ + + You must inculde a Name + + +
+ + + +
+
+ + + +
+ +
+
+
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.scss b/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.scss new file mode 100644 index 00000000..7c5eb0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.scss @@ -0,0 +1,8 @@ +mat-form-field{ + width:100%; +} +mat-dialog-container{ + width:10% !important; +} + +//style="width: 100%" \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.spec.ts new file mode 100644 index 00000000..17284f6c --- /dev/null +++ b/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BranchDialogComponent } from './branch-dialog.component'; + +describe('BranchDialogComponent', () => { + let component: BranchDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BranchDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BranchDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.ts b/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.ts new file mode 100644 index 00000000..a8448ef2 --- /dev/null +++ b/sineedge_front/src/app/settings/component/branch/branch-dialog/branch-dialog.component.ts @@ -0,0 +1,78 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; +import { Branch,States,City } from '../../../model/branch'; +import { Observable } from 'rxjs/Observable';//for Datatables + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './branch-dialog.component.html', + styleUrls: ['./branch-dialog.component.scss'] +}) + +export class BranchDialogComponent implements OnInit { + + + public _branchForm: FormGroup; + + citydatas: City[]; + errorMessage:string; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _mastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: Branch) { } + + + ngOnInit() { + + this._branchForm = this._formBuilder.group({ + branch_id: [this.data.branch_id], + name: [this.data.name, Validators.compose([Validators.required])], + fk_city_id: [this.data.fk_city_id, Validators.compose([Validators.required])] + }); + //console.log(this._branchForm); + + this._mastersService.getAllCityData() + .subscribe( + data => { + + this.citydatas = data; + this.citydatas = this.citydatas.filter(city=>city.isactive == 1 ); + + }, error => this.errorMessage = error); + + } + + /** For Popup Close Button */ + onNoClick(): void { + this.dialogRef.close(); + } + + /** To Save/Edited Popup Data */ + onSubmit() { + + var BranchFormValues = this._branchForm.value; + + if(isNaN(this.data.branch_id)) { + + Object.keys(BranchFormValues) + .forEach((key) => ( BranchFormValues[key] == null) && delete BranchFormValues[key]); + //console.log(BranchFormValues); + this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(); + this.dialogRef.close(); + //alert("saved"); + } else { + this._mastersService.editMasterDetails(BranchFormValues,'BRANCH').subscribe(); + this.dialogRef.close(); + //alert("edited"); + } + } + + /** To Reset Popup Data */ + onReset(){ + this._branchForm.reset(); + } + +} diff --git a/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.html b/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.html new file mode 100644 index 00000000..c12256b7 --- /dev/null +++ b/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.html @@ -0,0 +1,88 @@ + +
+ +
+
+ + +
+ + + + + ID + {{user.branch_id}} + + + fk_city_id + {{user.fk_city_id}} + + + Name + {{user.name}} + + + city name + {{user.cityname}} + + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.scss b/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.scss new file mode 100644 index 00000000..01990255 --- /dev/null +++ b/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.scss @@ -0,0 +1,28 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + .mat-dialog-container{ + width:40% !important; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.spec.ts b/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.spec.ts new file mode 100644 index 00000000..207c3d97 --- /dev/null +++ b/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BranchListComponent } from './branch-list.component'; + +describe('BranchListComponent', () => { + let component: BranchListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BranchListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BranchListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.ts b/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.ts new file mode 100644 index 00000000..6514c81c --- /dev/null +++ b/sineedge_front/src/app/settings/component/branch/branch-list/branch-list.component.ts @@ -0,0 +1,83 @@ +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'; + +import { MastersService } from '../../../service/master/masters.service'; +import { BranchDialogComponent } from '../branch-dialog/branch-dialog.component'; +import { Branch,States,City } from '../../../model/branch'; + +@Component({ + selector: 'app-branch-list', + templateUrl: './branch-list.component.html', + styleUrls: ['./branch-list.component.scss'] +}) +export class BranchListComponent implements OnInit { + + + isPopupOpened = true; + isactive:number; + + + constructor(private dialog: MatDialog, + private _mastersService: MastersService) { } + + ngOnInit() {} + + displayedColumns = ['branch_id','name','fk_city_id','cname', 'isactive','actions']; + dataSource = new UserDataSource(this._mastersService); + + /** Popup for ADD Branch */ + addBranch() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(BranchDialogComponent, { + data: {} + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + /** Popup for EDIT Branch */ + editBranch(arr: Branch[]) { + this.isPopupOpened = true; + + const dialogRef = this.dialog.open(BranchDialogComponent, { + data: arr + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + /** Popup for EDIT Branch */ + deleteBranch(id: number) { + + this._mastersService.deleteMasterDetails(id,'BRANCH').subscribe(); + + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _ms: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllBranch(); + console.log(this._ms.getAllBranch()); + return this._ms.getAllBranch(); + } + disconnect() {} +} diff --git a/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.html b/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.html new file mode 100644 index 00000000..ec9e1fcf --- /dev/null +++ b/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.html @@ -0,0 +1,56 @@ + +
+
City
+
+
+
+ + +
+ +
+ + +
+ + + {{ sd.name }} + + You must Pickup State Name. + + +
+
+ + + You must include a Name. + + +
+ +
+ + + + You must include a State Name. +
+
+
+ + + +
+ +
+
+ +
diff --git a/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.scss b/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.spec.ts new file mode 100644 index 00000000..fbe710de --- /dev/null +++ b/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CityDialogComponent } from './city-dialog.component'; + +describe('CityDialogComponent', () => { + let component: CityDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CityDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CityDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.ts b/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.ts new file mode 100644 index 00000000..7cde5489 --- /dev/null +++ b/sineedge_front/src/app/settings/component/city/city-dialog/city-dialog.component.ts @@ -0,0 +1,68 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +import { MastersService } from '../../../service/master/masters.service'; +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './city-dialog.component.html', + styleUrls: ['./city-dialog.component.scss'] +}) +export class CityDialogComponent implements OnInit { + + + public _cityForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._cityForm = this._formBuilder.group({ + //City_id: any; fk_city_id: any; + + city_id: [this.data.city_id], + name: [this.data.name, Validators.compose([Validators.required])], + fk_state_id: [this.data.fk_state_id, Validators.compose([Validators.required])] + }); + //console.log(this._cityForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addCity(this._cityForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editCity(this._cityForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.city_id)) { + var my_array = this._cityForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'CITY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._cityForm.value,'CITY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._cityForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/city/city-list/city-list.component.html b/sineedge_front/src/app/settings/component/city/city-list/city-list.component.html new file mode 100644 index 00000000..373ca22d --- /dev/null +++ b/sineedge_front/src/app/settings/component/city/city-list/city-list.component.html @@ -0,0 +1,64 @@ + +
+ +
+
+ + +
+ + + + Name + {{user.name}} + + + ID + {{user.city_id}} + + + state ID + {{user.fk_state_id}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/city/city-list/city-list.component.scss b/sineedge_front/src/app/settings/component/city/city-list/city-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/city/city-list/city-list.component.spec.ts b/sineedge_front/src/app/settings/component/city/city-list/city-list.component.spec.ts new file mode 100644 index 00000000..8f3c58ba --- /dev/null +++ b/sineedge_front/src/app/settings/component/city/city-list/city-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CityListComponent } from './city-list.component'; + +describe('CityListComponent', () => { + let component: CityListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CityListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CityListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/city/city-list/city-list.component.ts b/sineedge_front/src/app/settings/component/city/city-list/city-list.component.ts new file mode 100644 index 00000000..6c59de8e --- /dev/null +++ b/sineedge_front/src/app/settings/component/city/city-list/city-list.component.ts @@ -0,0 +1,88 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { CityDialogComponent } from '../city-dialog/city-dialog.component'; +import { City } from '../../../model/city'; + + +@Component({ + selector: 'app-city-list', + templateUrl: './city-list.component.html', + styleUrls: ['./city-list.component.scss'] +}) +export class CityListComponent implements OnInit { + + isPopupOpened = true; + //, createdon, fk_createdby, updatedon, fk_updatedby, isactive + displayedColumns = ['city_id', 'fk_state_id', 'name', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CityList() { + // return this._MastersService.getAllCity(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addCity() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CityDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCity(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCity().find(c => c.ID === id); + const dialogRef = this.dialog.open(CityDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteCity(id: number) { + this._MastersService.deleteMasterDetails(id,'CITY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllCity(); + } + disconnect() {} +} + diff --git a/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html new file mode 100644 index 00000000..971efad8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html @@ -0,0 +1,42 @@ + +
+
Comment On Locality
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Rating. + + +
+ +
+
+ + + +
+ +
+
+ +
+ diff --git a/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.scss b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.spec.ts new file mode 100644 index 00000000..ea650445 --- /dev/null +++ b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CommentsOnLocalityDialogComponent } from './comments-on-locality-dialog.component'; + +describe('CommentsOnLocalityDialogComponent', () => { + let component: CommentsOnLocalityDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CommentsOnLocalityDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CommentsOnLocalityDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts new file mode 100644 index 00000000..923b4854 --- /dev/null +++ b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts @@ -0,0 +1,58 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './comments-on-locality-dialog.component.html', + styleUrls: ['./comments-on-locality-dialog.component.scss'] +}) +export class CommentsOnLocalityDialogComponent implements OnInit { + + + public _CommentOnLocalityForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._CommentOnLocalityForm = this._formBuilder.group({ + //branch_id: any; fk_city_id: any; + comments_on_locality_id: [this.data.comments_on_locality_id], + rating: [this.data.rating, Validators.compose([Validators.required])], + }); + + } + + + onSubmit() { + if(isNaN(this.data.comments_on_locality_id)) { + var my_array = this._CommentOnLocalityForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'COMMENTSONLOCALITY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._CommentOnLocalityForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html new file mode 100644 index 00000000..2aef00cc --- /dev/null +++ b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html @@ -0,0 +1,59 @@ + +
+ +
+
+ + +
+ + + + No + {{user.comments_on_locality_id}} + + + Rating + {{user.rating}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
diff --git a/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.spec.ts b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.spec.ts new file mode 100644 index 00000000..81bfc8c3 --- /dev/null +++ b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CommentsOnLocalityListComponent } from './comments-on-locality-list.component'; + +describe('CommentsOnLocalityListComponent', () => { + let component: CommentsOnLocalityListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CommentsOnLocalityListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CommentsOnLocalityListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts new file mode 100644 index 00000000..7b2d48a4 --- /dev/null +++ b/sineedge_front/src/app/settings/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts @@ -0,0 +1,86 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { CommentsOnLocalityDialogComponent } from '../comments-on-locality-dialog/comments-on-locality-dialog.component'; +import { CommentsOnLocality } from '../../../model/comments-on-locality'; + + +@Component({ + selector: 'app-comments-on-locality-list', + templateUrl: './comments-on-locality-list.component.html', + styleUrls: ['./comments-on-locality-list.component.scss'] +}) +export class CommentsOnLocalityListComponent implements OnInit { + + isPopupOpened = true; + displayedColumns = ['comments_on_locality_id','rating','isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CommentsOnLocalityList() { + // return this._MastersService.getAllCommentsOnLocality(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addCommentsOnLocality() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCommentsOnLocality(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCommentsOnLocality().find(c => c.ID === id); + const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteCommentsOnLocality(id: number) { + this._MastersService.deleteMasterDetails(id,'COMMENTSONLOCALITY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllCommentsOnLocality(); + } + disconnect() {} +} diff --git a/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.html b/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.html new file mode 100644 index 00000000..de1dfbda --- /dev/null +++ b/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.html @@ -0,0 +1,84 @@ +
+

Company                                         + +

+
+ + +
+ +
+ + +
+ + + You must include a Name. + +
+
+ + + You must include a addressline1. + + +
+
+ + + You must include a Name. + + +
+
+ + + You must include a Name. + + +
+
+ + + You must include a City. + + +
+
+ + + pincode should be in 6 digit format + + + Your pincode must be at least 5 characters long. + Your pincode name cannot exceed 6 characters. + + +
+
+ + + You must include a State. + + +
+
+ + + You must include a logo. + + +
+ + +
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.scss b/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.spec.ts new file mode 100644 index 00000000..35920973 --- /dev/null +++ b/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CompanyDialogComponent } from './company-dialog.component'; + +describe('CompanyDialogComponent', () => { + let component: CompanyDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CompanyDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CompanyDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.ts b/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.ts new file mode 100644 index 00000000..46d322a2 --- /dev/null +++ b/sineedge_front/src/app/settings/component/company/company-dialog/company-dialog.component.ts @@ -0,0 +1,77 @@ + +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +//import { CompanyService } from '../../../service/company.service'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './company-dialog.component.html', + styleUrls: ['./company-dialog.component.scss'] +}) +export class CompanyDialogComponent implements OnInit { + + + public _companyForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _masterService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._companyForm = this._formBuilder.group({ + //Company_id: any; fk_city_id: any; + // + company_id: [this.data.company_id], + name: [this.data.name, Validators.compose([Validators.required])], + addressline1: [this.data.addressline1, Validators.compose([Validators.required])], + addressline2: [this.data.addressline2, Validators.compose([Validators.required])], + addressline3: [this.data.addressline3, Validators.compose([Validators.required])], + city: [this.data.city, Validators.compose([Validators.required])], + state: [this.data.state, Validators.compose([Validators.required])], + pincode: [this.data.pincode, Validators.compose([Validators.required, Validators.minLength(5), Validators.maxLength(6)])], + logo : [this.data.logo, Validators.compose([Validators.required])] + + }); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._companyService.addCompany(this._companyForm.value); + // this.dialogRef.close(); + // } else { + // this._companyService.editCompany(this._companyForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.company_id)) { + var my_array = this._companyForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._masterService.addMasterDetails(my_array,'COMPANY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._masterService.editMasterDetails(this._companyForm.value,'COMPANY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._companyForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/company/company-list/company-list.component.html b/sineedge_front/src/app/settings/component/company/company-list/company-list.component.html new file mode 100644 index 00000000..50993b34 --- /dev/null +++ b/sineedge_front/src/app/settings/component/company/company-list/company-list.component.html @@ -0,0 +1,84 @@ + +
+ +
+
+ + +
+ + + + + Name + {{user.company_id}} + + + Name + {{user.name}} + + + address + {{user.addressline1}} + + + address 2 + {{user.addressline2}} + + + address 3 + {{user.addressline3}} + + + city + {{user.city}} + + + state + {{user.state}} + + + Pincode + {{user.pincode}} + + + logo name + {{user.logo}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/company/company-list/company-list.component.scss b/sineedge_front/src/app/settings/component/company/company-list/company-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/company/company-list/company-list.component.spec.ts b/sineedge_front/src/app/settings/component/company/company-list/company-list.component.spec.ts new file mode 100644 index 00000000..f9d0a521 --- /dev/null +++ b/sineedge_front/src/app/settings/component/company/company-list/company-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CompanyListComponent } from './company-list.component'; + +describe('CompanyListComponent', () => { + let component: CompanyListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CompanyListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CompanyListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/company/company-list/company-list.component.ts b/sineedge_front/src/app/settings/component/company/company-list/company-list.component.ts new file mode 100644 index 00000000..9c6203c1 --- /dev/null +++ b/sineedge_front/src/app/settings/component/company/company-list/company-list.component.ts @@ -0,0 +1,88 @@ +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'; + + +import { CompanyDialogComponent } from '../company-dialog/company-dialog.component'; +import { Company } from '../../../model/company'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-company-list', + templateUrl: './company-list.component.html', + styleUrls: ['./company-list.component.scss'] +}) +export class CompanyListComponent implements OnInit { + + isPopupOpened = true; + //displayedColumns = ['Company_id', 'fk_city_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions']; + displayedColumns = ['company_id', 'name', 'addressline1', 'addressline2','addressline3', 'city', 'state', 'pincode', 'logo','action']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CompanyList() { + // return this._MastersService.getAllCompany(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addCompany() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CompanyDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCompany(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCompany().find(c => c.ID === id); + const dialogRef = this.dialog.open(CompanyDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteCompany(id: number) { + this._MastersService.deleteMasterDetails(id,'COMPANY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllCompany(); + } + disconnect() {} +} diff --git a/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html new file mode 100644 index 00000000..a42e0dae --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html @@ -0,0 +1,43 @@ + +
+
Customer Behaviour
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+ + +
+
+ + + +
+ +
+
+ +
diff --git a/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.scss b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.spec.ts new file mode 100644 index 00000000..ab3715a4 --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerBehaviourDialogComponent } from './customer-behaviour-dialog.component'; + +describe('CustomerBehaviourDialogComponent', () => { + let component: CustomerBehaviourDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CustomerBehaviourDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerBehaviourDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts new file mode 100644 index 00000000..6f4a9171 --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts @@ -0,0 +1,68 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './customer-behaviour-dialog.component.html', + styleUrls: ['./customer-behaviour-dialog.component.scss'] +}) +export class CustomerBehaviourDialogComponent implements OnInit { + + public _customerBehaviourForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._customerBehaviourForm = this._formBuilder.group({ + //branch_id: any; fk_city_id: any; + customer_behaviour_id: [this.data.customer_behaviour_id], + description: [this.data.description, Validators.compose([Validators.required])] + + }); + //customer_behaviour_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive + //console.log(this._customerBehaviourForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addBranch(this._customerBehaviourForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editBranch(this._customerBehaviourForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.customer_behaviour_id)) { + var my_array = this._customerBehaviourForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'CUSTOMERBEHAVIOUR').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._customerBehaviourForm.value,'CUSTOMERBEHAVIOUR').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._customerBehaviourForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html new file mode 100644 index 00000000..ba345cf3 --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html @@ -0,0 +1,59 @@ + +
+ +
+
+ + +
+ + + + ID + {{user.customer_behaviour_id}} + + + description + {{user.description}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
diff --git a/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.spec.ts b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.spec.ts new file mode 100644 index 00000000..594ef232 --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerBehaviourListComponent } from './customer-behaviour-list.component'; + +describe('CustomerBehaviourListComponent', () => { + let component: CustomerBehaviourListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CustomerBehaviourListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerBehaviourListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts new file mode 100644 index 00000000..efde5704 --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts @@ -0,0 +1,87 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { CustomerBehaviourDialogComponent } from '../customer-behaviour-dialog/customer-behaviour-dialog.component'; +import { CustomerBehaviour } from '../../../model/customer-behaviour'; + + +@Component({ + selector: 'app-customer-behaviour-list', + templateUrl: './customer-behaviour-list.component.html', + styleUrls: ['./customer-behaviour-list.component.scss'] +}) +export class CustomerBehaviourListComponent implements OnInit { + + isPopupOpened = true; + displayedColumns = ['customer_behaviour_id', 'description', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CustomerBehaviourList() { + // return this._MastersService.getAllCustomerBehaviour(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addCustomerBehaviour() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCustomerBehaviour(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCustomerBehaviour().find(c => c.ID === id); + const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteCustomerBehaviour(id: number) { + this._MastersService.deleteMasterDetails(id,'CUSTOMERBEHAVIOUR'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllCustomerBehaviour(); + } + disconnect() {} +} diff --git a/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html new file mode 100644 index 00000000..8f3cdfcf --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html @@ -0,0 +1,49 @@ + +
+
Customer Segment
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+ +
+ + + You must include a Abbrevation. + + +
+
+
+ + + +
+ +
+
+ +
diff --git a/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.scss b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.spec.ts new file mode 100644 index 00000000..7ca82c37 --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerSegmentDialogComponent } from './customer-segment-dialog.component'; + +describe('CustomerSegmentDialogComponent', () => { + let component: CustomerSegmentDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CustomerSegmentDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerSegmentDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts new file mode 100644 index 00000000..bf0bde10 --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts @@ -0,0 +1,74 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './customer-segment-dialog.component.html', + styleUrls: ['./customer-segment-dialog.component.scss'] +}) +export class CustomerSegmentDialogComponent implements OnInit { + + public _customerSegmentForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._customerSegmentForm = this._formBuilder.group({ + //CustomerSegment_id: any; fk_city_id: any; + customer_segment_id: [this.data.customer_segment_id], + name: [this.data.name, Validators.compose([Validators.required])], + abbr: [this.data.abbr, Validators.compose([Validators.required])] + }); + //console.log(this._customerSegmentForm); + //customer_segment_id, name, abbr, createdon, fk_createdby, updatedon, isactive, fk_updatedby + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addCustomerSegment(this._customerSegmentForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editCustomerSegment(this._customerSegmentForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.customer_segment_id)) { + var my_array = this._customerSegmentForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'CUSTOMERSEGMENT').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._customerSegmentForm.value,'CUSTOMERSEGMENT').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._customerSegmentForm.reset(); + } +} + + + + + + diff --git a/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.html b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.html new file mode 100644 index 00000000..32f3debd --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.html @@ -0,0 +1,64 @@ + +
+ +
+
+ + +
+ + + + ID + {{user.customer_segment_id}} + + + Name + {{user.name}} + + + Abbrevation + {{user.abbr}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
+ \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.scss b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.spec.ts b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.spec.ts new file mode 100644 index 00000000..a8fc7b5f --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerSegmentListComponent } from './customer-segment-list.component'; + +describe('CustomerSegmentListComponent', () => { + let component: CustomerSegmentListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CustomerSegmentListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerSegmentListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.ts b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.ts new file mode 100644 index 00000000..7d274c69 --- /dev/null +++ b/sineedge_front/src/app/settings/component/customer-segment/customer-segment-list/customer-segment-list.component.ts @@ -0,0 +1,86 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { CustomerSegmentDialogComponent } from '../customer-segment-dialog/customer-segment-dialog.component'; +import { CustomerSegment } from '../../../model/customer-segment'; + + +@Component({ + selector: 'app-customer-segment-list', + templateUrl: './customer-segment-list.component.html', + styleUrls: ['./customer-segment-list.component.scss'] +}) +export class CustomerSegmentListComponent implements OnInit { + isPopupOpened = true; + displayedColumns = ['customer_segment_id', 'abbr', 'name', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CustomerSegmentList() { + // return this._MastersService.getAllCustomerSegment(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addCustomerSegment() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CustomerSegmentDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCustomerSegment(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCustomerSegment().find(c => c.ID === id); + const dialogRef = this.dialog.open(CustomerSegmentDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteCustomerSegment(id: number) { + this._MastersService.deleteMasterDetails(id,'CUSTOMERSEGMENT'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllCustomerSegment(); + } + disconnect() {} +} diff --git a/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.html b/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.html new file mode 100644 index 00000000..85dd5b0f --- /dev/null +++ b/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.html @@ -0,0 +1,51 @@ + +
+
Designation
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+ + + +
+ + + You must include a Short Name. + + +
+
+
+ + + +
+ +
+
+ +
diff --git a/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.scss b/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.spec.ts new file mode 100644 index 00000000..e49243a0 --- /dev/null +++ b/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DesignationDialogComponent } from './designation-dialog.component'; + +describe('DesignationDialogComponent', () => { + let component: DesignationDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DesignationDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DesignationDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.ts b/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.ts new file mode 100644 index 00000000..afee6a8c --- /dev/null +++ b/sineedge_front/src/app/settings/component/designation/designation-dialog/designation-dialog.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-designation-dialog', + templateUrl: './designation-dialog.component.html', + styleUrls: ['./designation-dialog.component.scss'] +}) +export class DesignationDialogComponent implements OnInit { + + public _designationForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._designationForm = this._formBuilder.group({ + //Designation_id: any; fk_city_id: any; + designation_id: [this.data.designation_id], + name: [this.data.name, Validators.compose([Validators.required])], + short_name: [this.data.short_name, Validators.compose([Validators.required])] + }); + //console.log(this._designationForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addDesignation(this._designationForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editDesignation(this._designationForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.designation_id)) { + var my_array = this._designationForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'DESIGNATION').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._designationForm.value,'DESIGNATION').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._designationForm.reset(); + } +} + + + + + + diff --git a/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.html b/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.html new file mode 100644 index 00000000..18b36442 --- /dev/null +++ b/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.html @@ -0,0 +1,66 @@ + +
+ +
+
+ + +
+ + + + + + ID + {{user.designation_id}} + + + Name + {{user.name}} + + + Short Name + {{user.short_name}} + + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
diff --git a/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.scss b/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.spec.ts b/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.spec.ts new file mode 100644 index 00000000..9911c6f2 --- /dev/null +++ b/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DesignationListComponent } from './designation-list.component'; + +describe('DesignationListComponent', () => { + let component: DesignationListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DesignationListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DesignationListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.ts b/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.ts new file mode 100644 index 00000000..2c45e3a3 --- /dev/null +++ b/sineedge_front/src/app/settings/component/designation/designation-list/designation-list.component.ts @@ -0,0 +1,88 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { DesignationDialogComponent } from '../designation-dialog/designation-dialog.component'; +import { Designation } from '../../../model/designation'; + + +@Component({ + selector: 'app-designation-list', + templateUrl: './designation-list.component.html', + styleUrls: ['./designation-list.component.scss'] +}) +export class DesignationListComponent implements OnInit { + + isPopupOpened = true; + displayedColumns = ['designation_id', 'name', 'short_name','isactive','actions']; + + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get DesignationList() { + // return this._MastersService.getAllDesignation(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addDesignation() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(DesignationDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editDesignation(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllDesignation().find(c => c.ID === id); + const dialogRef = this.dialog.open(DesignationDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteDesignation(id: number) { + this._MastersService.deleteMasterDetails(id,'DESIGNATION'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllDesignation(); + } + disconnect() {} +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.html b/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.html new file mode 100644 index 00000000..c9c1a79c --- /dev/null +++ b/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.html @@ -0,0 +1,44 @@ +
+

Entity Type                                         + +

+
+
+
Branch
+
+
+
+ + +
+ +
+ + +
+ + + + You must include a Name. +
+ + + + +
+
+ + + +
+ +
+
+ +
+ \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.scss b/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.spec.ts new file mode 100644 index 00000000..4eca89c0 --- /dev/null +++ b/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityTypeDialogComponent } from './entity-type-dialog.component'; + +describe('EntityTypeDialogComponent', () => { + let component: EntityTypeDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityTypeDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityTypeDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.ts b/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.ts new file mode 100644 index 00000000..7a67bdf6 --- /dev/null +++ b/sineedge_front/src/app/settings/component/entity-type/entity-type-dialog/entity-type-dialog.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-designation-dialog', + templateUrl: './entity-type-dialog.component.html', + styleUrls: ['./entity-type-dialog.component.scss'] +}) +export class EntityTypeDialogComponent implements OnInit { + + public _entityTypeForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _ETService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._entityTypeForm = this._formBuilder.group({ + //Designation_id: any; fk_city_id: any; + entity_type_id: [this.data.entity_type_id], + name: [this.data.name, Validators.compose([Validators.required])] + + }); + //console.log(this._entityTypeForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addDesignation(this._entityTypeForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editDesignation(this._entityTypeForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.entity_type_id)) { + var my_array = this._entityTypeForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._ETService.addMasterDetails(my_array,'ENTITYTYPE').subscribe(); + //addEntityType(my_array) + this.dialogRef.close(); + alert("saved"); + } else { + this._ETService.editMasterDetails(this._entityTypeForm.value,'ENTITYTYPE').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._entityTypeForm.reset(); + } +} + + + + + + diff --git a/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.html b/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.html new file mode 100644 index 00000000..c77bcc96 --- /dev/null +++ b/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.html @@ -0,0 +1,59 @@ + +
+ +
+
+ + +
+ + + + + ID + {{user.entity_type_id}} + + + Name + {{user.name}} + + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.scss b/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.spec.ts b/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.spec.ts new file mode 100644 index 00000000..8d01d29f --- /dev/null +++ b/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityTypeListComponent } from './entity-type-list.component'; + +describe('EntityTypeListComponent', () => { + let component: EntityTypeListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityTypeListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityTypeListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.ts b/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.ts new file mode 100644 index 00000000..498c60a7 --- /dev/null +++ b/sineedge_front/src/app/settings/component/entity-type/entity-type-list/entity-type-list.component.ts @@ -0,0 +1,87 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { EntityTypeDialogComponent } from '../entity-type-dialog/entity-type-dialog.component'; +import { EntityType } from '../../../model/entity-type'; + + +@Component({ + selector: 'app-entity-type-list', + templateUrl: './entity-type-list.component.html', + styleUrls: ['./entity-type-list.component.scss'] +}) +export class EntityTypeListComponent implements OnInit { + + isPopupOpened = true; + displayedColumns = ['entity_type_id', 'name','isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _EtService: MastersService) { } + + // get EntityTypeList() { + // return this._EtService. getAllEntityType(); + // } + + dataSource = new UserDataSource(this._EtService); + + ngOnInit() { + } + + + addEntityType() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(EntityTypeDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editEntityType(arr: any) { + this.isPopupOpened = true; + //const contact = this._EtService.getAllEntityType().find(c => c.ID === id); + const dialogRef = this.dialog.open(EntityTypeDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteEntityType(id: number) { + this._EtService.deleteMasterDetails(id,'ENTITYTYPE'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _ets: MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._ets.getAllEntityType(); + } + disconnect() {} +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.html b/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.html new file mode 100644 index 00000000..6dedc50e --- /dev/null +++ b/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.html @@ -0,0 +1,40 @@ + +
+
Frequency
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.scss b/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.spec.ts new file mode 100644 index 00000000..f691a3de --- /dev/null +++ b/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FrequencyDialogComponent } from './frequency-dialog.component'; + +describe('FrequencyDialogComponent', () => { + let component: FrequencyDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FrequencyDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FrequencyDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.ts b/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.ts new file mode 100644 index 00000000..9de7db42 --- /dev/null +++ b/sineedge_front/src/app/settings/component/frequency/frequency-dialog/frequency-dialog.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './frequency-dialog.component.html', + styleUrls: ['./frequency-dialog.component.scss'] +}) +export class FrequencyDialogComponent implements OnInit { + + + public _frequencyForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._frequencyForm = this._formBuilder.group({ + frequency_id: [this.data.frequency_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._frequencyForm); + } + + onSubmit() { + if(isNaN(this.data.frequency_id)) { + var my_array = this._frequencyForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'FREQUENCY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._MastersService.editMasterDetails( this._frequencyForm.value,'FREQUENCY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._contactService.addIndustryMaster(this._frequencyForm.value); + // this.dialogRef.close(); + // } else { + // this._contactService.editIndustryMaster(this._frequencyForm.value); + // this.dialogRef.close(); + // } + // } + + onReset(){ + this._frequencyForm.reset(); + } +} + diff --git a/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.html b/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.html new file mode 100644 index 00000000..6b79473a --- /dev/null +++ b/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.html @@ -0,0 +1,73 @@ + +
+ +
+
+ + +
+ + + + Name + {{user.name}} + + + ID + {{user.frequency_id}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.scss b/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.scss new file mode 100644 index 00000000..4f2fcbd8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.scss @@ -0,0 +1,24 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.spec.ts b/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.spec.ts new file mode 100644 index 00000000..2b7cbc2a --- /dev/null +++ b/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FrequencyListComponent } from './frequency-list.component'; + +describe('FrequencyListComponent', () => { + let component: FrequencyListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FrequencyListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FrequencyListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.ts b/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.ts new file mode 100644 index 00000000..464667dc --- /dev/null +++ b/sineedge_front/src/app/settings/component/frequency/frequency-list/frequency-list.component.ts @@ -0,0 +1,87 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { FrequencyDialogComponent }from '../frequency-dialog/frequency-dialog.component'; +import { Frequency } from '../../../model/frequency'; + + +@Component({ + selector: 'app-frequency-list', + templateUrl: './frequency-list.component.html', + styleUrls: ['./frequency-list.component.scss'] +}) +export class FrequencyListComponent implements OnInit { + + isPopupOpened = true; + displayedColumns = ['frequency_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get FrequencyList() { + // return this._MastersService. getAllFrequency(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addFrequency() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(FrequencyDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editFrequency(arr: any) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllFrequency().find(c => c.ID === id); + const dialogRef = this.dialog.open(FrequencyDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteFrequency(id: number) { + this._MastersService.deleteMasterDetails(id,'FREQUENCY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _fs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._fs.getAllFrequency(); + } + disconnect() {} +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html new file mode 100644 index 00000000..2823cce3 --- /dev/null +++ b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html @@ -0,0 +1,42 @@ + +
+
Industry Classification
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Classified Name. + + +
+
+
+ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.scss b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.spec.ts new file mode 100644 index 00000000..1a9feee4 --- /dev/null +++ b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { IndustryMasterDialogComponent } from './industry-master-dialog.component'; + +describe('IndustryMasterDialogComponent ', () => { + let component: IndustryMasterDialogComponent ; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ IndustryMasterDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IndustryMasterDialogComponent ); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts new file mode 100644 index 00000000..fa7c6e24 --- /dev/null +++ b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './industry_classification-dialog.component.html', + styleUrls: ['./industry_classification-dialog.component.scss'] +}) +export class IndustryClassificationDialogComponent implements OnInit { + + public _IndustryClassificationForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _contactService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._IndustryClassificationForm = this._formBuilder.group({ + industry_classification_id: [this.data.industry_classification_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._IndustryClassificationForm); + //industry_classification_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._contactService.addIndustryClassification(this._IndustryClassificationForm.value); + // this.dialogRef.close(); + // } else { + // this._contactService.editIndustryClassification(this._IndustryClassificationForm.value); + // this.dialogRef.close(); + // } + // } + + + onSubmit() { + if(isNaN(this.data.industry_classification_id)) { + var my_array = this._IndustryClassificationForm.value; + Object.keys(my_array).forEach((key) => (my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._contactService.addMasterDetails(my_array,'INDUSTRYCLASSIFICATION').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._contactService.editMasterDetails(this._IndustryClassificationForm.value,'INDUSTRYCLASSIFICATION').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + onReset(){ + this._IndustryClassificationForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.html b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.html new file mode 100644 index 00000000..2f65757e --- /dev/null +++ b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.html @@ -0,0 +1,70 @@ + +
+ +
+
+ + +
+ + + + Name + {{user.name}} + + + ID + {{user.industry_classification_id}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.scss b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.scss new file mode 100644 index 00000000..4f2fcbd8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.scss @@ -0,0 +1,24 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.spec.ts b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.spec.ts new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.ts b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.ts new file mode 100644 index 00000000..003e54e2 --- /dev/null +++ b/sineedge_front/src/app/settings/component/industry_classification/industry_classification-list/industry_classification-list.component.ts @@ -0,0 +1,98 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { IndustryClassificationDialogComponent } from '../industry_classification-dialog/industry_classification-dialog.component'; +import { IndustryClassification } from '../../../model/industry_classification'; + +@Component({ + selector: 'app-industry_classification-list', + templateUrl: './industry_classification-list.component.html', + styleUrls: ['./industry_classification-list.component.scss'] +}) + + +// export class TablePagingComponent implements OnInit { + +// } + +export class IndustryClassificationListComponent implements OnInit { + + + isPopupOpened = true; + + displayedColumns = ['industry_classification_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //industry_classification_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _IMService: MastersService) { } + + // get IndustryClassificationList() { + // return this._IMService.getAllIndustryClassification(); + // } + + //displayedColumns: string[] = ['ID','ClassifiedName']; + dataSource = new UserDataSource(this._IMService); + + + ngOnInit() {} + + + addIndustryClassification() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(IndustryClassificationDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editIndustryClassification(arr: any) { + this.isPopupOpened = true; + //const indu = this._IMService.getAllIndustryClassification().find(c => c.ID === id); + const dialogRef = this.dialog.open(IndustryClassificationDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteIndustryClassification(id: number) { + this._IMService.deleteMasterDetails(id,'INDUSTRYCLASSIFICATION'); + } + +} + + + +export class UserDataSource extends DataSource { + + constructor(private _ims: MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._ims.getAllIndustryClassification(); + } + disconnect() {} +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html new file mode 100644 index 00000000..0ffbc85f --- /dev/null +++ b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html @@ -0,0 +1,39 @@ + +
+
Lender Hierarchy
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Lender Hierarchy Name. + + +
+
+
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.scss b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.spec.ts new file mode 100644 index 00000000..fec89337 --- /dev/null +++ b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LenderHierarchyDialogComponent } from './lender-hierarchy-dialog.component'; + +describe('LenderHierarchyDialogComponent', () => { + let component: LenderHierarchyDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LenderHierarchyDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LenderHierarchyDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.ts b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.ts new file mode 100644 index 00000000..6df1f3bc --- /dev/null +++ b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './lender-hierarchy-dialog.component.html', + styleUrls: ['./lender-hierarchy-dialog.component.scss'] +}) +export class LenderHierarchyDialogComponent implements OnInit { + + public _lenderHierarchyForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._lenderHierarchyForm = this._formBuilder.group({ + //Designation_id: any; fk_city_id: any; + + lender_hierarchy_id: [this.data.lender_hierarchy_id], + lender_hierarchy: [this.data.lender_hierarchy, Validators.compose([Validators.required])], + + }); + //console.log(this._lenderHierarchyForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addDesignation(this._lenderHierarchyForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editDesignation(this._lenderHierarchyForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.lender_hierarchy_id)) { + var my_array = this._lenderHierarchyForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'LENDERHIERARCHY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._lenderHierarchyForm.value,'LENDERHIERARCHY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._lenderHierarchyForm.reset(); + } +} + + + + + + diff --git a/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html new file mode 100644 index 00000000..4fd590a9 --- /dev/null +++ b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html @@ -0,0 +1,58 @@ + +
+ +
+
+ + +
+ + + + + ID + {{user.lender_hierarchy_id}} + + + Lender Hierarchy + {{user.lender_hierarchy}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.spec.ts b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.spec.ts new file mode 100644 index 00000000..7310059f --- /dev/null +++ b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LenderHierarchyListComponent } from './lender-hierarchy-list.component'; + +describe('LenderHierarchyListComponent', () => { + let component: LenderHierarchyListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LenderHierarchyListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LenderHierarchyListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts new file mode 100644 index 00000000..7e3b425e --- /dev/null +++ b/sineedge_front/src/app/settings/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts @@ -0,0 +1,87 @@ + +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'; + +import { MastersService } from '../../../service/master/masters.service'; +import { LenderHierarchyDialogComponent }from '../lender-hierarchy-dialog/lender-hierarchy-dialog.component'; +import { LenderHierarchy } from '../../../model/lender-hierarchy'; + + +@Component({ + selector: 'app-lender-hierarchy-list', + templateUrl: './lender-hierarchy-list.component.html', + styleUrls: ['./lender-hierarchy-list.component.scss'] +}) +export class LenderHierarchyListComponent implements OnInit { + + isPopupOpened = true; + displayedColumns = ['lender_hierarchy_id', 'lender_hierarchy','isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get LenderHierarchyList() { + // return this._MastersService. getAllLenderHierarchy(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addLenderHierarchy() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(LenderHierarchyDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editLenderHierarchy(arr: any) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllLenderHierarchy().find(c => c.ID === id); + const dialogRef = this.dialog.open(LenderHierarchyDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteLenderHierarchy(id: number) { + this._MastersService.deleteMasterDetails(id,'LENDERHIERARCHY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _fs: MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._fs.getAllLenderHierarchy(); + } + disconnect() {} +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/masters/masters.component.html b/sineedge_front/src/app/settings/component/masters/masters.component.html new file mode 100644 index 00000000..d33c4900 --- /dev/null +++ b/sineedge_front/src/app/settings/component/masters/masters.component.html @@ -0,0 +1,151 @@ + + + + Master Details + Pickup the Master to View Master Detail + + + + +
+
+ + + + + + +
+ + + + + {{master.name}} + + + + +
+ + + +
+ +
+ +
+ +
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/masters/masters.component.scss b/sineedge_front/src/app/settings/component/masters/masters.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/masters/masters.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/masters/masters.component.spec.ts b/sineedge_front/src/app/settings/component/masters/masters.component.spec.ts new file mode 100644 index 00000000..accdb83d --- /dev/null +++ b/sineedge_front/src/app/settings/component/masters/masters.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MastersComponent } from './masters.component'; + +describe('MastersComponent', () => { + let component: MastersComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MastersComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MastersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/masters/masters.component.ts b/sineedge_front/src/app/settings/component/masters/masters.component.ts new file mode 100644 index 00000000..04e0600b --- /dev/null +++ b/sineedge_front/src/app/settings/component/masters/masters.component.ts @@ -0,0 +1,180 @@ +//import { Component, OnInit } from '@angular/core'; +//import { FormControl } from '@angular/forms'; +//import { startWith } from 'rxjs/operators'; + + + import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; + import { FormControl, FormGroup, FormBuilder } from '@angular/forms'; + import { ReplaySubject } from 'rxjs'; + import { MatSelect } from '@angular/material'; + import { Subject } from 'rxjs'; + import { take, takeUntil } from 'rxjs/operators'; + + export interface Master { + id: string; + name: string; + } + +// export interface masterArray { +// value: string; +// viewValue: string; +// } + +@Component({ + selector: 'app-masters', + templateUrl: './masters.component.html', + styleUrls: ['./masters.component.scss'] +}) +export class MastersComponent implements OnInit { + + /* Normal Search Code + pickUpMasterData : string; + + constructor() {} + + For Master Dropdown Elements + masterArray = [{ code: 'master-1', viewValue: 'Industry Classfication' }, + { code: 'master-2', viewValue: 'Product'}, + { code: 'master-3', viewValue: 'Sub Product'} + ]; + + ngOnInit() {}*/ + + + +/* AutoComplete Code + stateCtrl: FormControl; + currentState = ''; + + reactiveStates: any; + tdStates: any[]; + + tdDisabled = false; + + tdAuto: string; + + reactiveAuto: string; + + masterArray = [{ code: 'master-1', viewValue: 'Industry Classfication' }, + { code: 'master-2', viewValue: 'Product'}, + { code: 'master-3', viewValue: 'Sub Product'} + ]; + + constructor() { + this.tdStates = this.masterArray; + //this.reactiveStates = this.stateCtrl.valueChanges; + } + + + filterStates(val: string) { + return val ? this.masterArray.filter((s) => s.viewValue.match(new RegExp(val, 'gi'))) : this.masterArray; + }*/ + + /* Select Search Code + /** control for the selected bank */ + public masterCtrl: FormControl = new FormControl(); + + /** control for the MatSelect filter keyword */ + public masterFilterCtrl: FormControl = new FormControl(); + + + constructor(private _formBuilder: FormBuilder) { } + + /** list of masters */ + private masters: Master[] = [ + {id: 'master-1',name: 'Industry Classfication'}, + {id: 'master-2',name: 'Branch'}, + {id: 'master-3',name: 'Title'}, + {id: 'master-4',name: 'Relation Ship'}, + {id: 'master-5',name: 'Product'}, + {id: 'master-6',name: 'Sub Product'}, + {id: 'master-7',name: 'Occupation of Non earning members'}, + {id: 'master-8',name: 'Type of activity'}, + {id: 'master-9',name: 'Unit of Measurement'}, + {id: 'master-10',name: 'Frequency'}, + {id: 'master-11',name: 'Approach to PD location'}, + {id: 'master-12',name: 'Comments on locality'}, + {id: 'master-13',name: 'Customer Behaviour'}, + {id: 'master-14',name: 'Customer Segment'}, + {id: 'master-15',name: 'Designation'}, + {id: 'master-16',name: 'PD Allocation Type'}, + {id: 'master-17',name: 'PD Status'}, + {id: 'master-18',name: 'PD Type'}, + {id: 'master-19',name: 'Company Details'}, + {id: 'master-20',name: 'City'}, + {id: 'master-21',name: 'States'}, + {id: 'master-22',name: 'Regions'}, + {id: 'master-23',name: 'm_lender_hierarchy'}, + {id: 'master-24',name: 'm_entity_type'}, + {id: 'datatable',name: 'datatable'}, + {id: 'usertable',name: 'usertable'} + + ]; + + /** list of masters filtered by search keyword */ + public filteredMasters: ReplaySubject = new ReplaySubject(1); + + + @ViewChild('singleSelect') singleSelect: MatSelect; + + /** Subject that emits when the component has been destroyed. */ + private _onDestroy = new Subject(); + + ngOnInit() { + + // load the initial master list + this.filteredMasters.next(this.masters.slice()); + + // listen for search field value changes + this.masterFilterCtrl.valueChanges + .pipe(takeUntil(this._onDestroy)) + .subscribe(() => { + this.filterMasters(); + }); + + } + + ngAfterViewInit() { + //this.setInitialValue(); + } + + ngOnDestroy() { + this._onDestroy.next(); + this._onDestroy.complete(); + } + + // /** + // * Sets the initial value after the filteredMasters are loaded initially + // */ + // private setInitialValue() { + // this.filteredMasters + // .pipe(take(1), takeUntil(this._onDestroy)) + // .subscribe(() => { + // // setting the compareWith property to a comparison function + // // triggers initializing the selection according to the initial value of + // // the form control (i.e. _initializeSelection()) + // // this needs to be done after the filteredBanks are loaded initially + // // and after the mat-option elements are available + // this.singleSelect.compareWith = (a: Bank, b: Bank) => a.id === b.id; + // }); + // } + + private filterMasters() { + if (!this.masters) { + return; + } + // get the search keyword + let search = this.masterFilterCtrl.value; + if (!search) { + this.filteredMasters.next(this.masters.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the masters + this.filteredMasters.next( + this.masters.filter(master => master.name.toLowerCase().indexOf(search) > -1) + ); + } + +} diff --git a/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html new file mode 100644 index 00000000..0fd361f1 --- /dev/null +++ b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html @@ -0,0 +1,41 @@ + +
+
Occupation of Non earning members
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.scss b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.spec.ts new file mode 100644 index 00000000..2d3a7b44 --- /dev/null +++ b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MembersOccupationDialogComponent } from './members-occupation-dialog.component'; + +describe('MembersOccupationDialogComponent', () => { + let component: MembersOccupationDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MembersOccupationDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MembersOccupationDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts new file mode 100644 index 00000000..1d989749 --- /dev/null +++ b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts @@ -0,0 +1,63 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './members-occupation-dialog.component.html', + styleUrls: ['./members-occupation-dialog.component.scss'] +}) +export class MembersOccupationDialogComponent implements OnInit { + + + public _occupationForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _memberService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._occupationForm = this._formBuilder.group({ + occupation_non_earning_member_id: [this.data.occupation_non_earning_member_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._occupationForm); + } + + onSubmit() { + if(isNaN(this.data.occupation_non_earning_member_id)) { + var my_array = this._occupationForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._memberService.addMasterDetails(my_array,'OCCUPATIONMEMBERS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._memberService.editMasterDetails(this._occupationForm.value,'OCCUPATIONMEMBERS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._memberService.addMembersOccupation(this._occupationForm.value); + // this.dialogRef.close(); + // } else { + // this._memberService.editMembersOccupation(this._occupationForm.value); + // this.dialogRef.close(); + // } + // } + + onReset(){ + this._occupationForm.reset(); + } +} + diff --git a/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.html b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.html new file mode 100644 index 00000000..e1499335 --- /dev/null +++ b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.html @@ -0,0 +1,77 @@ + +
+ +
+
+ + +
+ + + + Name + {{user.name}} + + + ID + {{user.occupation_non_earning_member_id}} + + + Abbrevation + {{user.abbr}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.scss b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.scss new file mode 100644 index 00000000..4f2fcbd8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.scss @@ -0,0 +1,24 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.spec.ts b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.spec.ts new file mode 100644 index 00000000..6df9db6d --- /dev/null +++ b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MembersOccupationListComponent } from './members-occupation-list.component'; + +describe('MembersOccupationListComponent', () => { + let component: MembersOccupationListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MembersOccupationListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MembersOccupationListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.ts b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.ts new file mode 100644 index 00000000..f7f0ec00 --- /dev/null +++ b/sineedge_front/src/app/settings/component/members-occupation/members-occupation-list/members-occupation-list.component.ts @@ -0,0 +1,88 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { MembersOccupationDialogComponent } from '../members-occupation-dialog/members-occupation-dialog.component'; +import { MembersOccupation } from '../../../model/members-occupation'; + + +@Component({ + selector: 'app-members-occupation-list', + templateUrl: './members-occupation-list.component.html', + styleUrls: ['./members-occupation-list.component.scss'] +}) +export class MembersOccupationListComponent implements OnInit { + + isPopupOpened = true; + + displayedColumns = ['occupation_non_earning_member_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //occupation_non_earning_member_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _memberService: MastersService) { } + + // get MemberOccupationList() { + // return this._memberService.getAllMembersOccupation(); + // } + + ngOnInit() {} + + dataSource = new UserDataSource(this._memberService); + + addMemberOccupation() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(MembersOccupationDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editMemberOccupation(arr : any) { + this.isPopupOpened = true; + //const contact = this._memberService.getAllMembersOccupation().find(c => c.ID === id); + const dialogRef = this.dialog.open(MembersOccupationDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteMemberOccupation(id: number) { + this._memberService.deleteMasterDetails(id,'OCCUPATIONMEMBERS'); + } +} + + + +export class UserDataSource extends DataSource { + + constructor(private _mos:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._mos.getAllMembersOccupation(); + } + disconnect() {} +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.html b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.html new file mode 100644 index 00000000..d62d273c --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.html @@ -0,0 +1,40 @@ + + +
+
PD Allocation Type
+
+
+
+ +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.scss b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.spec.ts new file mode 100644 index 00000000..a98fc333 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdAllocationTypeDialogComponent } from './pd-allocation-type-dialog.component'; + +describe('PdAllocationTypeDialogComponent', () => { + let component: PdAllocationTypeDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdAllocationTypeDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdAllocationTypeDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.ts b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.ts new file mode 100644 index 00000000..09fb52a7 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './pd-allocation-type-dialog.component.html', + styleUrls: ['./pd-allocation-type-dialog.component.scss'] +}) +export class PdAllocationTypeDialogComponent implements OnInit { + + + + public _PDAllocationTypeForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _pds: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._PDAllocationTypeForm = this._formBuilder.group({ + pd_allocation_type_id: [this.data.pd_allocation_type_id], + pd_allocation_type_name: [this.data.pd_allocation_type_name, Validators.compose([Validators.required])] + }); + //pd_allocation_type_id, pd_allocation_type_name, createdon, fk_createdby, updatedon, isactive + //console.log(this._PDAllocationTypeForm); + } + + onSubmit() { + if(isNaN(this.data.pd_allocation_type_id)) { + var my_array = this._PDAllocationTypeForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._pds.addMasterDetails(my_array,'PDALLOCATIONTYPE').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._pds.editMasterDetails(this._PDAllocationTypeForm.value,'PDALLOCATIONTYPE').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._memberService.addMembersOccupation(this._PDAllocationTypeForm.value); + // this.dialogRef.close(); + // } else { + // this._memberService.editMembersOccupation(this._PDAllocationTypeForm.value); + // this.dialogRef.close(); + // } + // } + + onReset(){ + this._PDAllocationTypeForm.reset(); + } +} + + + + + + + + + diff --git a/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html new file mode 100644 index 00000000..0713cd1a --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html @@ -0,0 +1,60 @@ + +
+ +
+
+ + +
+ + + + + Name + {{user.pd_allocation_type_name}} + + + ID + {{user.pd_allocation_type_id}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
diff --git a/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.spec.ts b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.spec.ts new file mode 100644 index 00000000..22d79c3d --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdAllocationTypeListComponent } from './pd-allocation-type-list.component'; + +describe('PdAllocationTypeListComponent', () => { + let component: PdAllocationTypeListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdAllocationTypeListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdAllocationTypeListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts new file mode 100644 index 00000000..c1ea192a --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts @@ -0,0 +1,88 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { PdAllocationTypeDialogComponent } from '../pd-allocation-type-dialog/pd-allocation-type-dialog.component'; +import { PdAllocationType } from '../../../model/pd'; + + +@Component({ + selector: 'app-pd-allocation-type-list', + templateUrl: './pd-allocation-type-list.component.html', + styleUrls: ['./pd-allocation-type-list.component.scss'] +}) +export class PdAllocationTypeListComponent implements OnInit { + + isPopupOpened = true; + displayedColumns = ['pd_allocation_type_id','pd_allocation_type_name','isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get PDAllocationTypeList() { + // return this._MastersService.getAllPDAllocationType(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addPDAllocationType() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(PdAllocationTypeDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + 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.isPopupOpened = false; + }); + } + + deletePDAllocationType(id: number) { + this._MastersService.deleteMasterDetails(id,'PDALLOCATIONTYPE'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllPDAllocationType(); + } + disconnect() {} +} + diff --git a/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html b/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html new file mode 100644 index 00000000..5694e99b --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html @@ -0,0 +1,42 @@ + +
+
PD Location Approach
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Description. + + +
+ +
+
+ + + +
+ +
+
+ +
diff --git a/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.scss b/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.spec.ts new file mode 100644 index 00000000..c3e59ee7 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdLocationApproachDialogComponent } from './pd-location-approach-dialog.component'; + +describe('PdLocationApproachDialogComponent', () => { + let component: PdLocationApproachDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdLocationApproachDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdLocationApproachDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts b/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts new file mode 100644 index 00000000..b0673a08 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts @@ -0,0 +1,75 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './pd-location-approach-dialog.component.html', + styleUrls: ['./pd-location-approach-dialog.component.scss'] +}) +export class PdLocationApproachDialogComponent implements OnInit { + + public _pdLocationApproachForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + //pd_location_approach_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive + ngOnInit() { + + this._pdLocationApproachForm = this._formBuilder.group({ + //branch_id: any; fk_city_id: any; + pd_location_approach_id: [this.data.pd_location_approach_id], + description: [this.data.description, Validators.compose([Validators.required])] + }); + //console.log(this._pdLocationApproachForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addBranch(this._pdLocationApproachForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editBranch(this._pdLocationApproachForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.pd_location_approach_id)) { + var my_array = this._pdLocationApproachForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'PDLOCATIONAPPROACH').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._pdLocationApproachForm.value,'PDLOCATIONAPPROACH').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._pdLocationApproachForm.reset(); + } +} + + + + + + + + + + diff --git a/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.html b/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.html new file mode 100644 index 00000000..1df589c4 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.html @@ -0,0 +1,60 @@ + +
+ +
+
+ + +
+ + + + + ID + {{user.pd_allocation_type_id}} + + + Name + {{user.pd_allocation_type_name}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
diff --git a/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss b/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.spec.ts b/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.spec.ts new file mode 100644 index 00000000..34c33f23 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdLocationApproachListComponent } from './pd-location-approach-list.component'; + +describe('PdLocationApproachListComponent', () => { + let component: PdLocationApproachListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdLocationApproachListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdLocationApproachListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts b/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts new file mode 100644 index 00000000..66bb2de4 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts @@ -0,0 +1,90 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { PdLocationApproachDialogComponent } from '../pd-location-approach-dialog/pd-location-approach-dialog.component'; +import { PdLocationApproach } from '../../../model/pd'; + + +@Component({ + selector: 'app-pd-location-approach-list', + templateUrl: './pd-location-approach-list.component.html', + styleUrls: ['./pd-location-approach-list.component.scss'] +}) +export class PdLocationApproachListComponent implements OnInit { + + + isPopupOpened = true; + displayedColumns = ['pd_allocation_type_id', 'pd_allocation_type_name', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get PdLocationApproachList() { + // return this._MastersService.getAllPdLocationApproach(); + // } + + //dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + } + + + addPdLocationApproach() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(PdLocationApproachDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editPdLocationApproach(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllPdLocationApproach().find(c => c.ID === id); + const dialogRef = this.dialog.open(PdLocationApproachDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deletePdLocationApproach(id: number) { + this._MastersService.deleteMasterDetails(id,'PDLOCATIONAPPROACH'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllPDLocationApproach(); + } + disconnect() {} +} + + diff --git a/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.html b/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.html new file mode 100644 index 00000000..5729ff1c --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.html @@ -0,0 +1,43 @@ + +
+
PD Status
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a PD Status Name. + + +
+ +
+
+ + + +
+ +
+
+ +
+ \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.scss b/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.spec.ts new file mode 100644 index 00000000..bd1ed0bd --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdStatusDialogComponent } from './pd-status-dialog.component'; + +describe('PdStatusDialogComponent', () => { + let component: PdStatusDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdStatusDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdStatusDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.ts b/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.ts new file mode 100644 index 00000000..ce929cb3 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-status-dialog/pd-status-dialog.component.ts @@ -0,0 +1,66 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './pd-status-dialog.component.html', + styleUrls: ['./pd-status-dialog.component.scss'] +}) +export class PdStatusDialogComponent implements OnInit { + + public _PdStatusForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _PdStatusService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._PdStatusForm = this._formBuilder.group({ + + pd_status_id: [this.data.pd_status_id], + pd_status_name: [this.data.pd_status_name, Validators.compose([Validators.required])], + + }); + //console.log(this._PdStatusForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._PdStatusService.addPdStatus(this._PdStatusForm.value); + // this.dialogRef.close(); + // } else { + // this._PdStatusService.editPdStatus(this._PdStatusForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.pd_status_id)) { + var my_array = this._PdStatusForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._PdStatusService.addMasterDetails(my_array,'PDSTATUS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._PdStatusService.editMasterDetails(this._PdStatusForm.value,'PDSTATUS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._PdStatusForm.reset(); + } +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.html b/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.html new file mode 100644 index 00000000..1d1977d9 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.html @@ -0,0 +1,59 @@ + +
+ +
+
+ + +
+ + + + ID + {{user.pd_status_id}} + + + Name + {{user.pd_status_name}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
diff --git a/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.scss b/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.spec.ts b/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.spec.ts new file mode 100644 index 00000000..19ee5251 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdStatusListComponent } from './pd-status-list.component'; + +describe('PdStatusListComponent', () => { + let component: PdStatusListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdStatusListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdStatusListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.ts b/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.ts new file mode 100644 index 00000000..9e5bca0a --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-status-list/pd-status-list.component.ts @@ -0,0 +1,90 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { PdStatusDialogComponent } from '../pd-status-dialog/pd-status-dialog.component'; +import { PdStatus } from '../../../model/pd'; + + +@Component({ + selector: 'app-pd-status-list', + templateUrl: './pd-status-list.component.html', + styleUrls: ['./pd-status-list.component.scss'] +}) +export class PdStatusListComponent implements OnInit { + + + isPopupOpened = true; + displayedColumns = ['pd_status_id', 'pd_status_name','isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _PdStatusService: MastersService) { } + + // get PdStatusList() { + // return this._PdStatusService.getAllPdStatus(); + // } + + dataSource = new UserDataSource(this._PdStatusService); + + ngOnInit() { + } + + + addPdStatus() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(PdStatusDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editPdStatus(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._PdStatusService.getAllPdStatus().find(c => c.ID === id); + const dialogRef = this.dialog.open(PdStatusDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deletePdStatus(id: number) { + this._PdStatusService.deleteMasterDetails(id,'PDSTATUS'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllPDStatus(); + } + disconnect() {} +} + + diff --git a/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.html b/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.html new file mode 100644 index 00000000..62b4a3b9 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.html @@ -0,0 +1,43 @@ + +
+
PD type
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a type_name. + + +
+ +
+
+ + + +
+ +
+
+ +
+ \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.scss b/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.spec.ts new file mode 100644 index 00000000..ec0f1b7b --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdTypeDialogComponent } from './pd-type-dialog.component'; + +describe('PdTypeDialogComponent', () => { + let component: PdTypeDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdTypeDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdTypeDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.ts b/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.ts new file mode 100644 index 00000000..f9db8e58 --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-type-dialog/pd-type-dialog.component.ts @@ -0,0 +1,65 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './pd-type-dialog.component.html', + styleUrls: ['./pd-type-dialog.component.scss'] +}) +export class PdTypeDialogComponent implements OnInit { + + public _pdTypeForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _pdTypeService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._pdTypeForm = this._formBuilder.group({ + //branch_id: any; fk_city_id: any;pd_type_id, type_name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + pd_type_id: [this.data.pd_type_id], + type_name: [this.data.type_name, Validators.compose([Validators.required])] + }); + //console.log(this._pdTypeForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._pdTypeService.addBranch(this._pdTypeForm.value); + // this.dialogRef.close(); + // } else { + // this._pdTypeService.editBranch(this._pdTypeForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.pd_type_id)) { + var my_array = this._pdTypeForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._pdTypeService.addMasterDetails(my_array,'PDTYPE').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._pdTypeService.editMasterDetails(this._pdTypeForm.value,'PDTYPE').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._pdTypeForm.reset(); + } +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.html b/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.html new file mode 100644 index 00000000..5f73358e --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.html @@ -0,0 +1,60 @@ + +
+ +
+
+ + +
+ + + + + ID + {{user.pd_type_id}} + + + Name + {{user.type_name}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
diff --git a/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.scss b/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.spec.ts b/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.spec.ts new file mode 100644 index 00000000..32f21fbf --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdTypeListComponent } from './pd-type-list.component'; + +describe('PdTypeListComponent', () => { + let component: PdTypeListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdTypeListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdTypeListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.ts b/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.ts new file mode 100644 index 00000000..9043b6ff --- /dev/null +++ b/sineedge_front/src/app/settings/component/pd/pd-type-list/pd-type-list.component.ts @@ -0,0 +1,90 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { PdTypeDialogComponent } from '../pd-type-dialog/pd-type-dialog.component'; +import { PdType } from '../../../model/pd'; + + +@Component({ + selector: 'app-pd-type-list', + templateUrl: './pd-type-list.component.html', + styleUrls: ['./pd-type-list.component.scss'] +}) +export class PdTypeListComponent implements OnInit { + + + isPopupOpened = true; + displayedColumns = ['pd_type_id', 'type_name', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _PDTypeService: MastersService) { } + + // get PDTypeList() { + // return this._PDTypeService.getAllPDType(); + // } + + dataSource = new UserDataSource(this._PDTypeService); + + ngOnInit() { + } + + + addPDType() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(PdTypeDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editPDType(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._PDTypeService.getAllPDType().find(c => c.ID === id); + const dialogRef = this.dialog.open(PdTypeDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deletePDType(id: number) { + this._PDTypeService.deleteMasterDetails(id,'PDTYPE'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllPDType(); + } + disconnect() {} +} + + diff --git a/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.html b/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.html new file mode 100644 index 00000000..aa7273c9 --- /dev/null +++ b/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.html @@ -0,0 +1,46 @@ + +
+
Product Details
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Product name. + + +
+ +
+ + + + You must include a Product abbrevation. +
+ +
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.scss b/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.scss new file mode 100644 index 00000000..f5c65c46 --- /dev/null +++ b/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.scss @@ -0,0 +1,8 @@ + + table { + width: 100%; + } + + mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.spec.ts new file mode 100644 index 00000000..d79e7b4b --- /dev/null +++ b/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProductDialogComponent } from './product-dialog.component'; + +describe('ProductDialogComponent', () => { + let component: ProductDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ProductDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProductDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.ts b/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.ts new file mode 100644 index 00000000..f948ce80 --- /dev/null +++ b/sineedge_front/src/app/settings/component/product/product-dialog/product-dialog.component.ts @@ -0,0 +1,55 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './product-dialog.component.html', + styleUrls: ['./product-dialog.component.scss'] +}) + +export class ProductDialogComponent implements OnInit { + + public _productMasterForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._productMasterForm = this._formBuilder.group({ + //ID: [this.data.ID], + product_id: [this.data.product_id], + name: [this.data.name, Validators.compose([Validators.required])], + abbr: [this.data.abbr, Validators.compose([Validators.required])] + }); + console.log(this._productMasterForm); + } + + onSubmit() { + if(isNaN(this.data.product_id)) { + + var my_array = this._productMasterForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + //this._MastersService.addProductMaster(this._productMasterForm.value); + //this._MastersService.addProd(this._productMasterForm.value).subscribe(data=>this.array=data); + this._MastersService.addMasterDetails(my_array,'PRODUCTS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + //this._MastersService.editProductMaster(this._productMasterForm.value); + this._MastersService.editMasterDetails(this._productMasterForm.value,'PRODUCTS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/product/product-list/product-list.component.html b/sineedge_front/src/app/settings/component/product/product-list/product-list.component.html new file mode 100644 index 00000000..8338833c --- /dev/null +++ b/sineedge_front/src/app/settings/component/product/product-list/product-list.component.html @@ -0,0 +1,322 @@ + +
+ +
+
+ + + + + +
+ + + + Name + {{user.name}} + + + ID + {{user.product_id}} + + + Abbrevation + {{user.abbr}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ + + + + + + + + + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/product/product-list/product-list.component.scss b/sineedge_front/src/app/settings/component/product/product-list/product-list.component.scss new file mode 100644 index 00000000..6b4b98d6 --- /dev/null +++ b/sineedge_front/src/app/settings/component/product/product-list/product-list.component.scss @@ -0,0 +1,83 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/product/product-list/product-list.component.spec.ts b/sineedge_front/src/app/settings/component/product/product-list/product-list.component.spec.ts new file mode 100644 index 00000000..a2c901bd --- /dev/null +++ b/sineedge_front/src/app/settings/component/product/product-list/product-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProductListComponent } from './product-list.component'; + +describe('ProductListComponent', () => { + let component: ProductListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ProductListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProductListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/product/product-list/product-list.component.ts b/sineedge_front/src/app/settings/component/product/product-list/product-list.component.ts new file mode 100644 index 00000000..0855a1b2 --- /dev/null +++ b/sineedge_front/src/app/settings/component/product/product-list/product-list.component.ts @@ -0,0 +1,575 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { MastersService } from '../../../service/master/masters.service'; +import { ProductDialogComponent } from '../product-dialog/product-dialog.component'; +import { ProductMaster } from '../../../model/product-master'; +//import { DataSource } from '@angular/cdk/table'; +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'; + +@Component({ + selector: 'app-product-list', + templateUrl: './product-list.component.html', + styleUrls: ['./product-list.component.scss'] +}) +export class ProductListComponent { + + isPopupOpened = true; + + TempArray : any = []; + Temp : any = []; + TTarray : any = []; + Temp2 : any = []; + + private contacts: any = []; + + //displayedColumns = ['product_id','name','abbr','createdon','updatedon']; + displayedColumns = ['product_id','name','abbr','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + // -- @ViewChild(MatPaginator) paginator: MatPaginator; + // -- @ViewChild(MatSort) sort: MatSort; + dataSource = new UserDataSource(this._ProductService); + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + //dataSource: DataTableDataSource; + //dataSource = new MatTableDataSource; + //dataSource: MatTableDataSource; + + + constructor(private dialog: MatDialog, private _ProductService: MastersService) { + + // let newarray = this._ps.getProd().subscribe((dataresult: any[]) => { // good! + // for (let item of dataresult) { + // this.data.push(item); + // } + // return this.data; + // }); + + // this.Temp2 = this._ProductService.getProd(); + + // console.log("mattable", this.Temp2); + + + // Assign the data to the data source for the table to render + // this.dataSource = new MatTableDataSource(this.Temp2); + + + } + + get ProductMasterList() { + return this._ProductService.getAllProduct(); + } + + + // getTempArray() { + // this._ProductService.getProductMasterArrayData() + // .subscribe(_ProductArr => this.TempArray = _ProductArr); + // } + + public getProdContactsByService(){ + this._ProductService.getAllProduct().subscribe((data:any) => { + this.contacts = data; + // console.log(data); + let rec = Object.keys(this.contacts)[2]; + // console.log(this.contacts[rec]); + this.Temp = this.contacts[rec]; + console.log(this.Temp); + // for ( let key in this.contacts) { + // console.log('------------'+ key); + // console.log(this.contacts(key)); + // } + }); + } + + +// public getpostContacts(){ +// this._ProductService.addProd({name: 'Non Residential Premises Loans',abbr: 'NRPL'}) +// .subscribe(hero => this.TempArray.push(hero)); +// } + + // getProd(): void { + // this._ProductService.get2Prod() + // .subscribe(heroes => this.Temp = heroes); + // } + + //displayedColumns: string[] = ['ID','ClassifiedName']; + //dataSource = this.ProductMasterList; + + + //displayedColumns = ['name', 'email', 'phone', 'company']; + //displayedColumns = ['name', 'email', 'phone', 'company']; + // displayedColumns = ['product_id','name','abbr','createdon','fk_createdby','updatedon', 'isactive', 'fk_updatedby','actions']; + // // -- @ViewChild(MatPaginator) paginator: MatPaginator; + // // -- @ViewChild(MatSort) sort: MatSort; + // // -- dataSource = new UserDataSource(this._ProductService); + + // @ViewChild(MatPaginator) paginator: MatPaginator; + // @ViewChild(MatSort) sort: MatSort; + // //dataSource: DataTableDataSource; + // dataSource = new MatTableDataSource + + //dataSource = new MatTableDataSource(this.Temp); + + // ngOnInit() { + // this.getProdContactsByService(); + // } + + //displayedColumns: string[] = ['position','prodname','abbr','actions']; + //dataSource = new MatTableDataSource(ELEMENT_DATA1); + //dataSource = new MatTableDataSource(this.ProductMasterList); + + // @ViewChild(MatPaginator) paginator: MatPaginator; + // @ViewChild(MatSort) sort: MatSort; + + // applyFilter(filterValue: string) { + // filterValue = filterValue.trim(); // Remove whitespace + // filterValue = filterValue.toLowerCase(); // MatTableDataSource defaults to lowercase matches + // this.dataSource.filter = filterValue; + // } + + + // applyFilter(filterValue: string) { + // filterValue = filterValue.trim(); // Remove whitespace + // filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches + // this.dataSource.filter = filterValue; + // } + //ngOnInit() { + + //this.dataSource = new DataTableDataSource(this.paginator, this.sort,this._ProductService); + + // //this.getTempArray(); + // //this.getProdContactsByService(); + // //this.getProd(); + // //this.getpostContacts(); + // this.getProdContactsByService(); + // this.getProdContactsByService(); + // this.dataSource.paginator = this.paginator; + // this.dataSource.sort = this.sort; + // } + + + // ngOnInit(): void { + + // this.http.get('data/data.json') + // .map(this.extractData) + // .subscribe(persons => { + // this.persons = persons; + // // Calling the DT trigger to manually render the table + + // }); + //} + + // ngAfterViewInit() { + // this.dataSource.paginator = this.paginator; + // this.dataSource.sort = this.sort; + // } + + // applyFilter(filterValue: string) { + // filterValue = filterValue.trim(); // Remove whitespace + // filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches + // this.dataSource.filter = filterValue; + // } + + addProductMaster() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(ProductDialogComponent, { + data: {} + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //to edit dialog + editProductMaster(arr: any[]) { + //alert(arr); + console.log(arr); + this.isPopupOpened = true; + //const contact = this._ProductService.getAllProductMaster().find(c => c.ID === id); + // let contact = this._ProductService.getProd().map(res=>res.filter(data =>data.product_id == id))[0]; + // console.log(contact); + + const dialogRef = this.dialog.open(ProductDialogComponent, { + data: arr + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteProductMaster(id: number) { + console.log('Deleted ID in List Component',id) + //this._ProductService.deleteProductMaster(id); + this._ProductService.deleteMasterDetails(id,'PRODUCTS').subscribe(); + //this._ProductService.deleteProductMaster(id); + } + +} + + export interface ProductElement { + ProductName: string; + ID: number; + ProductAbbr: string; + } + + const ELEMENT_DATA1: ProductElement[] = [ + {ID: 1, ProductName: 'Home Loan',ProductAbbr: 'HL'}, + {ID: 2, ProductName: 'Non Residential Premises Loans', ProductAbbr: 'NRPL'}, + {ID: 3, ProductName: 'Loan Against Property', ProductAbbr: 'LAP'}, + {ID: 4, ProductName: 'Business Loans', ProductAbbr: 'BL'}, + {ID: 5, ProductName: 'Personal Loans', ProductAbbr: 'PL'}, + {ID: 6, ProductName: 'Land Loan', ProductAbbr: 'LL'} + ]; +/* + +import { Component, OnInit, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; +import { ProductService } from '../../service/product.service'; +import { ProductDialogComponent } from '../product-dialog/product-dialog.component'; +import { ProductMaster } from '../../model/product-master'; +import { DataSource } from '@angular/cdk/table'; +import { Observable } from 'rxjs'; + + +@Component({ + selector: 'app-product-list', + templateUrl: './product-list.component.html', + styleUrls: ['./product-list.component.scss'] +}) +export class ProductListComponent implements OnInit { + + isPopupOpened = true; + + TempArray : any = []; + TempArray2 : any = []; + public contacts: Array = []; + + constructor(private dialog: MatDialog, + private _ProductService: ProductService) { } + + get ProductMasterList() { + return this._ProductService.getAllProductMaster(); + } + + get ProdList() { + return this._ProductService.getProd(); + } + + getTempArray() { + this._ProductService.getProductMasterArrayData() + .subscribe(_ProductArr => this.TempArray = _ProductArr); + } + + public getContacts(){ + this._ProductService.getProd().subscribe((data: Array) => { + this.contacts = data; + console.log(data); + }); + } + + public getProdComponent(){ + this._ProductService.getProd().subscribe((data: Array) => { + this.contacts = data; + console.log(data); + }); +} + + ProductElement = [ + {ID: 1, ProductName: 'Home Loan',ProductAbbr: 'HL'}, + {ID: 2, ProductName: 'Non Residential Premises Loans', ProductAbbr: 'NRPL'}, + {ID: 3, ProductName: 'Loan Against Property', ProductAbbr: 'LAP'}, + {ID: 4, ProductName: 'Business Loans', ProductAbbr: 'BL'}, + {ID: 5, ProductName: 'Personal Loans', ProductAbbr: 'PL'}, + {ID: 6, ProductName: 'Land Loan', ProductAbbr: 'LL'} +]; + + + public getpostContacts(){ + this._ProductService.addProd({name: 'Non Residential Premises Loans',abbr: 'NRPL'}) + .subscribe(hero => this.TempArray2.push(hero)); + } + + //displayedColumns: string[] = ['ID','ClassifiedName']; + //dataSource = this.ProductMasterList; + + displayedColumns: string[] = ['position','prodname','abbr','actions']; + //dataSource = new MatTableDataSource(ELEMENT_DATA1); + //dataSource = new MatTableDataSource(this.ProdList); + //dataSource = new MatTableDataSource(this.ProdList); + //dataSource = new MatTableDataSource(this.ProdList); + //dataSource = new UserDataSource(this._ProductService); + // @ViewChild(MatPaginator) paginator: MatPaginator; + // @ViewChild(MatSort) sort: MatSort; + + // applyFilter(filterValue: string) { + // filterValue = filterValue.trim(); // Remove whitespace + // filterValue = filterValue.toLowerCase(); // MatTableDataSource defaults to lowercase matches + // this.dataSource.filter = filterValue; + // } + + ngOnInit() { + this.getTempArray(); + // this.getContacts(); + // this.getpostContacts(); + // this.dataSource.paginator = this.paginator; + // this.dataSource.sort = this.sort; + } + + // ngAfterViewInit() { + // this.dataSource.paginator = this.paginator; + // this.dataSource.sort = this.sort; + // this.dataSource.sort = this.sort; } + + addProductMaster() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(ProductDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editProductMaster(id: number) { + alert(id); + this.isPopupOpened = true; + const contact = this._ProductService.getAllProductMaster().find(c => c.ID === id); + const dialogRef = this.dialog.open(ProductDialogComponent, { + data: contact + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteProductMaster(id: number) { + this._ProductService.deleteProductMaster(id); + } + + + +} + + export interface ProductElement { + ProductName: string; + ID: number; + ProductAbbr: string; + } + + + export interface ProductEle { + product_id: any; + name: any; + abbr: any; + createdon: any; + fk_createdby : any; + updatedon : any; + isactive : any; + fk_updatedby :any; + } + + const ELEMENT_DATA1: ProductElement[] = [ + {ID: 1, ProductName: 'Home Loan',ProductAbbr: 'HL'}, + {ID: 2, ProductName: 'Non Residential Premises Loans', ProductAbbr: 'NRPL'}, + {ID: 3, ProductName: 'Loan Against Property', ProductAbbr: 'LAP'}, + {ID: 4, ProductName: 'Business Loans', ProductAbbr: 'BL'}, + {ID: 5, ProductName: 'Personal Loans', ProductAbbr: 'PL'}, + {ID: 6, ProductName: 'Land Loan', ProductAbbr: 'LL'} + ]; + +*/ + +export class UserDataSource extends DataSource { + + // paginator: MatPaginator; + // sort: MatSort; + + constructor(private _ps:MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._ps.getAllProduct(); + } + disconnect() {} +} + + + +export class DataTableDataSource extends DataSource { + + data:any[] = []; + //private contacts: Array = []; + + constructor(private paginator: MatPaginator, private sort: MatSort, private _ps: MastersService ) { + super(); + + // this._ps.getProd().subscribe((dataresult: any[]) => { // good! + // for (let item of dataresult) { + // this.data.push(item); + // } + // console.log("DataTableDataSource Constructor", this.data); + // }); + + } + +// public getProdContactsByService(){ + +// this._ps.get2Prod().subscribe((data: Array) => { + +// this.contacts = data; + +// console.log(data); +// }); +// } + + //data = this.contacts; + + /** + * Connect this data source to the table. The table will only update when + * the returned stream emits new items. + * @returns A stream of the items to be rendered. + */ + // connect(): Observable { + // // Combine everything that affects the rendered data into one update + // // stream for the data-table to consume. + // const dataMutations = [ + // observableOf(this.data), + // this.paginator.page, + // this.sort.sortChange + // ]; + + // // Set the paginators length + // this.paginator.length = this.data.length; + + // return merge(...dataMutations).pipe(map(() => { + // return this.getPagedData(this.getSortedData([...this.data])); + // })); + // } + + + connect(): Observable { + + + let newarray = this._ps.getAllProduct().subscribe((dataresult: any[]) => { // good! + for (let item of dataresult) { + this.data.push(item); + } + return this.data; + }); + + console.log("DataTableDataSource", newarray); + + // return this._ps.getProd(); + + // Combine everything that affects the rendered data into one update + // stream for the data-table to consume. + const dataMutations = [ + observableOf(newarray), + this.paginator.page, + this.sort.sortChange + ]; + console.log("DataTableDataSource Connect to datasources", newarray); + // Set the paginators length + this.paginator.length = this.data.length; + console.log("DataTableDataSource Page Length", this.paginator.length); + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + + // connect(): Observable { + + // //this.data = this._ps.getProd(); + // this._ps.getProd().subscribe((dataresult: any[]) => { // good! + // for (let item of dataresult) { + // this.data.push(item); + // } + // console.log("DataTableDataSource to Connect ", this.data); + // }); + + // // Combine everything that affects the rendered data into one update + // // stream for the data-table to consume. + // // const dataMutations = [ + // // observableOf(this.data), + // // this.paginator.page, + // // this.sort.sortChange + // // ]; + // // console.log("DataTableDataSource Connect to datasources", this.data); + // // // Set the paginators length + // // this.paginator.length = this.data.length; + // // console.log("DataTableDataSource Page Length", this.paginator.length); + + // // return merge(...dataMutations).pipe(map(() => { + // // return this.getPagedData(this.getSortedData([...this.data])); + // // })); + + // //return this.userService.getUser(); + // return this._ps.getProd(); + // } + + /** + * Called when the table is being destroyed. Use this function, to clean up + * any open connections or free any held resources that were set up during connect. + */ + disconnect() {} + + /** + * Paginate the data (client-side). If you're using server-side pagination, + * this would be replaced by requesting the appropriate data from the server. + */ + private getPagedData(data: any[]) { + console.log("DataTableDataSource GetPageData", data); + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + /** + * Sort the data (client-side). If you're using server-side sorting, + * this would be replaced by requesting the appropriate data from the server. + */ + private getSortedData(data: any[]) { + console.log("DataTableDataSource GetSortedData", data); + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'product_id': return compare(a.product_id, b.product_id, isAsc); + case 'name': return compare(a.name, b.name, isAsc); + case 'abbr': return compare(a.abbr, b.abbr, isAsc); + case 'createdon': return compare(a.createdon, b.createdon, isAsc); + case 'fk_createdby': return compare(a.fk_createdby, b.fk_createdby, isAsc); + case 'updatedon': return compare(a.updatedon, b.updatedon, isAsc); + case 'isactive': return compare(a.isactive, b.isactive, isAsc); + case 'fk_updatedby': return compare(a.fk_updatedby, b.fk_updatedby, isAsc); + // case 'name': return compare(a.name, b.name, isAsc); + // case 'amount' : return compare(a.amount,b.amount, isAsc); + // case 'id': return compare(+a.id, +b.id, isAsc); + default: return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.html b/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.html new file mode 100644 index 00000000..83b464b3 --- /dev/null +++ b/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.html @@ -0,0 +1,42 @@ + +
+
Region
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+ + +
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.scss b/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.spec.ts new file mode 100644 index 00000000..b7795990 --- /dev/null +++ b/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RegionsDialogComponent } from './regions-dialog.component'; + +describe('RegionsDialogComponent', () => { + let component: RegionsDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RegionsDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RegionsDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.ts b/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.ts new file mode 100644 index 00000000..227e0fa7 --- /dev/null +++ b/sineedge_front/src/app/settings/component/regions/regions-dialog/regions-dialog.component.ts @@ -0,0 +1,66 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './regions-dialog.component.html', + styleUrls: ['./regions-dialog.component.scss'] +}) +export class RegionsDialogComponent implements OnInit { + + public _regionsForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _regionsService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._regionsForm = this._formBuilder.group({ + //Regions_id: any; fk_city_id: any; + region_id: [this.data.region_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._regionsForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._regionsService.addRegions(this._regionsForm.value); + // this.dialogRef.close(); + // } else { + // this._regionsService.editRegions(this._regionsForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.region_id)) { + var my_array = this._regionsForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._regionsService.addMasterDetails(my_array,'REGIONS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._regionsService.editMasterDetails(this._regionsForm.value,'REGIONS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._regionsForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.html b/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.html new file mode 100644 index 00000000..73b874e4 --- /dev/null +++ b/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.html @@ -0,0 +1,61 @@ + +
+ +
+
+ + +
+ + + + + Name + {{user.name}} + + + ID + {{user.region_id}} + + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.scss b/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.spec.ts b/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.spec.ts new file mode 100644 index 00000000..6b77ed40 --- /dev/null +++ b/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RegionsListComponent } from './regions-list.component'; + +describe('RegionsListComponent', () => { + let component: RegionsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RegionsListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RegionsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.ts b/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.ts new file mode 100644 index 00000000..deb650b3 --- /dev/null +++ b/sineedge_front/src/app/settings/component/regions/regions-list/regions-list.component.ts @@ -0,0 +1,89 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { RegionsDialogComponent } from '../regions-dialog/regions-dialog.component'; +import { Regions } from '../../../model/regions'; + + +@Component({ + selector: 'app-regions-list', + templateUrl: './regions-list.component.html', + styleUrls: ['./regions-list.component.scss'] +}) +export class RegionsListComponent implements OnInit { + + + isPopupOpened = true; + displayedColumns = ['region_id', 'name', 'isactive','actions']; + //region_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _regionsService: MastersService) { } + + // get regionsList() { + // return this._regionsService.getAllregions(); + // } + + dataSource = new UserDataSource(this._regionsService); + + ngOnInit() { + } + + + addregions() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(RegionsDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editregions(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._regionsService.getAllregions().find(c => c.ID === id); + const dialogRef = this.dialog.open(RegionsDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteregions(id: number) { + this._regionsService.deleteMasterDetails(id,'REGIONS'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllRegion(); + } + disconnect() {} +} + diff --git a/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html new file mode 100644 index 00000000..4a71c3bd --- /dev/null +++ b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html @@ -0,0 +1,41 @@ + +
+
Relation Ship
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.scss b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.spec.ts new file mode 100644 index 00000000..71a8031e --- /dev/null +++ b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RelationShipDialogComponent } from './relation-ship-dialog.component'; + +describe('RelationShipDialogComponent', () => { + let component: RelationShipDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RelationShipDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RelationShipDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts new file mode 100644 index 00000000..862a1ba6 --- /dev/null +++ b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './relation-ship-dialog.component.html', + styleUrls: ['./relation-ship-dialog.component.scss'] +}) +export class RelationShipDialogComponent implements OnInit { + + + public _relationShipForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef< RelationShipDialogComponent>, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._relationShipForm = this._formBuilder.group({ + relationship_id: [this.data.relationship_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._relationShipForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addRelationShip(this._relationShipForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editRelationShip(this._relationShipForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.relationship_id)) { + var my_array = this._relationShipForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'RELATIONSHIPS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._MastersService.editMasterDetails(this._relationShipForm.value,'RELATIONSHIPS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + onReset(){ + this._relationShipForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.html b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.html new file mode 100644 index 00000000..414d992b --- /dev/null +++ b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.html @@ -0,0 +1,77 @@ + +
+ +
+
+ + +
+ + + + Name + {{user.name}} + + + ID + {{user.relationship_id}} + + + Abbrevation + {{user.abbr}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.scss b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.scss new file mode 100644 index 00000000..4f2fcbd8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.scss @@ -0,0 +1,24 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.spec.ts b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.spec.ts new file mode 100644 index 00000000..9bc48ca0 --- /dev/null +++ b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RelationShipListComponent } from './relation-ship-list.component'; + +describe('RelationShipListComponent', () => { + let component: RelationShipListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RelationShipListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RelationShipListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.ts b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.ts new file mode 100644 index 00000000..13c7e45d --- /dev/null +++ b/sineedge_front/src/app/settings/component/relation-ship/relation-ship-list/relation-ship-list.component.ts @@ -0,0 +1,95 @@ +// import { Component, OnInit } from '@angular/core'; +// import { MatDialog, MatPaginator, MatTableDataSource } from '@angular/material'; + +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { RelationShipDialogComponent } from '../relation-ship-dialog/relation-ship-dialog.component'; +import { RelationShip } from '../../../model/relation-ship'; + + +@Component({ + selector: 'app-relation-ship-list', + templateUrl: './relation-ship-list.component.html', + styleUrls: ['./relation-ship-list.component.scss'] +}) +export class RelationShipListComponent implements OnInit { + + isPopupOpened = true; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get RelationShipList() { + // return this._MastersService.getAllRelationShip(); + // } + + displayedColumns = ['relationship_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //relationship_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + ngOnInit() { + } + + dataSource = new UserDataSource(this._MastersService); + + addRelationShip() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(RelationShipDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editRelationShip(arr: any) { + this.isPopupOpened = true; + // const contact = this._MastersService.getAllRelationShip().find(c => c.ID === id); + const dialogRef = this.dialog.open(RelationShipDialogComponent, { + + data : arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteRelationShip(id: number) { + this._MastersService.deleteMasterDetails(id,'RELATIONSHIPS'); + } +} + + + +export class UserDataSource extends DataSource { + + constructor(private _rss:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._rss.getAllRelationShip(); + } + disconnect() {} +} + + diff --git a/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.html b/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.html new file mode 100644 index 00000000..d628d172 --- /dev/null +++ b/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.html @@ -0,0 +1,66 @@ + +
+
State
+
+
+
+ + +
+ +
+ + +
+ + + {{ sd.name }} + + You must include a Region. + +
+ +
+ + + You must include a Name. + + +
+
+ +
+
+ + + You must include a Code. + + +
+ +
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.scss b/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.spec.ts new file mode 100644 index 00000000..ce8f2a82 --- /dev/null +++ b/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StatesDialogComponent } from './states-dialog.component'; + +describe('StatesDialogComponent', () => { + let component: StatesDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StatesDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StatesDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.ts b/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.ts new file mode 100644 index 00000000..cb017ee2 --- /dev/null +++ b/sineedge_front/src/app/settings/component/states/states-dialog/states-dialog.component.ts @@ -0,0 +1,94 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; +import { States } from '../../../model/states'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './states-dialog.component.html', + styleUrls: ['./states-dialog.component.scss'] +}) +export class StatesDialogComponent implements OnInit { + + public _statesForm: FormGroup; + foundBooks: any; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + // get RegionData(){ + // return this._MastersService.getRegionData().subscribe( + // data => { this.foundBooks = data }); + // } + + // getBooks() + // { + // this._MastersService.getRegionData().subscribe( + // data => { this.foundBooks = data.json(); + // this.foundBooks = Array.of(this.foundBooks); + // }, + // err => console.error(err), + // () => console.log('getBooks completed') + // ); + // } + + + + ngOnInit() { + // console.log(this._MastersService.getRegionData()); + //console.log('RegionData',this.RegionData); + //console.log('getBooks',this.getBooks); + //console.log('foundBooks',this.foundBooks); + + this._statesForm = this._formBuilder.group({ + //States_id: any; fk_city_id: any; + state_id: [this.data.state_id], + name: [this.data.name, Validators.compose([Validators.required])], + code: [this.data.code, Validators.compose([Validators.required])], + fk_region_id : [this.data.fk_region_id, Validators.compose([Validators.required])] + }); + //console.log(this._statesForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addStates(this._statesForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editStates(this._statesForm.value); + // this.dialogRef.close(); + // } + // } + + + + onSubmit() { + if(isNaN(this.data.state_id)) { + var my_array = this._statesForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'STATES').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._statesForm.value,'STATES').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._statesForm.reset(); + } +} + diff --git a/sineedge_front/src/app/settings/component/states/states-list/states-list.component.html b/sineedge_front/src/app/settings/component/states/states-list/states-list.component.html new file mode 100644 index 00000000..747b9f85 --- /dev/null +++ b/sineedge_front/src/app/settings/component/states/states-list/states-list.component.html @@ -0,0 +1,93 @@ + +
+ +
+
+ +
+ +
+
+ + + + Name + {{user.name}} + + + + ID + {{user.state_id}} + + + Region name + {{user.fk_region_id}} + + + code + {{user.code}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/states/states-list/states-list.component.scss b/sineedge_front/src/app/settings/component/states/states-list/states-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/states/states-list/states-list.component.spec.ts b/sineedge_front/src/app/settings/component/states/states-list/states-list.component.spec.ts new file mode 100644 index 00000000..ba198df6 --- /dev/null +++ b/sineedge_front/src/app/settings/component/states/states-list/states-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StatesListComponent } from './states-list.component'; + +describe('StatesListComponent', () => { + let component: StatesListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StatesListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StatesListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/states/states-list/states-list.component.ts b/sineedge_front/src/app/settings/component/states/states-list/states-list.component.ts new file mode 100644 index 00000000..b19d86f5 --- /dev/null +++ b/sineedge_front/src/app/settings/component/states/states-list/states-list.component.ts @@ -0,0 +1,89 @@ +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'; + +import { MastersService } from '../../../service/master/masters.service'; +import { StatesDialogComponent } from '../states-dialog/states-dialog.component'; +import { States } from '../../../model/states'; + + +@Component({ + selector: 'app-states-list', + templateUrl: './states-list.component.html', + styleUrls: ['./states-list.component.scss'] +}) +export class StatesListComponent implements OnInit { + + isPopupOpened = true; + //displayedColumns = ['states_id', 'fk_city_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions']; + displayedColumns = ['state_id', 'fk_region_id', 'name', 'code', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _statesService: MastersService) { } + + // get StatesList() { + // return this._statesService.getAllStates(); + // } + + dataSource = new UserDataSource(this._statesService); + + ngOnInit() { + } + + + addState() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(StatesDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editState(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._statesService.getAllStates().find(c => c.ID === id); + const dialogRef = this.dialog.open(StatesDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteState(id: number) { + this._statesService.deleteMasterDetails(id,''); + } + + +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllState(); + } + disconnect() {} +} diff --git a/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.html b/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.html new file mode 100644 index 00000000..693a911c --- /dev/null +++ b/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.html @@ -0,0 +1,75 @@ + + +
+
Sub Product Details
+
+
+
+ + +
+ +
+ + +
+ +
+ + + {{ sd.name }} + + You must include a Product name. + +
+ + +
+ +
+ + + You must include a Sub Product name. + + +
+ + +
+ + + You must include a Sub Product Abbrevation. + + +
+ +
+
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.scss b/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.spec.ts new file mode 100644 index 00000000..fd75bb33 --- /dev/null +++ b/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SubProductDialogComponent } from './sub-product-dialog.component'; + +describe('SubProductDialogComponent', () => { + let component: SubProductDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SubProductDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SubProductDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts b/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts new file mode 100644 index 00000000..2a70ca34 --- /dev/null +++ b/sineedge_front/src/app/settings/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts @@ -0,0 +1,60 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './sub-product-dialog.component.html', + styleUrls: ['./sub-product-dialog.component.scss'] +}) +export class SubProductDialogComponent implements OnInit { + + public _subProductMasterForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._subProductMasterForm = this._formBuilder.group({ + subproduct_id: [this.data.subproduct_id], + name: [this.data.name, Validators.compose([Validators.required])], + fk_product_id: [this.data.fk_product_id, Validators.compose([Validators.required])], + abbr: [this.data.abbr, Validators.compose([Validators.required])] + }); + //console.log(this._industryMasterForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addSubProductMaster(this._subProductMasterForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editSubProductMaster(this._subProductMasterForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.subproduct_id)) { + var my_array = this._subProductMasterForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'SUBPRODUCTS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._MastersService.editMasterDetails(this._subProductMasterForm.value,'SUBPRODUCTS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.html b/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.html new file mode 100644 index 00000000..61e02ca1 --- /dev/null +++ b/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.html @@ -0,0 +1,85 @@ + +
+ +
+
+ + + +
+ + + + Name + {{user.name}} + + + ID + {{user.subproduct_id}} + + + Product Name + {{user.fk_product_id}} + + + Abbrevation + {{user.abbr}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.scss b/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.scss new file mode 100644 index 00000000..4f2fcbd8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.scss @@ -0,0 +1,24 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.spec.ts b/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.spec.ts new file mode 100644 index 00000000..9413c858 --- /dev/null +++ b/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SubProductListComponent } from './sub-product-list.component'; + +describe('SubProductListComponent', () => { + let component: SubProductListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SubProductListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SubProductListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.ts b/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.ts new file mode 100644 index 00000000..ac5822ca --- /dev/null +++ b/sineedge_front/src/app/settings/component/sub-product/sub-product-list/sub-product-list.component.ts @@ -0,0 +1,90 @@ +// import { Component, OnInit } from '@angular/core'; +// import { MatDialog, MatPaginator, MatTableDataSource } from '@angular/material'; +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { SubProductDialogComponent } from '../sub-product-dialog/sub-product-dialog.component'; +import { SubProductMaster } from '../../../model/sub-product-master'; + +@Component({ + selector: 'app-sub-product-list', + templateUrl: './sub-product-list.component.html', + styleUrls: ['./sub-product-list.component.scss'] +}) +export class SubProductListComponent implements OnInit { + + isPopupOpened = true; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get SubProductMasterList() { + // return this._MastersService.getAllSubProductMaster(); + // } + + displayedColumns = ['subproduct_id','fk_product_id','name','abbr','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //subproduct_id, fk_product_id, name, abbr, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + dataSource = new UserDataSource(this._MastersService); + + + ngOnInit() { + } + + + addSubProductMaster() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(SubProductDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editSubProductMaster(arr : any) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllSubProductMaster().find(c => c.ID === id); + const dialogRef = this.dialog.open(SubProductDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteSubProductMaster(id: number) { + this._MastersService.deleteMasterDetails(id,'SUBPRODUCTS'); + } +} + +export class UserDataSource extends DataSource { + + constructor(private _sps:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._sps.getAllSubProductMaster(); + } + disconnect() {} +} diff --git a/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.html b/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.html new file mode 100644 index 00000000..10a009c1 --- /dev/null +++ b/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.html @@ -0,0 +1,41 @@ + +
+
Title
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Title. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.scss b/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.spec.ts new file mode 100644 index 00000000..75bed54b --- /dev/null +++ b/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TitleDialogComponent } from './title-dialog.component'; + +describe('TitleDialogComponent', () => { + let component: TitleDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TitleDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TitleDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.ts b/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.ts new file mode 100644 index 00000000..09fcc64e --- /dev/null +++ b/sineedge_front/src/app/settings/component/title/title-dialog/title-dialog.component.ts @@ -0,0 +1,63 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './title-dialog.component.html', + styleUrls: ['./title-dialog.component.scss'] +}) +export class TitleDialogComponent implements OnInit { + + + public _titleForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._titleForm = this._formBuilder.group({ + title_id: [this.data.title_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._titleForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._contactService.addTitle(this._titleForm.value); + // this.dialogRef.close(); + // } else { + // this._contactService.editTitle(this._titleForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.title_id)) { + var my_array = this._titleForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'TITLES').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._MastersService.editMasterDetails(this._titleForm.value,'TITLES').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + onReset(){ + this._titleForm.reset(); + } +} + diff --git a/sineedge_front/src/app/settings/component/title/title-list/title-list.component.html b/sineedge_front/src/app/settings/component/title/title-list/title-list.component.html new file mode 100644 index 00000000..1f7143eb --- /dev/null +++ b/sineedge_front/src/app/settings/component/title/title-list/title-list.component.html @@ -0,0 +1,77 @@ + +
+ +
+
+ + +
+ + + + Name + {{user.name}} + + + ID + {{user.title_id}} + + + Abbrevation + {{user.abbr}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
+ + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/title/title-list/title-list.component.scss b/sineedge_front/src/app/settings/component/title/title-list/title-list.component.scss new file mode 100644 index 00000000..4f2fcbd8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/title/title-list/title-list.component.scss @@ -0,0 +1,24 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/title/title-list/title-list.component.spec.ts b/sineedge_front/src/app/settings/component/title/title-list/title-list.component.spec.ts new file mode 100644 index 00000000..cce70c5f --- /dev/null +++ b/sineedge_front/src/app/settings/component/title/title-list/title-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TitleListComponent } from './title-list.component'; + +describe('TitleListComponent', () => { + let component: TitleListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TitleListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TitleListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/title/title-list/title-list.component.ts b/sineedge_front/src/app/settings/component/title/title-list/title-list.component.ts new file mode 100644 index 00000000..21b3c376 --- /dev/null +++ b/sineedge_front/src/app/settings/component/title/title-list/title-list.component.ts @@ -0,0 +1,92 @@ +// import { Component, OnInit } from '@angular/core'; +// import { MatDialog, MatPaginator, MatTableDataSource } from '@angular/material'; + +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { TitleDialogComponent } from '../title-dialog/title-dialog.component'; +import { Title } from '../../../model/title'; + +@Component({ + selector: 'app-title-list', + templateUrl: './title-list.component.html', + styleUrls: ['./title-list.component.scss'] +}) +export class TitleListComponent implements OnInit { + + isPopupOpened = true; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + displayedColumns = ['title_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + + //title_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + dataSource = new UserDataSource(this._MastersService); + + + // get TitleList() { + // return this._MastersService.getAllTitle(); + // } + + + ngOnInit() { + } + + + addTitle() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(TitleDialogComponent , { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editTitle(arr : any) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllTitle().find(c => c.ID === id); + const dialogRef = this.dialog.open(TitleDialogComponent , { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteTitle(id: number) { + this._MastersService.deleteMasterDetails(id,'TITLES'); + } +} + +export class UserDataSource extends DataSource { + + constructor(private _ts:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._ts.getAllTitle(); + } + disconnect() {} +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.html b/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.html new file mode 100644 index 00000000..89cbf8da --- /dev/null +++ b/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.html @@ -0,0 +1,41 @@ + + +
+
Type of activity
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.scss b/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.scss new file mode 100644 index 00000000..3e80f0db --- /dev/null +++ b/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.spec.ts new file mode 100644 index 00000000..ae3d3e8f --- /dev/null +++ b/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ActivityDialogComponent } from './activity-dialog.component'; + +describe('ActivityDialogComponent', () => { + let component: ActivityDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ActivityDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ActivityDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.ts b/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.ts new file mode 100644 index 00000000..c7619214 --- /dev/null +++ b/sineedge_front/src/app/settings/component/type-of-activity/activity-dialog/activity-dialog.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +import { MastersService } from '../../../service/master/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './activity-dialog.component.html', + styleUrls: ['./activity-dialog.component.scss'] +}) +export class ActivityDialogComponent implements OnInit { + + public _activityMasterForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._activityMasterForm = this._formBuilder.group({ + type_of_activity_id: [this.data.type_of_activity_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._activityMasterForm); + } + + onSubmit() { + if(isNaN(this.data.type_of_activity_id)) { + var my_array = this._activityMasterForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'TYPEOFACTIVITY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._activityMasterForm.value,'TYPEOFACTIVITY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addActivity(this._activityMasterForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editActivity(this._activityMasterForm.value); + // this.dialogRef.close(); + // } + // } + + onReset(){ + this._activityMasterForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.html b/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.html new file mode 100644 index 00000000..1bd8831e --- /dev/null +++ b/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.html @@ -0,0 +1,72 @@ + +
+ +
+
+ + +
+ + + + Name + {{user.name}} + + + ID + {{user.type_of_activity_id}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ + + +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.scss b/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.scss new file mode 100644 index 00000000..4f2fcbd8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.scss @@ -0,0 +1,24 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.spec.ts b/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.spec.ts new file mode 100644 index 00000000..4d660e1c --- /dev/null +++ b/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ActivityListComponent } from './activity-list.component'; + +describe('ActivityListComponent', () => { + let component: ActivityListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ActivityListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ActivityListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.ts b/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.ts new file mode 100644 index 00000000..c483eb0b --- /dev/null +++ b/sineedge_front/src/app/settings/component/type-of-activity/activity-list/activity-list.component.ts @@ -0,0 +1,83 @@ +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { ActivityDialogComponent } from '../activity-dialog/activity-dialog.component'; +import { Activity } from '../../../model/activity'; + +@Component({ + selector: 'app-activity-list', + templateUrl: './activity-list.component.html', + styleUrls: ['./activity-list.component.scss'] +}) +export class ActivityListComponent implements OnInit { + + isPopupOpened = true; + + displayedColumns = ['type_of_activity_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() {} + + + addActivity() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(ActivityDialogComponent, { + data: {} + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + + editActivity(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllActivity().find(c => c.ID === id); + const dialogRef = this.dialog.open(ActivityDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteActivity(id: number) { + this._MastersService.deleteMasterDetails(id,'TYPEOFACTIVITY').subscribe(); + } + +} + + +export class UserDataSource extends DataSource { + + + constructor(private _as:MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._as.getAllActivity(); + } + disconnect() {} +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.html b/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.html new file mode 100644 index 00000000..2072d79c --- /dev/null +++ b/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.html @@ -0,0 +1,40 @@ + +
+
Unit of Measurement
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.scss b/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.spec.ts b/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.spec.ts new file mode 100644 index 00000000..d38e5da1 --- /dev/null +++ b/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UomDialogComponent } from './uom-dialog.component'; + +describe('UomDialogComponent', () => { + let component: UomDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UomDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UomDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.ts b/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.ts new file mode 100644 index 00000000..377fb150 --- /dev/null +++ b/sineedge_front/src/app/settings/component/uom/uom-dialog/uom-dialog.component.ts @@ -0,0 +1,65 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../service/master/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './uom-dialog.component.html', + styleUrls: ['./uom-dialog.component.scss'] +}) +export class UomDialogComponent implements OnInit { + + + public _uomForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _mastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._uomForm = this._formBuilder.group({ + // ID: [this.data.ID], + // Name: [this.data.Name, Validators.compose([Validators.required])] + // uom_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + uom_id: [this.data.uom_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._UomForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._mastersService.addUom(this._uomForm.value); + // this.dialogRef.close(); + // } else { + // this._mastersService.editUom(this._uomForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.subproduct_id)) { + var my_array = this._uomForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._mastersService.addMasterDetails(my_array,'UOM').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._mastersService.editMasterDetails(this._uomForm.value,'UOM').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + onReset(){ + this._uomForm.reset(); + } +} diff --git a/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.html b/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.html new file mode 100644 index 00000000..4f7d0766 --- /dev/null +++ b/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.html @@ -0,0 +1,72 @@ + +
+ +
+
+ + +
+ + + + Name + {{user.name}} + + + ID + {{user.uom_id}} + + + createdon + {{user.createdon}} + + + createdby + {{user.fk_createdby}} + + + updated on + {{user.updatedon}} + + + updatedby + {{user.fk_updatedby}} + + + isactive + {{user.isactive}} + + + + + + + + + + + + +
+ +
\ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.scss b/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.scss new file mode 100644 index 00000000..4f2fcbd8 --- /dev/null +++ b/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.scss @@ -0,0 +1,24 @@ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } \ No newline at end of file diff --git a/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.spec.ts b/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.spec.ts new file mode 100644 index 00000000..b21e7529 --- /dev/null +++ b/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UomListComponent } from './uom-list.component'; + +describe('UomListComponent', () => { + let component: UomListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UomListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UomListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.ts b/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.ts new file mode 100644 index 00000000..3506f923 --- /dev/null +++ b/sineedge_front/src/app/settings/component/uom/uom-list/uom-list.component.ts @@ -0,0 +1,95 @@ +// import { Component, OnInit } from '@angular/core'; +// import { MatDialog, MatPaginator, MatTableDataSource } from '@angular/material'; + +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'; + + +import { MastersService } from '../../../service/master/masters.service'; +import { UomDialogComponent } from '../uom-dialog/uom-dialog.component'; +import { Uom } from '../../../model/uom'; + + + +@Component({ + selector: 'app-uom-list', + templateUrl: './uom-list.component.html', + styleUrls: ['./uom-list.component.scss'] +}) +export class UomListComponent implements OnInit { + + isPopupOpened = true; + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get UOMList() { + // return this._MastersService.getAllUom(); + // } + + ngOnInit() { + } + + displayedColumns = ['uom_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //uom_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + dataSource = new UserDataSource(this._MastersService); + + + addUOM() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open( UomDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editUOM(arr : any) { + this.isPopupOpened = true; + // const contact = this._MastersService.getAllUom().find(c => c.ID === id); + const dialogRef = this.dialog.open( UomDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + deleteUOM(id: number) { + this._MastersService.deleteMasterDetails(id,'UOM'); + } +} + + +export class UserDataSource extends DataSource { + + constructor(private _us:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._us.getAllUom(); + } + disconnect() {} +} + + + diff --git a/sineedge_front/src/app/settings/model/activity.ts b/sineedge_front/src/app/settings/model/activity.ts new file mode 100644 index 00000000..a431ed1c --- /dev/null +++ b/sineedge_front/src/app/settings/model/activity.ts @@ -0,0 +1,11 @@ +export class Activity { + + type_of_activity_id: any; + name: any; + createdon: any; + fk_createdby: any; + updatedon: any; + fk_updatedby: any; + isactive: any; + +} diff --git a/sineedge_front/src/app/settings/model/branch.ts b/sineedge_front/src/app/settings/model/branch.ts new file mode 100644 index 00000000..34b42144 --- /dev/null +++ b/sineedge_front/src/app/settings/model/branch.ts @@ -0,0 +1,24 @@ +export class Branch { + // ID: number; + // CityID: string; + // Name: string; + branch_id: any; + fk_city_id: any; + name: any; + createdon: any; + fk_createdby: any; + updatedon: any; + fk_updatedby: any; + isactive: any; +} +export class States { + state_id: any; + name: any; + isactive: any; +} +export class City { + city_id: any; + name: any; + isactive: any; +} + diff --git a/sineedge_front/src/app/settings/model/city.ts b/sineedge_front/src/app/settings/model/city.ts new file mode 100644 index 00000000..ab95b089 --- /dev/null +++ b/sineedge_front/src/app/settings/model/city.ts @@ -0,0 +1,4 @@ +export class City { + + city_id: any; fk_state_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/comments-on-locality.ts b/sineedge_front/src/app/settings/model/comments-on-locality.ts new file mode 100644 index 00000000..acccd906 --- /dev/null +++ b/sineedge_front/src/app/settings/model/comments-on-locality.ts @@ -0,0 +1,3 @@ +export class CommentsOnLocality { + comments_on_locality_id: any; rating: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/company.ts b/sineedge_front/src/app/settings/model/company.ts new file mode 100644 index 00000000..40a49777 --- /dev/null +++ b/sineedge_front/src/app/settings/model/company.ts @@ -0,0 +1,3 @@ +export class Company { + company_id: any; name: any; addressline1: any; addressline2: any; pincode: any; logo: any; company_master_createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; addressline3: any; state: any; city: any; +} diff --git a/sineedge_front/src/app/settings/model/customer-behaviour.ts b/sineedge_front/src/app/settings/model/customer-behaviour.ts new file mode 100644 index 00000000..f8c1d90a --- /dev/null +++ b/sineedge_front/src/app/settings/model/customer-behaviour.ts @@ -0,0 +1,4 @@ +export class CustomerBehaviour { + + customer_behaviour_id: any; description: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/customer-segment.ts b/sineedge_front/src/app/settings/model/customer-segment.ts new file mode 100644 index 00000000..32e6c1fe --- /dev/null +++ b/sineedge_front/src/app/settings/model/customer-segment.ts @@ -0,0 +1,3 @@ +export class CustomerSegment { + customer_segment_id: any; name: any; abbr: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; fk_updatedby: any; +} diff --git a/sineedge_front/src/app/settings/model/designation.ts b/sineedge_front/src/app/settings/model/designation.ts new file mode 100644 index 00000000..f0f29738 --- /dev/null +++ b/sineedge_front/src/app/settings/model/designation.ts @@ -0,0 +1,4 @@ +export class Designation { + + designation_id: any; name: any; short_name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/entity-type.ts b/sineedge_front/src/app/settings/model/entity-type.ts new file mode 100644 index 00000000..b8529b43 --- /dev/null +++ b/sineedge_front/src/app/settings/model/entity-type.ts @@ -0,0 +1,3 @@ +export class EntityType { + entity_type_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/frequency.ts b/sineedge_front/src/app/settings/model/frequency.ts new file mode 100644 index 00000000..26741b3c --- /dev/null +++ b/sineedge_front/src/app/settings/model/frequency.ts @@ -0,0 +1,6 @@ +export class Frequency { + // ID: number; + // Name: string; + + frequency_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/industry_classification.ts b/sineedge_front/src/app/settings/model/industry_classification.ts new file mode 100644 index 00000000..9a0e464e --- /dev/null +++ b/sineedge_front/src/app/settings/model/industry_classification.ts @@ -0,0 +1,16 @@ +export class IndustryClassification { + //ID: number; + //ClassifiedName: string; + // LastName: string; + // Contact: string; + // Email: string; + + industry_classification_id: any; + name: any; + createdon: any; + fk_createdby: any; + updatedon: any; + fk_updatedby: any; + isactive: any; +} + diff --git a/sineedge_front/src/app/settings/model/lender-hierarchy.ts b/sineedge_front/src/app/settings/model/lender-hierarchy.ts new file mode 100644 index 00000000..48751cbf --- /dev/null +++ b/sineedge_front/src/app/settings/model/lender-hierarchy.ts @@ -0,0 +1,4 @@ +export class LenderHierarchy { + lender_hierarchy_id: any; lender_hierarchy: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; +} + \ No newline at end of file diff --git a/sineedge_front/src/app/settings/model/members-occupation.ts b/sineedge_front/src/app/settings/model/members-occupation.ts new file mode 100644 index 00000000..c2cd72a9 --- /dev/null +++ b/sineedge_front/src/app/settings/model/members-occupation.ts @@ -0,0 +1,11 @@ +export class MembersOccupation { + // ID: number; + // Name: string; + occupation_non_earning_member_id: any; + name: any; + createdon: any; + fk_createdby: any; + updatedon: any; + fk_updatedby: any; + isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/pd.ts b/sineedge_front/src/app/settings/model/pd.ts new file mode 100644 index 00000000..d31d4dfe --- /dev/null +++ b/sineedge_front/src/app/settings/model/pd.ts @@ -0,0 +1,15 @@ +export class PdAllocationType { + pd_allocation_type_id: any; pd_allocation_type_name: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; +} + +export class PdLocationApproach { + pd_location_approach_id: any; description: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} + +export class PdStatus { + pd_status_id: any; pd_status_name: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; +} + +export class PdType { + pd_type_id: any; type_name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/model/product-master.ts b/sineedge_front/src/app/settings/model/product-master.ts new file mode 100644 index 00000000..ef2a7176 --- /dev/null +++ b/sineedge_front/src/app/settings/model/product-master.ts @@ -0,0 +1,16 @@ +export class ProductMaster { +// ID: number; +// ProductName: string; +// ProductAbbr: string; + + product_id: any; + name: any; + abbr: any; + createdon: any; + fk_createdby : any; + updatedon : any; + isactive : any; + fk_updatedby :any; + +} + diff --git a/sineedge_front/src/app/settings/model/regions.ts b/sineedge_front/src/app/settings/model/regions.ts new file mode 100644 index 00000000..7087bb44 --- /dev/null +++ b/sineedge_front/src/app/settings/model/regions.ts @@ -0,0 +1,3 @@ +export class Regions { + region_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/relation-ship.ts b/sineedge_front/src/app/settings/model/relation-ship.ts new file mode 100644 index 00000000..540da038 --- /dev/null +++ b/sineedge_front/src/app/settings/model/relation-ship.ts @@ -0,0 +1,6 @@ +export class RelationShip { + // ID: number; + // Name: string; + + relationship_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/states.ts b/sineedge_front/src/app/settings/model/states.ts new file mode 100644 index 00000000..b65e715d --- /dev/null +++ b/sineedge_front/src/app/settings/model/states.ts @@ -0,0 +1,3 @@ +export class States { + state_id: any; fk_region_id: any; name: any; code: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/sub-product-master.ts b/sineedge_front/src/app/settings/model/sub-product-master.ts new file mode 100644 index 00000000..db7146a2 --- /dev/null +++ b/sineedge_front/src/app/settings/model/sub-product-master.ts @@ -0,0 +1,8 @@ +export class SubProductMaster { + // ID: number; + // ProductName: string; + // SubProductName: string; + // SubProductAbbr: string; + + subproduct_id: any; fk_product_id: any; name: any; abbr: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/title.ts b/sineedge_front/src/app/settings/model/title.ts new file mode 100644 index 00000000..32e1491d --- /dev/null +++ b/sineedge_front/src/app/settings/model/title.ts @@ -0,0 +1,6 @@ +export class Title { + // ID: number; + // Name: string; + + title_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/uom.ts b/sineedge_front/src/app/settings/model/uom.ts new file mode 100644 index 00000000..b864ee2e --- /dev/null +++ b/sineedge_front/src/app/settings/model/uom.ts @@ -0,0 +1,6 @@ +export class Uom { + // ID: number; + // Name: string; + + uom_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/sineedge_front/src/app/settings/model/user.ts b/sineedge_front/src/app/settings/model/user.ts new file mode 100644 index 00000000..4747c897 --- /dev/null +++ b/sineedge_front/src/app/settings/model/user.ts @@ -0,0 +1,8 @@ +export interface User { + name: string; + email: string; + phone: string; + company: { + name: string; + } +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/service/master/masters.service.spec.ts b/sineedge_front/src/app/settings/service/master/masters.service.spec.ts new file mode 100644 index 00000000..2550bd5a --- /dev/null +++ b/sineedge_front/src/app/settings/service/master/masters.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { MastersService } from './masters.service'; + +describe('MastersService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [MastersService] + }); + }); + + it('should be created', inject([MastersService], (service: MastersService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/sineedge_front/src/app/settings/service/master/masters.service.ts b/sineedge_front/src/app/settings/service/master/masters.service.ts new file mode 100644 index 00000000..012653d1 --- /dev/null +++ b/sineedge_front/src/app/settings/service/master/masters.service.ts @@ -0,0 +1,464 @@ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs/Observable';//for Datatables +import { Http, Response } from '@angular/http'; +import { HttpHeaders } from '@angular/common/http'; + +import 'rxjs/add/operator/map';//for Datatables +import 'rxjs/add/operator/catch'; +import 'rxjs/add/operator/toPromise'; + +/** Service */ +import { SharedService } from '../../../shared.service'; + +/** Model */ +import { PdAllocationType, PdLocationApproach ,PdStatus ,PdType } from '../../model/pd'; +import { Branch } from '../../model/branch'; +import { States } from '../../model/states'; +import { City } from '../../model/city'; +import { Uom } from '../../model/uom'; +import { Company } from '../../model/company'; +import { Activity } from '../../model/activity'; +import { Title } from '../../model/title'; +import { ProductMaster } from '../../model/product-master'; +import { SubProductMaster } from '../../model/sub-product-master'; +import { IndustryClassification } from '../../model/industry_classification'; +import { Regions } from '../../model/regions'; +import { Designation } from '../../model/designation'; +import { RelationShip } from '../../model/relation-ship'; +import { CustomerBehaviour } from '../../model/customer-behaviour'; +import { CommentsOnLocality } from '../../model/comments-on-locality'; +import { CustomerSegment } from '../../model/customer-segment'; +import { Frequency } from '../../model/frequency'; +import { LenderHierarchy } from '../../model/lender-hierarchy'; +import { MembersOccupation } from '../../model/members-occupation'; +import { EntityType } from '../../model/entity-type'; +//import {} from '../model/states'; + + + +export interface Master { + master_id:number; + master_name:string; + constant_name:string; +} + +// const httpOptions = { +// headers: new HttpHeaders({ +// 'Content-Type': 'application/json', +// 'Authorization': 'sparqvenba2018' +// }) +// }; + + +@Injectable() + +export class MastersService { + + // private storeUrl = 'http://localhost/SineEdge/sparqapi/api/saveMaster'; + // private branchUrl = 'http://localhost/SineEdge/sparqapi/api/getListOfBranches'; + // private serviceUrl = 'http://localhost/SineEdge/sparqapi/api/getListOfMaster'; + + private storeUrl = 'http://localhost/sparqapi/api/saveMaster'; + private serviceUrl = 'http://localhost/sparqapi/api/getListOfMaster'; + + + //constructor(private http: HttpClient) { } + constructor(private http: Http,public shared:SharedService) { } + headers:any = this.shared.headercofig(''); + + /** TO Add Data using API Call */ + addMasterDetails(Records: any,MasterName:string): Observable { + var ArrayData = { + "master_name":MasterName, + "records": Records + } + //var data = this.http.post(this.storeUrl,ArrayData,httpOptions); + var data = this.http.post(this.storeUrl,ArrayData,{headers:this.headers}); + console.log(data); + return data; + } + + /** TO Edit Data using API Call */ + editMasterDetails(Records: any,MasterName:string): Observable { + console.log('Edited Data IN Service Argument ONLY',ArrayData); + var ArrayData = { + "master_name":MasterName, + "records": Records + } + console.log('Edited Data IN Service Array ONLY',ArrayData); + //var data = this.http.post(this.storeUrl,ArrayData,httpOptions); + var data = this.http.post(this.storeUrl,ArrayData,{headers:this.headers}); + return data; + } + + /**To Inactive Array Data using API Call */ + deleteMasterDetails(id: number,MasterName:string): Observable { + console.log(' DeletedID IN Service Argument ONLY',id); + var ArrayData = { + "master_name":MasterName, + "records": {branch_id:id,isactive:0} + } + console.log('DeletedID IN Service Array',ArrayData); + var data = this.http.post(this.storeUrl,ArrayData,{headers:this.headers}); + //var data = this.http.post(this.storeUrl,ArrayData,httpOptions); + return data; + } + + + /** Get All Branch Data using API call With master Keyword */ + // getAllBranch(): Observable { + + // return this.http.get(this.branchUrl,httpOptions) + // .map(this.extractData) + // .catch(this.handleError); + + // } + getAllBranch(): Observable { + + let tab = {'master_name':'BRANCH'}; + return this.http.post(this.serviceUrl,tab,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + + getAllMasterData(): Observable { + var CityArr = { + "master_name":"LISTOFMASTERS", + } + return this.http.post(this.serviceUrl,CityArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + } + + /** Get All Branch Data using API call With master Keyword */ + getAllCityData(): Observable { + var CityArr = { + "master_name":"CITY", + } + //return this.http.post(this.serviceUrl,CityArr,httpOptions) + return this.http.post(this.serviceUrl,CityArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + } + + /** Get All Uom Data using API call With master Keyword */ + getAllUom(): Observable { + + var UomArr = { + "master_name":"UOM", + } + return this.http.post(this.serviceUrl,UomArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All Branch Data using API call With master Keyword */ + getAllCompany(): Observable { + var CompanyArr = { + "master_name":"COMPANY", + } + return this.http.post(this.serviceUrl,CompanyArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + } + + /** Get All Activity Data using API call With master Keyword */ + getAllActivity(): Observable { + + var ActivityArr = { + "master_name":"TYPEOFACTIVITY", + } + return this.http.post(this.serviceUrl,ActivityArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + /** Get All Title Data using API call With master Keyword */ + getAllTitle(): Observable { + + var TitleArr = { + "master_name":"TITLES", + } + return this.http.post(this.serviceUrl, TitleArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + /** Get All SubProductMaster Data using API call With master Keyword */ + getAllSubProductMaster(): Observable { + + var SubProductMasterArr = { + "master_name":"SUBPRODUCTS" + + } + return this.http.post(this.serviceUrl, SubProductMasterArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + /** Get All Region Data using API call With master Keyword */ + getAllRegion(): Observable { + + var RegionArr = { + "master_name":"REGIONS", + } + return this.http.post(this.serviceUrl,RegionArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All State Data using API call With master Keyword */ + getAllState(): Observable { + + var StateArr = { + "master_name":"STATE", + } + return this.http.post(this.serviceUrl,StateArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + /** Get All RelationShip Data using API call With master Keyword */ + getAllRelationShip(): Observable { + + var RelationShipArr = { + "master_name":"RELATIONSHIPS", + } + return this.http.post(this.serviceUrl, RelationShipArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All City Data using API call With master Keyword */ + getAllCity(): Observable { + + var CityArr = { + "master_name":"CITY", + } + return this.http.post(this.serviceUrl,CityArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All CommentsOnLocality Data using API call With master Keyword */ + getAllCommentsOnLocality(): Observable { + + var CommentsOnLocalityArr = { + "master_name":"COMMENTSONLOCALITY", + } + return this.http.post(this.serviceUrl,CommentsOnLocalityArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All CustomerBehaviour Data using API call With master Keyword */ + getAllCustomerBehaviour(): Observable { + + var CustomerBehaviourArr = { + "master_name":"CUSTOMERBEHAVIOUR", + } + return this.http.post(this.serviceUrl,CustomerBehaviourArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All CustomerSegment Data using API call With master Keyword */ + getAllCustomerSegment(): Observable { + + var CustomerSegmentArr = { + "master_name":"CUSTOMERSEGMENT", + } + return this.http.post(this.serviceUrl,CustomerSegmentArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All Designation Data using API call With master Keyword */ + getAllDesignation(): Observable { + + var DesignationArr = { + "master_name":"DESIGNATION", + } + return this.http.post(this.serviceUrl,DesignationArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } +/** Get All Frequency Data using API call With master Keyword */ +getAllFrequency(): Observable { + + var FrequencyArr = { + "master_name":"FREQUENCY", + } + return this.http.post(this.serviceUrl,FrequencyArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + +} + +/** Get All IndustryClassification Data using API call With master Keyword */ +getAllIndustryClassification(): Observable { + + var IndustryClassificationArr = { + "master_name":"INDUSTRYCLASSIFICATION", + } + return this.http.post(this.serviceUrl,IndustryClassificationArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + +} + + /** Get All LenderHierarchy Data using API call With master Keyword */ + getAllLenderHierarchy(): Observable { + + var LenderHierarchyArr = { + "master_name":"LENDERHIERARCHY", + } + return this.http.post(this.serviceUrl,LenderHierarchyArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All MembersOccupation Data using API call With master Keyword */ + getAllMembersOccupation(): Observable { + + var MembersOccupationArr = { + "master_name":"OCCUPATIONMEMBERS", + } + return this.http.post(this.serviceUrl, MembersOccupationArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + getAllProduct(): Observable { + + var ProdArr = { + "master_name":"PRODUCTS" + } + return this.http.post(this.serviceUrl,ProdArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All MembersOccupation Data using API call With master Keyword */ + getAllPDAllocationType(): Observable { + + var PDAllocationTypeArr = { + "master_name":"PDALLOCATIONTYPE", + } + return this.http.post(this.serviceUrl, PDAllocationTypeArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get AllPDLocationApproach Data using API call With master Keyword */ + getAllPDLocationApproach(): Observable { + + var MembersOccupationArr = { + "master_name":"PDLOCATIONAPPROACH", + } + return this.http.post(this.serviceUrl, MembersOccupationArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All MembersOccupation Data using API call With master Keyword */ + getAllPDStatus(): Observable { + + var MembersOccupationArr = { + "master_name":"PDSTATUS", + } + return this.http.post(this.serviceUrl,MembersOccupationArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All MembersOccupation Data using API call With master Keyword */ + getAllPDType(): Observable { + + var MembersOccupationArr = { + "master_name":"PDTYPE", + } + return this.http.post(this.serviceUrl, MembersOccupationArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Get All EntityType Data using API call With master Keyword */ + getAllEntityType(): Observable { + + var EntityTypeArr = { + "master_name":"ENTITYTYPE", + } + return this.http.post(this.serviceUrl,EntityTypeArr,{headers:this.headers}) + .map(this.extractData) + .catch(this.handleError); + + } + + /** Using Above .map() Method. We check the Response's array Status and return to the component */ + // private extractData(res : Response) { + // console.log('extractData',res); + // if (res['dataStatus'] === true) { + // let Records = res['records']; + // return Records; + // } + // else{ + // return []; // return empty array if there is no data + // } + // } + + private extractData(res : Response) { + + let Response = res['_body']; + Response = JSON.parse(Response); + + return Response['dataStatus'] === true + ? Response['records'] + : []; + + /* Checking Data Status is true or false., + TRUE means Return Arraydata + FALSE means Return empty array. + */ + + } + + + + + // private parseData(Response) { + // //console.log('parseData called',Response); + // if(Response.dataStatus == true){ + // console.log('true part',Response.records); + // return Response.records; + // } + // else{ + // return Response; + // } + // } + + + private handleError(error: any): Promise { + console.error('An error occurred', error); + return Promise.reject(error.message || error); + } + + +} \ No newline at end of file diff --git a/sineedge_front/src/app/settings/settings.module.ts b/sineedge_front/src/app/settings/settings.module.ts index df06606c..9f2518e3 100755 --- a/sineedge_front/src/app/settings/settings.module.ts +++ b/sineedge_front/src/app/settings/settings.module.ts @@ -1,25 +1,91 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { CommonModule } from '@angular/common'; +import { HttpClientModule } from '@angular/common/http' +import { HttpModule } from '@angular/http'; + import { MatCardModule, MatIconModule, MatInputModule, MatRadioModule, MatButtonModule,MatTableModule,MatPaginatorModule, - MatProgressBarModule,MatDialogModule, + MatProgressBarModule,MatDialogModule, MatSortModule, MatToolbarModule,MatSelectModule } from '@angular/material'; - import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; - import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload'; import { TreeModule } from 'angular-tree-component'; import { NgxDatatableModule } from '@swimlane/ngx-datatable'; import { FlexLayoutModule } from '@angular/flex-layout'; +import { DemoMaterialModule } from '../shared/demo.module'; +import { NgxMatSelectSearchModule } from 'ngx-mat-select-search'; +import 'hammerjs'; + import { SettingsRoute } from './settings.routing'; + import { RegisterComponent } from './register/register.component'; import { UserListComponent } from './user-list/user-list.component'; + +/** Master Main Component */ +import { MastersComponent } from './component/masters/masters.component'; + +/** Master Child Component - For Listing screen*/ +import { IndustryClassificationListComponent } from './component/industry_classification/industry_classification-list/industry_classification-list.component'; +import { ProductListComponent } from './component/product/product-list/product-list.component'; +import { SubProductListComponent } from './component/sub-product/sub-product-list/sub-product-list.component'; +import { BranchListComponent } from './component/branch/branch-list/branch-list.component'; +import { TitleListComponent } from './component/title/title-list/title-list.component'; +import { RelationShipListComponent } from './component/relation-ship/relation-ship-list/relation-ship-list.component'; +import { MembersOccupationListComponent } from './component/members-occupation/members-occupation-list/members-occupation-list.component'; +import { ActivityListComponent } from './component/type-of-activity/activity-list/activity-list.component'; +import { UomListComponent } from './component/uom/uom-list/uom-list.component'; +import { FrequencyListComponent } from './component/frequency/frequency-list/frequency-list.component'; +import { StatesListComponent } from './component/states/states-list/states-list.component'; +import { CityListComponent } from './component/city/city-list/city-list.component'; +import { CompanyListComponent } from './component/company/company-list/company-list.component'; +import { CustomerSegmentListComponent } from './component/customer-segment/customer-segment-list/customer-segment-list.component'; +import { CustomerBehaviourListComponent } from './component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component'; +import { DesignationListComponent } from './component/designation/designation-list/designation-list.component'; +import { RegionsListComponent } from './component/regions/regions-list/regions-list.component'; +import { CommentsOnLocalityListComponent } from './component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component'; +import { PdAllocationTypeListComponent } from './component/pd/pd-allocation-type-list/pd-allocation-type-list.component'; +import { PdLocationApproachListComponent } from './component/pd/pd-location-approach-list/pd-location-approach-list.component'; +import { PdTypeListComponent } from './component/pd/pd-type-list/pd-type-list.component'; +import { PdStatusListComponent } from './component/pd/pd-status-list/pd-status-list.component'; +import { LenderHierarchyListComponent } from './component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component'; + +/** Master Child Component - For Dialogboxes*/ +import { ProductDialogComponent } from './component/product/product-dialog/product-dialog.component'; +import { IndustryClassificationDialogComponent } from './component/industry_classification/industry_classification-dialog/industry_classification-dialog.component'; +import { SubProductDialogComponent } from './component/sub-product/sub-product-dialog/sub-product-dialog.component'; +import { BranchDialogComponent } from './component/branch/branch-dialog/branch-dialog.component'; +import { TitleDialogComponent } from './component/title/title-dialog/title-dialog.component'; +import { RelationShipDialogComponent } from './component/relation-ship/relation-ship-dialog/relation-ship-dialog.component'; +import { MembersOccupationDialogComponent } from './component/members-occupation/members-occupation-dialog/members-occupation-dialog.component'; +import { ActivityDialogComponent } from './component/type-of-activity/activity-dialog/activity-dialog.component'; +import { UomDialogComponent } from './component/uom/uom-dialog/uom-dialog.component'; +import { FrequencyDialogComponent } from './component/frequency/frequency-dialog/frequency-dialog.component'; +import { PdTypeDialogComponent } from './component/pd/pd-type-dialog/pd-type-dialog.component'; +import { PdLocationApproachDialogComponent } from './component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component'; +import { PdAllocationTypeDialogComponent } from './component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component'; +import { PdStatusDialogComponent } from './component/pd/pd-status-dialog/pd-status-dialog.component'; +import { LenderHierarchyDialogComponent } from './component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component'; +import { CommentsOnLocalityDialogComponent } from './component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component'; +import { DesignationDialogComponent } from './component/designation/designation-dialog/designation-dialog.component'; +import { CustomerBehaviourDialogComponent } from './component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component'; +import { CustomerSegmentDialogComponent } from './component/customer-segment/customer-segment-dialog/customer-segment-dialog.component'; +import { StatesDialogComponent } from './component/states/states-dialog/states-dialog.component'; +import { CompanyDialogComponent } from './component/company/company-dialog/company-dialog.component'; +import { CityDialogComponent } from './component/city/city-dialog/city-dialog.component'; +import { RegionsDialogComponent } from './component/regions/regions-dialog/regions-dialog.component'; + + +/** Master Service */ +import { MastersService } from './service/master/masters.service'; + + @NgModule({ imports: [ CommonModule, @@ -40,11 +106,90 @@ import { UserListComponent } from './user-list/user-list.component'; ReactiveFormsModule, FileUploadModule, TreeModule, - MatDialogModule + MatDialogModule, + NgxMatSelectSearchModule ], declarations: [ RegisterComponent, UserListComponent, - ] + + MastersComponent, + + IndustryClassificationListComponent, + ProductListComponent, + SubProductListComponent, + BranchListComponent, + TitleListComponent, + RelationShipListComponent, + MembersOccupationListComponent, + ActivityListComponent, + UomListComponent, + FrequencyListComponent, + //DataTableComponent, UsertableComponent, + StatesListComponent, + CityListComponent, + CompanyListComponent, + CustomerSegmentListComponent, + CustomerBehaviourListComponent, + DesignationListComponent, + RegionsListComponent, + CommentsOnLocalityListComponent, + PdAllocationTypeListComponent, + PdLocationApproachListComponent, + PdStatusListComponent, + PdTypeListComponent, + LenderHierarchyListComponent, + ProductDialogComponent, + IndustryClassificationDialogComponent, + SubProductDialogComponent, + BranchDialogComponent, + TitleDialogComponent, + RelationShipDialogComponent, + MembersOccupationDialogComponent, + ActivityDialogComponent, + UomDialogComponent, + FrequencyDialogComponent, + PdTypeDialogComponent, + PdLocationApproachDialogComponent, + PdAllocationTypeDialogComponent, + PdStatusDialogComponent, + // //EntityTypeDialogComponent, + LenderHierarchyDialogComponent, + CommentsOnLocalityDialogComponent, + DesignationDialogComponent, + CustomerBehaviourDialogComponent, + CustomerSegmentDialogComponent, + StatesDialogComponent, + CompanyDialogComponent, + CityDialogComponent, + RegionsDialogComponent +], +providers: [ MastersService ], + +entryComponents: [ + IndustryClassificationDialogComponent, + ProductDialogComponent, + SubProductDialogComponent, + BranchDialogComponent, + TitleDialogComponent, + RelationShipDialogComponent, + MembersOccupationDialogComponent, + ActivityDialogComponent, + UomDialogComponent, + FrequencyDialogComponent, + PdTypeDialogComponent, + PdLocationApproachDialogComponent, + PdAllocationTypeDialogComponent, + PdStatusDialogComponent, + //EntityTypeDialogComponent, + LenderHierarchyDialogComponent, + CommentsOnLocalityDialogComponent, + DesignationDialogComponent, + CustomerBehaviourDialogComponent, + CustomerSegmentDialogComponent, + StatesDialogComponent, + CompanyDialogComponent, + CityDialogComponent, + RegionsDialogComponent], }) export class SettingsModule { } diff --git a/sineedge_front/src/app/settings/settings.routing.ts b/sineedge_front/src/app/settings/settings.routing.ts index 78d9daa9..e177053b 100755 --- a/sineedge_front/src/app/settings/settings.routing.ts +++ b/sineedge_front/src/app/settings/settings.routing.ts @@ -2,16 +2,22 @@ import { Routes } from '@angular/router'; import { RegisterComponent } from './register/register.component'; import { UserListComponent } from './user-list/user-list.component'; + import { MastersComponent } from './component/masters/masters.component'; export const SettingsRoute: Routes = [ { path: '', - children: [{ - path: 'userRegister', - component: RegisterComponent - },{ + children: [ + //{ + // path: 'userRegister', + // component: RegisterComponent + //}, + { path:'userListing', component:UserListComponent + },{ + path:'masters', + component:MastersComponent }] } ]; diff --git a/sineedge_front/src/app/settings/user-list/user-list.component.html b/sineedge_front/src/app/settings/user-list/user-list.component.html index 4a99713f..4008331f 100644 --- a/sineedge_front/src/app/settings/user-list/user-list.component.html +++ b/sineedge_front/src/app/settings/user-list/user-list.component.html @@ -2,6 +2,9 @@ +
+ +
diff --git a/sineedge_front/src/app/settings/user-list/user-list.component.ts b/sineedge_front/src/app/settings/user-list/user-list.component.ts index b084d519..11f72616 100644 --- a/sineedge_front/src/app/settings/user-list/user-list.component.ts +++ b/sineedge_front/src/app/settings/user-list/user-list.component.ts @@ -80,4 +80,8 @@ export class UserListComponent implements OnInit { this.route.navigate(['settings/userRegister']); }); } + + addRegister(){ + this.route.navigate(['settings/userRegister']); + } } diff --git a/sineedge_front/src/app/shared.service.ts b/sineedge_front/src/app/shared.service.ts index 59d82079..c59642ab 100755 --- a/sineedge_front/src/app/shared.service.ts +++ b/sineedge_front/src/app/shared.service.ts @@ -3,7 +3,7 @@ import { AuthenticationDetails, CognitoUser, CognitoUserPool } from 'amazon-cogn import { Router } from "@angular/router"; import * as aws from 'aws-sdk'; import { Http, Headers, RequestOptions } from '@angular/http'; -let apiUrl = 'http://localhost/sineedge/sparqapi/api/' +let apiUrl = 'http://localhost/sparqapi/api/' let currentuser: any = window.localStorage.getItem("Currentuser"); console.log(currentuser); let poolData: any; diff --git a/sineedge_front/src/app/shared/menu-items/horizontal-menu-items.ts b/sineedge_front/src/app/shared/menu-items/horizontal-menu-items.ts index 5af4ede9..b9be78b5 100755 --- a/sineedge_front/src/app/shared/menu-items/horizontal-menu-items.ts +++ b/sineedge_front/src/app/shared/menu-items/horizontal-menu-items.ts @@ -174,6 +174,18 @@ const HORIZONTALMENUITEMS = [ } ] }, + { + state:'settings', + name:'Settings', + type:'sub', + icon:'settings', + children:[ + {state:'userRegister',name:'User Register'}, + {state:'userListing',name:'User Listing'}, + {state:'masters',name:'Master Details'} + + ] + }, { state: 'authentication', name: 'AUTHENTICATION', diff --git a/sineedge_front/src/app/shared/menu-items/menu-items.ts b/sineedge_front/src/app/shared/menu-items/menu-items.ts index fa736450..7b0d06df 100755 --- a/sineedge_front/src/app/shared/menu-items/menu-items.ts +++ b/sineedge_front/src/app/shared/menu-items/menu-items.ts @@ -65,7 +65,8 @@ const MENUITEMS : Menu[] = [ icon:'settings', children:[ {state:'userRegister',name:'User Register'}, - {state:'userListing',name:'User Listing'} + {state:'userListing',name:'User Listing'}, + {state: 'masters',name:'Master Details'} ] }, // { diff --git a/sineedge_front/src/index.html b/sineedge_front/src/index.html index 06f2237f..c9b34896 100755 --- a/sineedge_front/src/index.html +++ b/sineedge_front/src/index.html @@ -12,7 +12,7 @@ - Optima - Angular 6 Material Admin Template + Sine Edge