From b018d20079f00a2421ef0d1b6bba5d51dfdbfc6b Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Wed, 9 Mar 2022 17:04:03 +0100 Subject: [PATCH] =?UTF-8?q?cr=C3=A9ation=20de=20la=20page=20businessunit?= =?UTF-8?q?=20et=20de=20la=20page=20businessunitedit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../businessunit-edit.component.html | 1 + .../businessunit-edit.component.scss | 0 .../businessunit-edit.component.ts | 15 ++++++++ .../businessunit/businessunit.component.html | 32 ++++++++++++++++ .../businessunit/businessunit.component.scss | 0 .../businessunit/businessunit.component.ts | 37 +++++++++++++++++++ 6 files changed, 85 insertions(+) create mode 100644 src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html create mode 100644 src/app/components/businessunit/businessunit-edit/businessunit-edit.component.scss create mode 100644 src/app/components/businessunit/businessunit-edit/businessunit-edit.component.ts create mode 100644 src/app/components/businessunit/businessunit.component.html create mode 100644 src/app/components/businessunit/businessunit.component.scss create mode 100644 src/app/components/businessunit/businessunit.component.ts diff --git a/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html new file mode 100644 index 0000000..ea9e272 --- /dev/null +++ b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html @@ -0,0 +1 @@ +

businessunit-edit works!

diff --git a/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.scss b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.ts b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.ts new file mode 100644 index 0000000..9665c1a --- /dev/null +++ b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-businessunit-edit', + templateUrl: './businessunit-edit.component.html', + styleUrls: ['./businessunit-edit.component.scss'] +}) +export class BusinessunitEditComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/components/businessunit/businessunit.component.html b/src/app/components/businessunit/businessunit.component.html new file mode 100644 index 0000000..99075c3 --- /dev/null +++ b/src/app/components/businessunit/businessunit.component.html @@ -0,0 +1,32 @@ +
+

Business Unit

+ + + + + + + + + +
Name
{{businessunit.name}} Modifier
+ +

Ajouter une businessunit :

+ +
+ + + + + + + +
Name
+ +
+
+ + +
diff --git a/src/app/components/businessunit/businessunit.component.scss b/src/app/components/businessunit/businessunit.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/businessunit/businessunit.component.ts b/src/app/components/businessunit/businessunit.component.ts new file mode 100644 index 0000000..5f4816c --- /dev/null +++ b/src/app/components/businessunit/businessunit.component.ts @@ -0,0 +1,37 @@ +import { Component, OnInit } from '@angular/core'; +import {Businessunit} from "../../interfaces/businessunit"; +import {HttpClient} from "@angular/common/http"; +import {BusinessunitService} from "../../services/businessunit.service"; + +@Component({ + selector: 'app-businessunit', + templateUrl: './businessunit.component.html', + styleUrls: ['./businessunit.component.scss'] +}) +export class BusinessunitComponent implements OnInit { + + businessunits : Businessunit[] = []; + businessunit = {} as Businessunit ; + + constructor( + private http : HttpClient, + private businessunitService: BusinessunitService, + ) { } + + ngOnInit(): void { + this.getBusinessunits(); + } + + getBusinessunits():void { + this.businessunitService.getBusinessunits() + .subscribe(businessunits => this.businessunits = businessunits); + } + + add(businessunit: Businessunit): void { + this.businessunitService.addBusinessunit(businessunit) + .subscribe(businessunit => { + this.businessunits.push(businessunit); + }); + } + +}