Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chanachai
BookingMyHrManagement
Commits
186fb8d6
Commit
186fb8d6
authored
Dec 02, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit การกรอกข้อมูล model หน้า equirment
parent
3fad6518
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
69 deletions
+86
-69
equirment.model.ts
src/app/models/equirment.model.ts
+17
-8
rooms.model.ts
src/app/models/rooms.model.ts
+10
-10
equipment.component.html
src/app/pages/equipment/equipment.component.html
+6
-6
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+8
-8
equirment.service.ts
src/app/service/equirment.service.ts
+19
-19
room.service.ts
src/app/service/room.service.ts
+26
-18
No files found.
src/app/models/equirment.model.ts
View file @
186fb8d6
export
class
Equirment
{
export
class
Equirment
{
eq
i
d
:
number
;
eq
I
d
:
number
;
eqName
:
string
;
eqName
:
string
;
eq
d
esc
:
string
;
eq
D
esc
:
string
;
eq
t
ype
:
string
;
eq
T
ype
:
string
;
eq
p
ic
:
string
;
eq
P
ic
:
string
;
constructor
(
init
?:
Equirment
){
constructor
(
init
?:
Equirment
){
Object
.
assign
(
this
,
init
);
Object
.
assign
(
this
,
init
);
this
.
eq
i
d
=
0
;
this
.
eq
I
d
=
0
;
this
.
eqName
=
''
;
this
.
eqName
=
''
;
this
.
eq
d
esc
=
''
;
this
.
eq
D
esc
=
''
;
this
.
eq
t
ype
=
''
;
this
.
eq
T
ype
=
''
;
this
.
eq
p
ic
=
''
;
this
.
eq
P
ic
=
''
;
}
}
}
}
...
@@ -30,3 +30,11 @@ export class SearchEquirmentModel {
...
@@ -30,3 +30,11 @@ export class SearchEquirmentModel {
this
.
etime
=
''
;
this
.
etime
=
''
;
}
}
}
}
interface
EquirmentModel
{
id
:
number
;
name
:
string
;
desc
:
string
;
type
?:
CategoryModel
;
pic
:
string
;
}
\ No newline at end of file
src/app/models/rooms.model.ts
View file @
186fb8d6
export
class
Room
{
export
class
Room
{
r
i
d
:
number
;
r
I
d
:
number
;
r
n
ame
:
string
;
r
N
ame
:
string
;
title
:
string
;
rPic
:
string
;
r
pic
:
string
;
r
Type
:
string
;
roomLimit
:
number
;
roomLimit
:
number
;
r
d
esc
:
string
;
r
D
esc
:
string
;
constructor
(
init
?:
Room
)
{
constructor
(
init
?:
Room
)
{
Object
.
assign
(
this
,
init
);
Object
.
assign
(
this
,
init
);
this
.
r
i
d
=
0
;
this
.
r
I
d
=
0
;
this
.
r
n
ame
=
''
;
this
.
r
N
ame
=
''
;
this
.
titl
e
=
''
;
this
.
rTyp
e
=
''
;
this
.
r
p
ic
=
''
;
this
.
r
P
ic
=
''
;
this
.
roomLimit
=
0
;
this
.
roomLimit
=
0
;
this
.
r
d
esc
=
''
;
this
.
r
D
esc
=
''
;
}
}
}
}
...
...
src/app/pages/equipment/equipment.component.html
View file @
186fb8d6
...
@@ -94,7 +94,7 @@
...
@@ -94,7 +94,7 @@
<label>
หมวดหมู่
</label>
<label>
หมวดหมู่
</label>
<br>
<br>
<select
class=
"form-select"
<select
class=
"form-select"
aria-label=
"Default select example"
>
aria-label=
"Default select example"
[(
ngModel
)]="
modelEquirment
.
eqType
"
>
<option
selected
>
เลือกหมวดหมู่
</option>
<option
selected
>
เลือกหมวดหมู่
</option>
<option
value=
"4"
>
IT
</option>
<option
value=
"4"
>
IT
</option>
<option
value=
"5"
>
Company
</option>
<option
value=
"5"
>
Company
</option>
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
<label>
รายละเอียด
</label>
<label>
รายละเอียด
</label>
<textarea
class=
"form-control"
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
></textarea>
placeholder=
"......"
[(
ngModel
)]="
modelEquirment
.
eqDesc
"
></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -188,7 +188,7 @@
...
@@ -188,7 +188,7 @@
<div
class=
" col-md-12"
>
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<div
class=
" form-group"
>
<label>
ชื่อ
</label>
<label>
ชื่อ
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
/>
<input
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelRoom
.
rName
"
value=
""
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -197,7 +197,7 @@
...
@@ -197,7 +197,7 @@
<div
class=
" form-group"
>
<div
class=
" form-group"
>
<label>
ประเภท
</label>
<label>
ประเภท
</label>
<br>
<br>
<select
class=
"form-select"
aria-label=
"Default select example"
>
<select
class=
"form-select"
aria-label=
"Default select example"
[(
ngModel
)]="
modelRoom
.
rType
"
>
<option
selected
>
เลือกประเภท
</option>
<option
selected
>
เลือกประเภท
</option>
<option
value=
"1"
>
ห้อง
</option>
<option
value=
"1"
>
ห้อง
</option>
<option
value=
"2"
>
รถ
</option>
<option
value=
"2"
>
รถ
</option>
...
@@ -210,7 +210,7 @@
...
@@ -210,7 +210,7 @@
<div
class=
" form-group"
>
<div
class=
" form-group"
>
<label>
รายละเอียด
</label>
<label>
รายละเอียด
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
></textarea>
placeholder=
"......"
[(
ngModel
)]="
modelRoom
.
rDesc
"
></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -219,7 +219,7 @@
...
@@ -219,7 +219,7 @@
</form>
</form>
</div>
</div>
<div
class=
" card-footer"
>
<div
class=
" card-footer"
>
<button
class=
" btn btn-fill btn-danger"
type=
"submit"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"submit"
(
click
)="
saveRoom
()"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
>
Cancel
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
>
Cancel
</button>
</div>
</div>
</div>
</div>
...
...
src/app/pages/equipment/equipment.component.ts
View file @
186fb8d6
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NgbModal
,
ModalDismissReasons
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
NgbModal
,
ModalDismissReasons
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
Equirment
}
from
'src/app/models/equirment.model'
;
import
{
Equirment
}
from
'src/app/models/equirment.model'
;
import
{
Room
}
from
'src/app/models/rooms.model'
;
interface
EquirmentModel
{
id
:
number
;
name
:
string
;
desc
:
string
;
type
?:
CategoryModel
;
pic
:
string
;
}
@
Component
({
@
Component
({
selector
:
'app-equipment'
,
selector
:
'app-equipment'
,
...
@@ -25,6 +18,7 @@ export class EquipmentComponent implements OnInit {
...
@@ -25,6 +18,7 @@ export class EquipmentComponent implements OnInit {
listEquirmentModel
:
Equirment
[]
=
[];
listEquirmentModel
:
Equirment
[]
=
[];
collectionSize
=
this
.
listEquirmentModel
.
length
;
collectionSize
=
this
.
listEquirmentModel
.
length
;
modelEquirment
=
new
Equirment
();
modelEquirment
=
new
Equirment
();
modelRoom
=
new
Room
();
constructor
(
private
modalService
:
NgbModal
)
{
}
constructor
(
private
modalService
:
NgbModal
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
...
@@ -62,5 +56,11 @@ export class EquipmentComponent implements OnInit {
...
@@ -62,5 +56,11 @@ export class EquipmentComponent implements OnInit {
console
.
log
(
this
.
modelEquirment
);
console
.
log
(
this
.
modelEquirment
);
}
}
saveRoom
(){
console
.
log
(
this
.
modelRoom
);
}
}
}
src/app/service/equirment.service.ts
View file @
186fb8d6
...
@@ -9,32 +9,32 @@ export class EquirmentService {
...
@@ -9,32 +9,32 @@ export class EquirmentService {
url
:
string
;
url
:
string
;
listEquirment
:
Equirment
[]
=
[
listEquirment
:
Equirment
[]
=
[
{
{
eq
i
d
:
1
,
eq
I
d
:
1
,
eqName
:
"จอคอมพิวเตอร์"
,
eqName
:
"จอคอมพิวเตอร์"
,
eq
d
esc
:
"หน้าจอขนาด 22 นิ้ว"
,
eq
D
esc
:
"หน้าจอขนาด 22 นิ้ว"
,
eq
t
ype
:
"it"
,
eq
T
ype
:
"it"
,
eq
p
ic
:
"assets/img/mo1.jpg"
eq
P
ic
:
"assets/img/mo1.jpg"
},
},
{
{
eq
i
d
:
2
,
eq
I
d
:
2
,
eqName
:
"เมาส์"
,
eqName
:
"เมาส์"
,
eq
d
esc
:
"..."
,
eq
D
esc
:
"..."
,
eq
t
ype
:
"it"
,
eq
T
ype
:
"it"
,
eq
p
ic
:
"assets/img/mou.jpg"
eq
P
ic
:
"assets/img/mou.jpg"
},
},
{
{
eq
i
d
:
3
,
eq
I
d
:
3
,
eqName
:
"โน๊ตบุ๊ค"
,
eqName
:
"โน๊ตบุ๊ค"
,
eq
d
esc
:
"หน้าจอขนาด 20 นิ้ว"
,
eq
D
esc
:
"หน้าจอขนาด 20 นิ้ว"
,
eq
t
ype
:
"it"
,
eq
T
ype
:
"it"
,
eq
p
ic
:
"assets/img/notebook.jpg"
eq
P
ic
:
"assets/img/notebook.jpg"
},
},
{
{
eq
i
d
:
4
,
eq
I
d
:
4
,
eqName
:
"คีย์บอร์ด"
,
eqName
:
"คีย์บอร์ด"
,
eq
d
esc
:
"..."
,
eq
D
esc
:
"..."
,
eq
t
ype
:
"it"
,
eq
T
ype
:
"it"
,
eq
p
ic
:
"assets/img/keyboard.png"
eq
P
ic
:
"assets/img/keyboard.png"
}
}
]
]
listEquirmentModel
:
Equirment
[]
=
[];
listEquirmentModel
:
Equirment
[]
=
[];
...
@@ -68,7 +68,7 @@ export class EquirmentService {
...
@@ -68,7 +68,7 @@ export class EquirmentService {
}
}
deleteRoom
(
EquirmentModel
:
Equirment
)
{
deleteRoom
(
EquirmentModel
:
Equirment
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
EquirmentModel
.
eq
i
d
).
subscribe
(
response
=>
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
EquirmentModel
.
eq
I
d
).
subscribe
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
this
.
getListRoom
()
this
.
getListRoom
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
...
@@ -76,13 +76,13 @@ export class EquirmentService {
...
@@ -76,13 +76,13 @@ export class EquirmentService {
}
}
updateRoom
(
EquirmentModel
:
Equirment
)
{
updateRoom
(
EquirmentModel
:
Equirment
)
{
this
.
http
.
put
(
this
.
url
+
"/"
+
EquirmentModel
.
eq
i
d
,
EquirmentModel
).
subscribe
(
response
=>
{
this
.
http
.
put
(
this
.
url
+
"/"
+
EquirmentModel
.
eq
I
d
,
EquirmentModel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลอุปกรณ์สำเร็จ"
)
alert
(
"อัพเดทข้อมูลอุปกรณ์สำเร็จ"
)
})
})
}
}
EquirmentModel
(
eq
i
d
:
string
)
{
EquirmentModel
(
eq
I
d
:
string
)
{
}
}
...
...
src/app/service/room.service.ts
View file @
186fb8d6
...
@@ -10,29 +10,37 @@ export class RoomService {
...
@@ -10,29 +10,37 @@ export class RoomService {
url
:
string
;
url
:
string
;
listRoomModel
:
Room
[]
=
[
listRoomModel
:
Room
[]
=
[
{
{
r
i
d
:
1
,
r
I
d
:
1
,
r
n
ame
:
"ห้องเดียว"
,
r
N
ame
:
"ห้องเดียว"
,
title
:
"string"
,
rType
:
''
,
r
p
ic
:
"assets/img/room.jpg"
,
r
P
ic
:
"assets/img/room.jpg"
,
roomLimit
:
25
,
roomLimit
:
25
,
r
d
esc
:
"จำนวนคน 25 คน"
,
r
D
esc
:
"จำนวนคน 25 คน"
,
},
},
{
{
r
i
d
:
2
,
r
I
d
:
2
,
r
n
ame
:
"ห้องคู่"
,
r
N
ame
:
"ห้องคู่"
,
title
:
"string"
,
rType
:
''
,
r
p
ic
:
"assets/img/room.jpg"
,
r
P
ic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
roomLimit
:
50
,
r
d
esc
:
"จำนวนคน 50 คน"
,
r
D
esc
:
"จำนวนคน 50 คน"
,
},
},
{
{
r
i
d
:
3
,
r
I
d
:
3
,
r
n
ame
:
"ห้องรวม"
,
r
N
ame
:
"ห้องรวม"
,
title
:
"string"
,
rType
:
''
,
r
p
ic
:
"assets/img/room.jpg"
,
r
P
ic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
roomLimit
:
100
,
r
d
esc
:
"จำนวนคน 100 คน"
,
r
D
esc
:
"จำนวนคน 100 คน"
,
},
},
{
rId
:
4
,
rName
:
"รถ"
,
rType
:
''
,
rPic
:
"assets/img/car.jpg"
,
roomLimit
:
0
,
rDesc
:
"รถ"
,
}
]
]
listRoomSearch
:
Room
[]
=
[];
listRoomSearch
:
Room
[]
=
[];
...
@@ -65,7 +73,7 @@ export class RoomService {
...
@@ -65,7 +73,7 @@ export class RoomService {
}
}
deleteRoom
(
roomModel
:
Room
)
{
deleteRoom
(
roomModel
:
Room
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
roomModel
.
r
i
d
).
subscribe
(
response
=>
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
roomModel
.
r
I
d
).
subscribe
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
this
.
getListRoom
()
this
.
getListRoom
()
alert
(
"ลบข้อมูลห้องสำเร็จ"
)
alert
(
"ลบข้อมูลห้องสำเร็จ"
)
...
@@ -73,13 +81,13 @@ export class RoomService {
...
@@ -73,13 +81,13 @@ export class RoomService {
}
}
updateRoom
(
roomModel
:
Room
)
{
updateRoom
(
roomModel
:
Room
)
{
this
.
http
.
put
(
this
.
url
+
"/"
+
roomModel
.
r
i
d
,
roomModel
).
subscribe
(
response
=>
{
this
.
http
.
put
(
this
.
url
+
"/"
+
roomModel
.
r
I
d
,
roomModel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลห้องสำเร็จ"
)
alert
(
"อัพเดทข้อมูลห้องสำเร็จ"
)
})
})
}
}
roomModel
(
r
i
d
:
string
)
{
roomModel
(
r
I
d
:
string
)
{
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment