Commit 374f8af9 by DESKTOP-HF0LVOG\myhr

add function

parent 6fcec8df
......@@ -234,7 +234,7 @@ export class AdminPendingComponent implements OnInit {
}
saveStatus() {
this.RoomDetailService.addRoomDetail(this.modelRoomDetail)
this.RoomDetailService.updateRoomDetail(this.modelRoomDetail)
this.modalService.dismissAll();
this.ngOnInit();
console.log(this.modelRoomDetail)
......
......@@ -75,6 +75,14 @@ export class RoomDetailService {
this.listRoomDetail.push(model);
}
updateRoomDetail(model: RoomDetail){
let temp = this.listRoomDetail.filter( x =>
x.Id == model.Id
)
console.log("temp",temp);
}
getListRoomDetail() {
return this.listRoomDetail;
}
......@@ -115,12 +123,12 @@ export class RoomDetailService {
})
}
updateRoomDetail(RoomDetailModel: RoomDetail) {
this.http.put(this.url + "/" + RoomDetailModel.Id, RoomDetailModel).subscribe(response => {
console.log(response);
alert("อัพเดทข้อมูลอุปกรณ์สำเร็จ")
})
}
// updateRoomDetail(RoomDetailModel: RoomDetail) {
// this.http.put(this.url + "/" + RoomDetailModel.Id, RoomDetailModel).subscribe(response => {
// console.log(response);
// alert("อัพเดทข้อมูลอุปกรณ์สำเร็จ")
// })
// }
RoomDetailModel(rId: string) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment