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
5b5cd234
Commit
5b5cd234
authored
Feb 07, 2022
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update show detail api
parent
78537743
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
78 additions
and
185 deletions
+78
-185
itemDetail.model.ts
src/app/models/itemDetail.model.ts
+4
-4
admin-equirment.component.html
src/app/pages/admin-equirment/admin-equirment.component.html
+2
-2
admin-equirment.component.ts
src/app/pages/admin-equirment/admin-equirment.component.ts
+5
-5
admin-pending.component.html
src/app/pages/admin-pending/admin-pending.component.html
+1
-1
admin-pending.component.ts
src/app/pages/admin-pending/admin-pending.component.ts
+7
-7
equipment.component.html
src/app/pages/equipment/equipment.component.html
+2
-2
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+3
-3
home-page.component.ts
src/app/pages/home-page/home-page.component.ts
+4
-3
pending.component.ts
src/app/pages/pending/pending.component.ts
+4
-4
contact.service.ts
src/app/service/contact.service.ts
+6
-8
equirment.service.ts
src/app/service/equirment.service.ts
+4
-37
item-detail.service.ts
src/app/service/item-detail.service.ts
+8
-40
room-detail.service.ts
src/app/service/room-detail.service.ts
+11
-47
room.service.ts
src/app/service/room.service.ts
+17
-22
No files found.
src/app/models/itemDetail.model.ts
View file @
5b5cd234
...
...
@@ -2,14 +2,14 @@ import { Equirment } from "./equirment.model";
export
class
ItemDetail
{
id
?:
number
;
equirment
:
Equirment
;
equirment
s
:
Equirment
;
userName
:
string
;
sDate
:
string
;
eDate
:
string
;
sTime
:
string
;
eTime
:
string
;
eStatus
:
number
;
Q
uantity
:
string
;
q
uantity
:
string
;
eTelephone
:
string
;
email
:
string
;
remark
:
string
;
...
...
@@ -18,12 +18,12 @@ export class ItemDetail {
constructor
(
init
?:
ItemDetail
)
{
Object
.
assign
(
this
,
init
);
this
.
id
=
0
;
this
.
equirment
=
this
.
equirment
;
this
.
equirment
s
=
this
.
equirments
;
this
.
userName
=
''
;
this
.
sDate
=
''
;
this
.
eDate
=
''
;
this
.
eStatus
=
0
;
this
.
Q
uantity
=
''
;
this
.
q
uantity
=
''
;
this
.
eTelephone
=
''
;
this
.
email
=
''
;
this
.
remark
=
''
;
...
...
src/app/pages/admin-equirment/admin-equirment.component.html
View file @
5b5cd234
...
...
@@ -28,7 +28,7 @@
<div
class=
"card"
style=
"
padding: 10px;"
>
<div
class=
"card-body"
>
<img
style=
"object-fit: cover;"
[
src
]="
item
.
rPic
"
class=
"nav justify-content-center"
<img
style=
"object-fit: cover;"
[
src
]="
item
.
rPic
"
class=
"nav justify-content-center"
width=
"150px"
height=
"150px"
alt=
"..."
>
<br>
<p
class=
"text-left"
>
ชื่อ : {{item.rName}}
</p>
...
...
@@ -84,7 +84,7 @@
<div
class=
"card"
style=
"
padding: 10px;"
>
<div
class=
"card-body"
>
<img
style=
"object-fit: cover;"
[
src
]="
item
.
eqPic
"
class=
"nav justify-content-center"
<img
style=
"object-fit: cover;"
[
src
]="
item
.
eqPic
"
class=
"nav justify-content-center"
width=
"150px"
height=
"150px"
alt=
"..."
>
<br>
<p
class=
"text-left"
>
ชื่อ : {{item.eqName}}
</p>
...
...
src/app/pages/admin-equirment/admin-equirment.component.ts
View file @
5b5cd234
...
...
@@ -103,7 +103,7 @@ export class AdminEquirmentComponent implements OnInit {
bookEquir
(
editLend
,
item
:
Equirment
)
{
this
.
modelItemDetail
=
new
ItemDetail
();
this
.
modelItemDetail
.
equirment
=
item
;
this
.
modelItemDetail
.
equirment
s
=
item
;
console
.
log
(
"item"
,
this
.
modelItemDetail
);
this
.
modalService
.
open
(
editLend
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
...
...
@@ -280,7 +280,7 @@ export class AdminEquirmentComponent implements OnInit {
this
.
listRoomModel
[
this
.
index
].
rName
=
this
.
myFormRoom
.
value
.
rName
this
.
listRoomModel
[
this
.
index
].
rDesc
=
this
.
myFormRoom
.
value
.
rDesc
this
.
listRoomModel
[
this
.
index
].
rType
=
this
.
myFormRoom
.
value
.
rType
this
.
roomService
.
updateRoom
Profile
(
this
.
listRoomModel
[
this
.
index
])
this
.
roomService
.
updateRoom
(
this
.
listRoomModel
[
this
.
index
])
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
...
...
@@ -289,19 +289,19 @@ export class AdminEquirmentComponent implements OnInit {
this
.
listEquirmentModel
[
this
.
index
].
eqName
=
this
.
myFormEquir
.
value
.
eqName
this
.
listEquirmentModel
[
this
.
index
].
eqDesc
=
this
.
myFormEquir
.
value
.
eqDesc
this
.
listEquirmentModel
[
this
.
index
].
eqType
=
this
.
myFormEquir
.
value
.
eqType
this
.
equirmentService
.
updateEquir
Profile
(
this
.
listEquirmentModel
[
this
.
index
])
this
.
equirmentService
.
updateEquir
ment
(
this
.
listEquirmentModel
[
this
.
index
])
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
deleteRoomProfile
()
{
this
.
roomService
.
deleteRoom
Profile
(
this
.
modelRoom
)
this
.
roomService
.
deleteRoom
(
this
.
modelRoom
)
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
deleteEquirProfile
()
{
this
.
equirmentService
.
deleteEquir
Profile
(
this
.
modelEquirment
)
this
.
equirmentService
.
deleteEquir
ment
(
this
.
modelEquirment
)
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
...
...
src/app/pages/admin-pending/admin-pending.component.html
View file @
5b5cd234
...
...
@@ -156,7 +156,7 @@
<td>
{{ item.equirments.eqDesc }}
</td>
<td>
{{ item.userName }}
</td>
<td>
{{ item.sDate | date : 'dd/MM/yyyy' }}
</td>
<td>
{{ item.
Q
uantity }}
</td>
<td>
{{ item.
q
uantity }}
</td>
<td
*
ngIf=
"item.eStatus==0"
>
รอดำเนินการ
</td>
<td
*
ngIf=
"item.eStatus==1"
>
อนุมัติ
</td>
<td
*
ngIf=
"item.eStatus==2"
>
ยกเลิก
</td>
...
...
src/app/pages/admin-pending/admin-pending.component.ts
View file @
5b5cd234
...
...
@@ -115,14 +115,14 @@ export class AdminPendingComponent implements OnInit {
userNameForm
:
new
FormControl
(
this
.
modelItemDetail
.
userName
,
[
Validators
.
required
]),
eTelephone
:
new
FormControl
(
this
.
modelItemDetail
.
eTelephone
,
[
Validators
.
required
]),
email
:
new
FormControl
(
this
.
modelItemDetail
.
email
,
[
Validators
.
required
,
Validators
.
email
]),
eqName
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
.
eqName
,
[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
.
eqDesc
,
[
Validators
.
required
]),
eqType
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
.
eqType
,
[
Validators
.
required
]),
eqName
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
s
.
eqName
,
[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
s
.
eqDesc
,
[
Validators
.
required
]),
eqType
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
s
.
eqType
,
[
Validators
.
required
]),
sDate
:
new
FormControl
(
this
.
modelItemDetail
.
sDate
,
[
Validators
.
required
]),
eDate
:
new
FormControl
(
this
.
modelItemDetail
.
eDate
,
[
Validators
.
required
]),
sTime
:
new
FormControl
(
this
.
modelItemDetail
.
sTime
,
[
Validators
.
required
]),
eTime
:
new
FormControl
(
this
.
modelItemDetail
.
eTime
,
[
Validators
.
required
]),
Quantity
:
new
FormControl
(
this
.
modelItemDetail
.
Q
uantity
,
[
Validators
.
required
]),
Quantity
:
new
FormControl
(
this
.
modelItemDetail
.
q
uantity
,
[
Validators
.
required
]),
remark
:
new
FormControl
(
this
.
modelItemDetail
.
remark
),
eStatus
:
new
FormControl
(
this
.
modelItemDetail
.
eStatus
),
allDay
:
new
FormControl
(
this
.
modelItemDetail
.
allDay
),
...
...
@@ -261,9 +261,9 @@ export class AdminPendingComponent implements OnInit {
this
.
modelItemDetail
.
userName
=
this
.
myFormEquir
.
value
.
userNameForm
;
this
.
modelItemDetail
.
eTelephone
=
this
.
myFormEquir
.
value
.
eTelephone
this
.
modelItemDetail
.
email
=
this
.
myFormEquir
.
value
.
email
this
.
modelItemDetail
.
equirment
.
eqName
=
this
.
myFormEquir
.
value
.
eqName
this
.
modelItemDetail
.
equirment
.
eqDesc
=
this
.
myFormEquir
.
value
.
eqDesc
this
.
modelItemDetail
.
equirment
.
eqType
=
this
.
myFormEquir
.
value
.
eqType
this
.
modelItemDetail
.
equirment
s
.
eqName
=
this
.
myFormEquir
.
value
.
eqName
this
.
modelItemDetail
.
equirment
s
.
eqDesc
=
this
.
myFormEquir
.
value
.
eqDesc
this
.
modelItemDetail
.
equirment
s
.
eqType
=
this
.
myFormEquir
.
value
.
eqType
this
.
modelItemDetail
.
sDate
=
this
.
myFormEquir
.
value
.
sDate
this
.
modelItemDetail
.
eDate
=
this
.
myFormEquir
.
value
.
eDate
this
.
modelItemDetail
.
sTime
=
this
.
myFormEquir
.
value
.
sTime
...
...
src/app/pages/equipment/equipment.component.html
View file @
5b5cd234
...
...
@@ -24,7 +24,7 @@
<div
class=
"card"
style=
"
padding: 10px;"
>
<div
class=
"card-body"
>
<img
style=
"object-fit: cover;"
[
src
]="
item
.
rPic
"
<img
style=
"object-fit: cover;"
[
src
]="
item
.
rPic
"
width=
"150px"
height=
"150px"
class=
"nav justify-content-center"
alt=
"..."
>
<br>
<p
class=
"text-left"
>
ชื่อ : {{item.rName}}
</p>
...
...
@@ -74,7 +74,7 @@
<div
class=
"card"
style=
"
padding: 10px;"
>
<div
class=
"card-body"
>
<img
style=
"object-fit: cover;"
[
src
]="
item
.
eqPic
"
<img
style=
"object-fit: cover;"
[
src
]="
item
.
eqPic
"
width=
"150px"
height=
"150px"
class=
"nav justify-content-center"
alt=
"..."
>
<br>
<p
class=
"text-left"
>
ชื่อ : {{item.eqName}}
</p>
...
...
src/app/pages/equipment/equipment.component.ts
View file @
5b5cd234
...
...
@@ -114,14 +114,14 @@ export class EquipmentComponent implements OnInit {
bookEquir
(
Lend
,
item
:
Equirment
)
{
this
.
modelItemDetail
=
new
ItemDetail
();
this
.
modelItemDetail
.
equirment
=
item
;
this
.
modelItemDetail
.
equirment
s
=
item
;
this
.
myFormEquir
=
new
FormGroup
({
userNameForm
:
new
FormControl
(
this
.
modelItemDetail
.
userName
,[
Validators
.
required
]),
eTelephone
:
new
FormControl
(
this
.
modelItemDetail
.
eTelephone
,[
Validators
.
required
]),
email
:
new
FormControl
(
this
.
modelItemDetail
.
email
,[
Validators
.
required
,
Validators
.
email
]),
eqName
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
.
eqName
,[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
.
eqDesc
,[
Validators
.
required
]),
eqName
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
s
.
eqName
,[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
s
.
eqDesc
,[
Validators
.
required
]),
sDate
:
new
FormControl
(
this
.
modelItemDetail
.
sDate
,[
Validators
.
required
]),
eDate
:
new
FormControl
(
''
),
sTime
:
new
FormControl
(
''
),
...
...
src/app/pages/home-page/home-page.component.ts
View file @
5b5cd234
...
...
@@ -230,7 +230,7 @@ export class HomePageComponent implements OnInit {
if
(
this
.
listItemDetail
[
i
].
eStatus
==
0
)
{
this
.
eventEquirment
.
push
({
id
:
this
.
listItemDetail
[
i
].
id
,
title
:
this
.
listItemDetail
[
i
].
equirment
.
eqName
+
" ("
+
this
.
listItemDetail
[
i
].
userName
+
")"
,
title
:
this
.
listItemDetail
[
i
].
equirment
s
.
eqName
+
" ("
+
this
.
listItemDetail
[
i
].
userName
+
")"
,
start
:
'2021-12-16T10:30:00'
,
end
:
'2021-12-16T11:30:00'
,
extendedProps
:
this
.
listItemDetail
[
i
],
...
...
@@ -299,8 +299,8 @@ export class HomePageComponent implements OnInit {
const
modalRef
=
this
.
modalService
.
open
(
NgbdModalLendContent
);
modalRef
.
componentInstance
.
name
=
this
.
selectedItemDetail
.
userName
;
modalRef
.
componentInstance
.
telephone
=
this
.
selectedItemDetail
.
eTelephone
;
modalRef
.
componentInstance
.
eqName
=
this
.
selectedItemDetail
.
equirment
.
eqName
;
modalRef
.
componentInstance
.
quantity
=
this
.
selectedItemDetail
.
Q
uantity
;
modalRef
.
componentInstance
.
eqName
=
this
.
selectedItemDetail
.
equirment
s
.
eqName
;
modalRef
.
componentInstance
.
quantity
=
this
.
selectedItemDetail
.
q
uantity
;
modalRef
.
componentInstance
.
sDate
=
this
.
selectedRoomDetail
.
sDate
;
}
}
\ No newline at end of file
src/app/pages/pending/pending.component.ts
View file @
5b5cd234
...
...
@@ -119,14 +119,14 @@ export class PendingComponent implements OnInit {
userNameForm
:
new
FormControl
(
this
.
modelItemDetail
.
userName
,
[
Validators
.
required
]),
eTelephone
:
new
FormControl
(
this
.
modelItemDetail
.
eTelephone
,
[
Validators
.
required
]),
email
:
new
FormControl
(
this
.
modelItemDetail
.
email
,
[
Validators
.
required
,
Validators
.
email
]),
eqName
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
.
eqName
,
[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
.
eqDesc
,
[
Validators
.
required
]),
eqType
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
.
eqType
,
[
Validators
.
required
]),
eqName
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
s
.
eqName
,
[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
s
.
eqDesc
,
[
Validators
.
required
]),
eqType
:
new
FormControl
(
this
.
modelItemDetail
.
equirment
s
.
eqType
,
[
Validators
.
required
]),
sDate
:
new
FormControl
(
this
.
modelItemDetail
.
sDate
,
[
Validators
.
required
]),
eDate
:
new
FormControl
(
this
.
modelItemDetail
.
eDate
,
[
Validators
.
required
]),
sTime
:
new
FormControl
(
this
.
modelItemDetail
.
sTime
,
[
Validators
.
required
]),
eTime
:
new
FormControl
(
this
.
modelItemDetail
.
eTime
,
[
Validators
.
required
]),
Quantity
:
new
FormControl
(
this
.
modelItemDetail
.
Q
uantity
,
[
Validators
.
required
]),
Quantity
:
new
FormControl
(
this
.
modelItemDetail
.
q
uantity
,
[
Validators
.
required
]),
remark
:
new
FormControl
(
this
.
modelItemDetail
.
remark
),
eStatus
:
new
FormControl
(
this
.
modelItemDetail
.
eStatus
)
})
...
...
src/app/service/contact.service.ts
View file @
5b5cd234
...
...
@@ -15,14 +15,12 @@ export class ContactService {
this
.
listContact
.
reverse
}
updateContact
(
row_obj
:
Contact
)
{
this
.
listContact
=
this
.
listContact
.
filter
((
value
,
key
)
=>
{
if
(
value
.
id
===
row_obj
.
id
)
{
value
=
row_obj
;
}
return
true
;
});
}
updateContact
(
model
:
Contact
)
{
this
.
http
.
put
(
this
.
url
+
"/contact/"
+
model
.
id
,
model
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลการติดต่อสำเร็จ"
)
})
}
getListContact
():
Observable
<
Contact
[]
>
{
return
this
.
http
.
get
<
Contact
[]
>
(
this
.
url
+
"/contact/lists"
);
...
...
src/app/service/equirment.service.ts
View file @
5b5cd234
...
...
@@ -19,10 +19,6 @@ export class EquirmentService {
})
}
// bookEquirment(models: ItemDetail){
// this.listEquirment.push(models);
// }
getListEquirment
():
Observable
<
Equirment
[]
>
{
return
this
.
http
.
get
<
Equirment
[]
>
(
this
.
url
+
"/eqment/lists"
);
}
...
...
@@ -37,46 +33,18 @@ export class EquirmentService {
})
}
// addEquirment(EquirmentModel: Equirment) {
// this.http.post(this.url, EquirmentModel).subscribe(response => {
// console.log(response);
// })
// }
deleteEquirment
(
EquirmentModel
:
Equirment
)
{
this
.
http
.
delete
(
this
.
url
+
"/eqment/"
+
EquirmentModel
.
eqId
).
subscribe
(
response
=>
{
deleteEquirment
(
model
:
Equirment
)
{
this
.
http
.
delete
(
this
.
url
+
"/eqment/"
+
model
.
eqId
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getListEquirment
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
})
}
updateEquirment
(
EquirmentM
odel
:
Equirment
)
{
this
.
http
.
put
(
this
.
url
+
"/
"
+
EquirmentModel
.
eqId
,
EquirmentM
odel
).
subscribe
(
response
=>
{
updateEquirment
(
m
odel
:
Equirment
)
{
this
.
http
.
put
(
this
.
url
+
"/
eqment/"
+
model
.
eqId
,
m
odel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลอุปกรณ์สำเร็จ"
)
})
}
updateEquirProfile
(
model
:
Equirment
)
{
this
.
listEquirment
=
this
.
listEquirment
.
filter
((
value
,
key
)
=>
{
if
(
value
.
eqId
===
model
.
eqId
)
{
value
=
model
;
}
return
true
;
});
}
deleteEquirProfile
(
row_obj
:
Equirment
)
{
this
.
listEquirment
=
this
.
listEquirment
.
filter
((
value
,
key
)
=>
{
return
value
.
eqId
!==
row_obj
.
eqId
;
});
}
EquirmentModel
(
eqId
:
string
)
{
}
}
\ No newline at end of file
src/app/service/item-detail.service.ts
View file @
5b5cd234
...
...
@@ -16,22 +16,10 @@ export class ItemDetailService {
this
.
listItemDetail
.
reverse
}
getListItemDetail
():
Observable
<
ItemDetail
[]
>
{
return
this
.
http
.
get
<
ItemDetail
[]
>
(
this
.
url
+
"/lend/lists"
);
}
// getListItemDetail() {
// this.http.get(this.url).subscribe((response: any) => {
// console.log(response);
// this.listItemDetail = response.content;
// }, error => {
// console.log(error)
// // alert("ไม่สามารถดึงข้อมูลห้องประชุมได้ เนื่องจาก :\n" + error.message)
// })
// }
searchListItemDetail
(
searchModel
:
SearchItemDetailModel
)
{
this
.
http
.
get
(
this
.
url
+
'&startDate='
+
searchModel
.
sDate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
sDate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
sDate
.
split
(
"-"
)[
0
]
+
'&endDate='
+
searchModel
.
eDate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
eDate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
eDate
.
split
(
"-"
)[
0
]
+
'&startTime='
+
searchModel
.
sTime
+
':00'
+
'&endTime='
+
searchModel
.
eTime
+
':00'
).
subscribe
((
response
:
any
)
=>
{
console
.
log
(
response
);
...
...
@@ -42,40 +30,19 @@ export class ItemDetailService {
})
}
// addEquirment(EquirmentModel: Equirment) {
// this.http.post(this.url, EquirmentModel).subscribe(response => {
// console.log(response);
// })
// }
deleteItemDetail
(
ItemDetailModel
:
ItemDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
ItemDetailModel
.
id
).
subscribe
(
response
=>
{
deleteItemDetail
(
model
:
ItemDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
model
.
id
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getListItemDetail
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
})
}
// updateItemDetail(ItemDetailModel: ItemDetail) {
// this.http.put(this.url + "/" +ItemDetailModel.id, ItemDetailModel).subscribe(response => {
// console.log(response);
// alert("อัพเดทข้อมูลอุปกรณ์สำเร็จ")
// })
// }
updateItemDetail
(
row_obj
:
ItemDetail
)
{
this
.
listItemDetail
=
this
.
listItemDetail
.
filter
((
value
,
key
)
=>
{
if
(
value
.
id
===
row_obj
.
id
)
{
value
=
row_obj
;
}
return
true
;
});
}
ItemDetailModel
(
eqId
:
string
)
{
updateItemDetail
(
model
:
ItemDetail
)
{
this
.
http
.
put
(
this
.
url
+
"/lend/"
+
model
.
id
,
model
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลอุปกรณ์สำเร็จ"
)
})
}
}
\ No newline at end of file
src/app/service/room-detail.service.ts
View file @
5b5cd234
...
...
@@ -19,71 +19,34 @@ export class RoomDetailService {
this
.
listRoomDetail
.
push
(
model
);
}
// updateRoomDetail(model: RoomDetail){
// let temp = this.listRoomDetail.filter( x =>
// x.Id == model.Id
// )
// console.log("temp",temp);
// }
updateRoomDetail
(
row_obj
:
RoomDetail
)
{
this
.
listRoomDetail
=
this
.
listRoomDetail
.
filter
((
value
,
key
)
=>
{
if
(
value
.
id
===
row_obj
.
id
)
{
value
=
row_obj
;
}
return
true
;
});
}
getListRoomDetail
()
:
Observable
<
RoomDetail
[]
>
{
return
this
.
http
.
get
<
RoomDetail
[]
>
(
this
.
url
+
"/book/lists"
);
}
// getListRoomDetail() {
// this.http.get(this.url).subscribe((response: any) => {
// console.log(response);
// this.listRoomDetail = response.content;
// }, error => {
// console.log(error)
// // alert("ไม่สามารถดึงข้อมูลห้องประชุมได้ เนื่องจาก :\n" + error.message)
// })
// }
searchListRoomDetail
(
searchModel
:
SearchRoomDetailModel
)
{
this
.
http
.
get
(
this
.
url
+
'&startDate='
+
searchModel
.
sDate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
sDate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
sDate
.
split
(
"-"
)[
0
]
+
'&endDate='
+
searchModel
.
eDate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
eDate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
eDate
.
split
(
"-"
)[
0
]
+
'&startTime='
+
searchModel
.
sTime
+
':00'
+
'&endTime='
+
searchModel
.
eTime
+
':00'
).
subscribe
((
response
:
any
)
=>
{
console
.
log
(
response
);
this
.
listRoomDetail
=
response
;
},
error
=>
{
console
.
log
(
error
)
alert
(
"ไม่สามารถค้นหา
อุปกรณ์ที่ว่างได้
เนื่องจาก :
\
n"
+
error
.
message
)
alert
(
"ไม่สามารถค้นหา
การจอง
เนื่องจาก :
\
n"
+
error
.
message
)
})
}
// addEquirment(EquirmentModel: Equirment) {
// this.http.post(this.url, EquirmentModel).subscribe(response => {
// console.log(response);
// })
// }
deleteRoomDetail
(
RoomDetailModel
:
RoomDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
RoomDetailModel
.
id
).
subscribe
(
response
=>
{
deleteRoomDetail
(
model
:
RoomDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/book/"
+
model
.
id
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getListRoomDetail
()
alert
(
"ลบข้อมูล
อุปกรณ์
สำเร็จ"
)
alert
(
"ลบข้อมูล
การจอง
สำเร็จ"
)
})
}
// updateRoomDetail(RoomDetailM
odel: RoomDetail) {
// this.http.put(this.url + "/" + RoomDetailModel.Id, RoomDetailM
odel).subscribe(response => {
//
console.log(response);
// alert("อัพเดทข้อมูลอุปกรณ์
สำเร็จ")
//
})
//
}
updateRoomDetail
(
m
odel
:
RoomDetail
)
{
this
.
http
.
put
(
this
.
url
+
"/book/"
+
model
.
id
,
m
odel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลการจอง
สำเร็จ"
)
})
}
}
\ No newline at end of file
src/app/service/room.service.ts
View file @
5b5cd234
...
...
@@ -45,39 +45,34 @@ export class RoomService {
// }
deleteRoom
(
roomM
odel
:
Room
)
{
this
.
http
.
delete
(
this
.
url
+
"/
"
+
roomM
odel
.
rId
).
subscribe
(
response
=>
{
deleteRoom
(
m
odel
:
Room
)
{
this
.
http
.
delete
(
this
.
url
+
"/
room/"
+
m
odel
.
rId
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getListRoom
()
alert
(
"ลบข้อมูลห้องสำเร็จ"
)
})
}
updateRoom
(
roomM
odel
:
Room
)
{
this
.
http
.
put
(
this
.
url
+
"/
"
+
roomModel
.
rId
,
roomM
odel
).
subscribe
(
response
=>
{
updateRoom
(
m
odel
:
Room
)
{
this
.
http
.
put
(
this
.
url
+
"/
room/"
+
model
.
rId
,
m
odel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลห้องสำเร็จ"
)
})
}
updateRoomProfile
(
model
:
Room
)
{
this
.
listRoomModel
=
this
.
listRoomModel
.
filter
((
value
,
key
)
=>
{
if
(
value
.
rId
===
model
.
rId
)
{
value
=
model
;
}
return
true
;
});
}
deleteRoomProfile
(
row_obj
:
Room
)
{
this
.
listRoomModel
=
this
.
listRoomModel
.
filter
((
value
,
key
)
=>
{
return
value
.
rId
!==
row_obj
.
rId
;
});
}
roomModel
(
rId
:
string
)
{
}
// updateRoomProfile(model : Room) {
// this.listRoomModel = this.listRoomModel.filter((value, key) => {
// if (value.rId === model.rId) {
// value = model;
// }
// return true;
// });
// }
// deleteRoomProfile(row_obj: Room) {
// this.listRoomModel = this.listRoomModel.filter((value, key) => {
// return value.rId !== row_obj.rId;
// });
// }
}
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