Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HIAST-Clinics
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
almohanad.hafez
HIAST-Clinics
Commits
a8c67c7a
Commit
a8c67c7a
authored
Aug 25, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(F) receptionist use cases
parent
77aa7142
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
452 additions
and
99 deletions
+452
-99
app.module.ts
Clinics.Frontend/src/app/app.module.ts
+4
-0
doctor.ts
Clinics.Frontend/src/app/classes/doctor/doctor.ts
+28
-0
employee-data.ts
...cs.Frontend/src/app/classes/employeeData/employee-data.ts
+29
-0
waiting-list-record.ts
...ontend/src/app/classes/waitingList/waiting-list-record.ts
+24
-0
create-employee-form.component.html
.../create-employee-form/create-employee-form.component.html
+5
-16
create-employee-form.component.ts
...st/create-employee-form/create-employee-form.component.ts
+28
-15
create-witing-list-item-for-employee.component.ts
...mployee/create-witing-list-item-for-employee.component.ts
+21
-3
doctor-item.component.html
...nents/receptionist/doctor-item/doctor-item.component.html
+8
-13
doctor-item.component.ts
...ponents/receptionist/doctor-item/doctor-item.component.ts
+9
-1
doctors.component.html
...pp/components/receptionist/doctors/doctors.component.html
+3
-3
doctors.component.ts
.../app/components/receptionist/doctors/doctors.component.ts
+24
-2
employee-serial-number-pop-up.component.ts
...-number-pop-up/employee-serial-number-pop-up.component.ts
+20
-7
employee.component.html
.../components/receptionist/employee/employee.component.html
+0
-11
employee.component.ts
...pp/components/receptionist/employee/employee.component.ts
+44
-17
waiting-list-item.component.html
...ionist/waiting-list-item/waiting-list-item.component.html
+3
-3
waiting-list-item.component.ts
...ptionist/waiting-list-item/waiting-list-item.component.ts
+29
-4
waiting-list.component.html
...nts/receptionist/waiting-list/waiting-list.component.html
+2
-2
waiting-list.component.ts
...nents/receptionist/waiting-list/waiting-list.component.ts
+27
-2
doctors.service.ts
Clinics.Frontend/src/app/services/doctors/doctors.service.ts
+28
-0
employees-data.service.ts
...tend/src/app/services/employees/employees-data.service.ts
+62
-0
waiting-list.service.ts
...tend/src/app/services/waitingList/waiting-list.service.ts
+54
-0
No files found.
Clinics.Frontend/src/app/app.module.ts
View file @
a8c67c7a
...
...
@@ -41,6 +41,8 @@ import { CreateWitingListItemForFamilyMemberComponent } from './components/recep
import
{
CreateEmployeeFormComponent
}
from
'./components/receptionist/create-employee-form/create-employee-form.component'
;
import
{
EmployeeSerialNumberPopUpComponent
}
from
'./components/receptionist/employee-serial-number-pop-up/employee-serial-number-pop-up.component'
;
import
{
EmployeeComponent
}
from
'./components/receptionist/employee/employee.component'
;
import
{
WaitingListService
}
from
'./services/waitingList/waiting-list.service'
;
import
{
EmployeesDataService
}
from
'./services/employees/employees-data.service'
;
@
NgModule
({
...
...
@@ -65,6 +67,8 @@ import { EmployeeComponent } from './components/receptionist/employee/employee.c
SignalRService
,
DoctorUsersService
,
ReceptionistUsersService
,
WaitingListService
,
EmployeesDataService
],
// components and directives that belong to this module
...
...
Clinics.Frontend/src/app/classes/doctor/doctor.ts
0 → 100644
View file @
a8c67c7a
export
class
Doctor
{
public
fullName
:
string
;
public
status
:
string
;
public
phones
:
Phone
[];
constructor
(
fullName
:
string
=
''
,
status
:
string
=
''
,
phones
:
Phone
[]
=
[])
{
this
.
fullName
=
fullName
;
this
.
status
=
status
;
this
.
phones
=
phones
;
}
}
export
class
Phone
{
public
name
:
string
;
public
phone
:
string
;
constructor
(
name
:
string
=
''
,
phone
:
string
=
''
)
{
this
.
name
=
name
;
this
.
phone
=
phone
;
}
}
export
class
DoctorStatuses
{
public
static
readonly
Online
=
'متاح'
;
public
static
readonly
Busy
=
'مشغول'
;
public
static
readonly
InWork
=
'لديه مريض'
;
}
\ No newline at end of file
Clinics.Frontend/src/app/classes/employeeData/employee-data.ts
0 → 100644
View file @
a8c67c7a
export
class
EmployeeData
{
public
id
:
number
;
public
firstName
:
string
;
public
middleName
:
string
;
public
lastName
:
string
;
public
dateOfBirth
:
Date
;
public
gender
:
'ذكر'
|
'أنثى'
|
null
;
public
serialNumber
:
string
;
public
centerStatus
:
string
;
constructor
(
id
:
number
=
0
,
firstName
:
string
=
''
,
middleName
:
string
=
''
,
lastName
:
string
=
''
,
dateOfBirth
:
Date
=
new
Date
(
Date
.
now
()),
gender
:
'ذكر'
|
'أنثى'
|
null
=
null
,
serialNumber
:
string
=
''
,
centerStatus
:
string
=
''
)
{
this
.
firstName
=
firstName
;
this
.
middleName
=
middleName
;
this
.
lastName
=
lastName
;
this
.
dateOfBirth
=
dateOfBirth
;
this
.
gender
=
gender
;
this
.
serialNumber
=
serialNumber
;
this
.
centerStatus
=
centerStatus
;
}
}
Clinics.Frontend/src/app/classes/waitingList/waiting-list-record.ts
0 → 100644
View file @
a8c67c7a
export
class
WaitingListRecord
{
public
id
:
number
=
0
;
public
patientId
:
number
=
0
;
public
fullName
:
string
=
''
;
public
isEmployee
:
boolean
=
true
;
public
arrivalTime
:
Date
=
new
Date
(
Date
.
now
());
constructor
(
id
:
number
,
patientId
:
number
,
fullName
:
string
,
isEmployee
:
boolean
,
arrivalTime
:
Date
)
{
this
.
id
=
id
;
this
.
patientId
=
patientId
;
this
.
fullName
=
fullName
;
this
.
isEmployee
=
isEmployee
;
this
.
arrivalTime
=
arrivalTime
;
}
}
export
class
WaitingListRecordTypes
{
public
static
readonly
Employee
:
string
=
"موظف"
;
public
static
readonly
FamilyMember
:
string
=
"أفراد عائلة"
;
}
\ No newline at end of file
Clinics.Frontend/src/app/components/receptionist/create-employee-form/create-employee-form.component.html
View file @
a8c67c7a
...
...
@@ -2,17 +2,6 @@
<section
class=
"section"
>
<div
dir=
"rtl"
class=
"mb-5 custom-form"
>
<div
class=
"container text-center mb-3"
>
<div
class=
"custom-back-button"
>
<a
[
routerLink
]="['../../
waitinglist
']"
>
<button
class=
"btn btn-outline-primary"
>
عودة
<i
class=
"bi bi-arrow-left"
></i>
</button>
</a>
</div>
</div>
<!-- #region Title-->
<div
class=
"text-center custom-form-title mb-4"
>
...
...
@@ -27,7 +16,7 @@
</div>
<!-- #endregion -->
<form
#
createDoctorUserF
orm=
"ngForm"
(
ngSubmit
)="
onSubmit
()"
class=
"text-center custom-form-container"
autocomplete=
"off"
>
<form
#
f
orm=
"ngForm"
(
ngSubmit
)="
onSubmit
()"
class=
"text-center custom-form-container"
autocomplete=
"off"
>
<!-- #region Personal data-->
<div
class=
"accordion"
>
...
...
@@ -178,9 +167,9 @@
<select
class=
"form-control text-center"
[(
ngModel
)]="
formModel
.
gender
"
name=
"gender"
#
gender=
"ngModel"
required
>
<option
value=
""
selected
>
اختر الجنس
</option>
<option
value=
"ذكر
"
>
ذكر
</option>
<option
value=
"أنثى
"
>
أنثى
</option>
<option
[
ngValue
]="
null
"
>
اختر الجنس
</option>
<option
[
ngValue
]="'ذكر'
"
>
ذكر
</option>
<option
[
ngValue
]="'أنثى'
"
>
أنثى
</option>
</select>
</div>
...
...
@@ -342,7 +331,7 @@
<div
class=
"d-grid gap-3 mb-5 custom-buttons custom-form-buttons"
>
<button
type=
"submit"
class=
"btn btn-outline-primary"
[
disabled
]="
createDoctorUserF
orm
.
pristine
"
>
[
disabled
]="
f
orm
.
pristine
"
>
حفظ
<i
class=
"bi bi-save"
></i>
</button>
...
...
Clinics.Frontend/src/app/components/receptionist/create-employee-form/create-employee-form.component.ts
View file @
a8c67c7a
...
...
@@ -3,6 +3,8 @@ import { Component, ViewChild } from '@angular/core';
import
{
NgForm
}
from
'@angular/forms'
;
import
{
Router
}
from
'@angular/router'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
EmployeeData
}
from
'../../../classes/employeeData/employee-data'
;
import
{
EmployeesDataService
}
from
'../../../services/employees/employees-data.service'
;
@
Component
({
selector
:
'app-create-employee-form'
,
...
...
@@ -13,21 +15,14 @@ export class CreateEmployeeFormComponent {
//#region CTOR DI
constructor
(
private
toastrService
:
ToastrService
,
private
router
:
Router
,
private
scroller
:
ViewportScroller
private
scroller
:
ViewportScroller
,
private
employeesDataService
:
EmployeesDataService
)
{
}
//#endregion
//#region Variables
@
ViewChild
(
"form"
)
form
:
NgForm
;
formModel
:
any
=
{
"firstName"
:
"المهند"
,
"middleName"
:
"ياسر"
,
"lastName"
:
"حافظ"
,
"dateOfBirth"
:
"2002-06-09"
,
"gender"
:
"ذكر"
,
"serialNumber"
:
"992022"
,
"centerStatus"
:
"مباشر عمله"
,
}
formModel
:
EmployeeData
=
new
EmployeeData
();
isFailure
:
boolean
=
false
;
isInvalid
:
boolean
=
false
;
...
...
@@ -46,14 +41,32 @@ export class CreateEmployeeFormComponent {
this
.
isInvalid
=
false
;
this
.
isFailure
=
false
;
this
.
errorMessage
=
''
;
}
this
.
employeesDataService
.
create
(
this
.
formModel
)
.
subscribe
(
result
=>
{
if
(
result
.
status
===
true
)
{
this
.
toastrService
.
success
(
'تم إضافة الموظف بنجاح'
);
this
.
router
.
navigateByUrl
(
`receptionist/employees/
${
result
.
id
!
}
`
);
}
else
{
this
.
isFailure
=
true
;
this
.
errorMessage
=
result
.
errorMessage
!
;
this
.
isPersonal
=
true
;
this
.
isAdditional
=
true
;
this
.
isWork
=
true
;
this
.
isOptions
=
true
;
this
.
form
.
form
.
markAsPristine
();
this
.
scroller
.
scrollToPosition
([
0
,
0
]);
}
})
}
else
{
this
.
isInvalid
=
true
;
//
this.isPersonal = true;
//
this.isAdditional = true;
//
this.isWork = true;
//
this.isOptions = true;
this
.
isPersonal
=
true
;
this
.
isAdditional
=
true
;
this
.
isWork
=
true
;
this
.
isOptions
=
true
;
this
.
form
.
form
.
markAsPristine
();
this
.
scroller
.
scrollToPosition
([
0
,
0
]);
}
...
...
Clinics.Frontend/src/app/components/receptionist/create-witing-list-item-for-employee/create-witing-list-item-for-employee.component.ts
View file @
a8c67c7a
...
...
@@ -2,6 +2,8 @@ import { Component, Input, ViewChild } from '@angular/core';
import
{
NgForm
}
from
'@angular/forms'
;
import
{
Router
}
from
'@angular/router'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
WaitingListService
}
from
'../../../services/waitingList/waiting-list.service'
;
import
{
ViewportScroller
}
from
'@angular/common'
;
@
Component
({
selector
:
'app-create-witing-list-item-for-employee'
,
...
...
@@ -12,7 +14,9 @@ export class CreateWitingListItemForEmployeeComponent {
// #region CTOR DI
constructor
(
private
toastrService
:
ToastrService
,
private
router
:
Router
private
router
:
Router
,
private
waitingListService
:
WaitingListService
,
private
scroller
:
ViewportScroller
)
{
}
// #endregion
...
...
@@ -22,11 +26,25 @@ export class CreateWitingListItemForEmployeeComponent {
isFailure
:
boolean
=
false
;
errorMessage
:
string
;
@
Input
(
"formModel"
)
formModel
:
any
=
{
serialNumber
:
5
};
@
Input
(
"formModel"
)
formModel
=
{
serialNumber
:
''
};
onSubmit
():
void
{
this
.
errorMessage
=
''
;
this
.
isFailure
=
false
;
if
(
this
.
form
.
valid
)
{
this
.
waitingListService
.
createBySerialNumber
(
this
.
formModel
.
serialNumber
)
.
subscribe
((
result
=>
{
if
(
result
.
status
===
true
)
{
this
.
toastrService
.
success
(
'تمت الإضافة بنجاح'
);
this
.
router
.
navigateByUrl
(
'receptionist/waitinglist'
);
}
else
{
this
.
scroller
.
scrollToPosition
([
0
,
0
]);
this
.
isFailure
=
true
;
this
.
errorMessage
=
result
.
errorMessage
!
;
this
.
form
.
form
.
markAsPristine
();
}
}))
}
}
...
...
Clinics.Frontend/src/app/components/receptionist/doctor-item/doctor-item.component.html
View file @
a8c67c7a
...
...
@@ -3,35 +3,30 @@
<!-- #region icon -->
<div
class=
"icon"
>
<i
class=
"fas fa-user-md"
></i>
<span
class=
"online-status busy"
></span>
<span
*
ngIf=
"doctor.status == statuses.Online"
class=
"online-status online"
></span>
<span
*
ngIf=
"doctor.status == statuses.Busy"
class=
"online-status busy"
></span>
<span
*
ngIf=
"doctor.status == statuses.InWork"
class=
"online-status in-work"
></span>
</div>
<!-- #endregion -->
<!-- #region Name-->
<div
class=
"custom-user-full-name"
>
<h3
style=
"border:none;"
>
د. تيسير عبداللطيف الأحمر
</h3>
<h3
style=
"border:none;"
>
{{doctor.fullName}}
</h3>
</div>
<!-- #endregion -->
<!-- #region details-->
<div
class=
"custom-user-data mb-2"
>
<div
*
ngIf=
"doctor.phones.length !== 0"
class=
"custom-user-data mb-2"
>
<span>
معلومات التواصل:
</span>
<span></span>
</div>
<div
class=
"custom-user-data mb-1"
>
<div
*
ngFor=
"let phone of doctor.phones"
class=
"custom-user-data mb-1"
>
<a><i
style=
"margin-left: 0.3em;"
class=
"bi bi-telephone"
></i></a>
<span>
هاتف العمل:
</span>
<
span>
0312515011
</span
>
<span>
{{phone.name}}:
</span>
<
p
style=
"margin-right: 0.5em;"
>
{{phone.phone}}
</p
>
</div>
<div
class=
"custom-user-data mb-1"
>
<a><i
style=
"margin-left: 0.3em;"
class=
"bi bi-telephone"
></i></a>
<span>
هاتف المنزل:
</span>
<span>
0312515011
</span>
</div>
<!-- #endregion -->
...
...
Clinics.Frontend/src/app/components/receptionist/doctor-item/doctor-item.component.ts
View file @
a8c67c7a
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
Input
}
from
'@angular/core'
;
import
{
Doctor
,
DoctorStatuses
}
from
'../../../classes/doctor/doctor'
;
@
Component
({
selector
:
'app-doctor-item'
,
...
...
@@ -7,4 +8,11 @@ import { Component } from '@angular/core';
})
export
class
DoctorItemComponent
{
@
Input
(
"doctor"
)
doctor
:
Doctor
=
new
Doctor
();
statuses
=
{
Online
:
DoctorStatuses
.
Online
,
Busy
:
DoctorStatuses
.
Busy
,
InWork
:
DoctorStatuses
.
InWork
}
}
Clinics.Frontend/src/app/components/receptionist/doctors/doctors.component.html
View file @
a8c67c7a
...
...
@@ -2,7 +2,7 @@
<section
class=
"section"
>
<!-- #region Title-->
<div
class=
"custom-title"
>
<div
class=
"custom-title
mb-5
"
>
<h2>
الأطباء:
</h2>
</div>
<!-- #endregion -->
...
...
@@ -10,8 +10,8 @@
<!-- #region container-->
<div
class=
"container"
>
<div
class=
"row gy-5 "
>
<div
class=
"col-lg-4 col-md-6"
>
<app-doctor-item></app-doctor-item>
<div
*
ngFor=
"let doctor of doctors"
class=
"col-lg-4 col-md-6"
>
<app-doctor-item
[
doctor
]="
doctor
"
></app-doctor-item>
</div>
</div>
</div>
...
...
Clinics.Frontend/src/app/components/receptionist/doctors/doctors.component.ts
View file @
a8c67c7a
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
DoctorsService
}
from
'../../../services/doctors/doctors.service'
;
import
{
Doctor
}
from
'../../../classes/doctor/doctor'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
@
Component
({
selector
:
'app-doctors'
,
templateUrl
:
'./doctors.component.html'
,
styleUrl
:
'./doctors.component.css'
})
export
class
DoctorsComponent
{
export
class
DoctorsComponent
implements
OnInit
{
constructor
(
private
doctorsService
:
DoctorsService
,
private
toasreService
:
ToastrService
)
{}
ngOnInit
():
void
{
this
.
updateDoctors
();
}
updateDoctors
():
void
{
this
.
doctorsService
.
getAll
()
.
subscribe
(
result
=>
{
if
(
result
===
null
)
{
this
.
toasreService
.
error
(
'حدث خطأ، يرجى إعادة المحاولة'
);
}
else
this
.
doctors
=
result
;
})
}
doctors
:
Doctor
[]
=
[]
}
Clinics.Frontend/src/app/components/receptionist/employee-serial-number-pop-up/employee-serial-number-pop-up.component.ts
View file @
a8c67c7a
...
...
@@ -2,6 +2,7 @@ import { Component, Input, ViewChild } from '@angular/core';
import
{
NgForm
}
from
'@angular/forms'
;
import
{
Router
}
from
'@angular/router'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
EmployeesDataService
}
from
'../../../services/employees/employees-data.service'
;
@
Component
({
selector
:
'app-employee-serial-number-pop-up'
,
...
...
@@ -12,8 +13,8 @@ export class EmployeeSerialNumberPopUpComponent {
//#region CTOR DI
constructor
(
private
toastrService
:
ToastrService
,
private
router
:
Router
constructor
(
private
router
:
Router
,
private
employeesDataService
:
EmployeesDataService
)
{}
//#endregion
...
...
@@ -23,7 +24,7 @@ export class EmployeeSerialNumberPopUpComponent {
//#region Variables
@
ViewChild
(
"form"
)
form
:
NgForm
;
formModel
:
any
=
{
serialNumber
:
4
};
formModel
:
any
=
{
serialNumber
:
''
};
isFailure
:
boolean
=
false
;
errorMessage
:
string
=
''
;
...
...
@@ -31,12 +32,24 @@ export class EmployeeSerialNumberPopUpComponent {
// #region On submit
onSubmit
():
void
{
this
.
isFailure
=
false
;
this
.
errorMessage
=
''
;
if
(
this
.
form
.
form
.
valid
)
{
let
id
:
number
=
5
;
this
.
router
.
navigateByUrl
(
`receptionist/employees/
${
id
}
`
)
this
.
parentModal
.
dismiss
();
this
.
employeesDataService
.
getBySerialNumber
(
this
.
formModel
.
serialNumber
)
.
subscribe
(
result
=>
{
if
(
result
.
status
===
true
)
{
const
id
=
result
.
employeeData
!
.
id
;
this
.
parentModal
.
dismiss
();
this
.
router
.
navigateByUrl
(
`receptionist/employees/
${
id
}
`
);
}
else
{
this
.
isFailure
=
true
;
this
.
errorMessage
=
result
.
errorMessage
!
;
this
.
form
.
form
.
markAsPristine
();
}
})
}
this
.
form
.
form
.
markAsPristine
();
}
// #endregion
...
...
Clinics.Frontend/src/app/components/receptionist/employee/employee.component.html
View file @
a8c67c7a
...
...
@@ -2,17 +2,6 @@
<section
class=
"section"
>
<div
dir=
"rtl"
class=
"mb-5 custom-form"
>
<div
class=
"container text-center mb-3"
>
<div
class=
"custom-back-button"
>
<a
[
routerLink
]="['../../
waitinglist
']"
>
<button
class=
"btn btn-outline-primary"
>
عودة
<i
class=
"bi bi-arrow-left"
></i>
</button>
</a>
</div>
</div>
<!-- #region Title-->
<div
class=
"text-center custom-form-title mb-4"
>
...
...
Clinics.Frontend/src/app/components/receptionist/employee/employee.component.ts
View file @
a8c67c7a
import
{
ViewportScroller
}
from
'@angular/common'
;
import
{
Component
,
numberAttribute
,
ViewChild
}
from
'@angular/core'
;
import
{
AfterViewInit
,
Component
,
numberAttribute
,
OnChanges
,
OnInit
,
SimpleChanges
,
ViewChild
}
from
'@angular/core'
;
import
{
NgForm
}
from
'@angular/forms'
;
import
{
Router
}
from
'@angular/router'
;
import
{
ActivatedRoute
,
NavigationEnd
,
Router
}
from
'@angular/router'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
EmployeeData
}
from
'../../../classes/employeeData/employee-data'
;
import
{
EmployeesDataService
}
from
'../../../services/employees/employees-data.service'
;
@
Component
({
selector
:
'app-employee'
,
templateUrl
:
'./employee.component.html'
,
styleUrl
:
'./employee.component.css'
})
export
class
EmployeeComponent
{
export
class
EmployeeComponent
implements
OnInit
{
//#region CTOR DI
constructor
(
private
toastrService
:
ToastrService
,
private
router
:
Router
,
private
scroller
:
ViewportScroller
private
activeRoute
:
ActivatedRoute
,
private
scroller
:
ViewportScroller
,
private
employeesDataService
:
EmployeesDataService
)
{
}
//#endregion
ngOnInit
():
void
{
this
.
getIdFromUrl
();
this
.
updateFormModel
();
}
getIdFromUrl
():
void
{
this
.
id
=
Number
(
this
.
activeRoute
.
snapshot
.
paramMap
.
get
(
'id'
));
if
(
isNaN
(
this
.
id
))
{
this
.
toastrService
.
error
(
'حدثت مشكلة، يرجى إعادة المحاولة'
);
this
.
router
.
navigateByUrl
(
'receptionist/waitinglist'
);
}
}
updateFormModel
():
void
{
this
.
employeesDataService
.
getById
(
this
.
id
)
.
subscribe
(
result
=>
{
if
(
result
.
status
===
true
)
{
this
.
formModel
=
result
.
employeeData
!
;
}
else
{
this
.
toastrService
.
error
(
'حدثت مشكلة، يرجى إعادة المحاولة'
);
this
.
router
.
navigateByUrl
(
'receptionist/waitinglist'
);
}
})
}
//#region Variables
private
id
:
number
;
@
ViewChild
(
"form"
)
form
:
NgForm
;
formModel
:
any
=
{
"firstName"
:
"المهند"
,
"middleName"
:
"ياسر"
,
"lastName"
:
"حافظ"
,
"dateOfBirth"
:
"2002-06-09"
,
"gender"
:
"ذكر"
,
"serialNumber"
:
"992022"
,
"centerStatus"
:
"مباشر عمله"
,
}
formModel
:
EmployeeData
=
new
EmployeeData
();
isFailure
:
boolean
=
false
;
isInvalid
:
boolean
=
false
;
...
...
@@ -47,7 +74,7 @@ export class EmployeeComponent {
// #region on submit
onSubmit
():
void
{
if
(
this
.
form
.
valid
)
{
this
.
isInvalid
=
false
;
this
.
isFailure
=
false
;
this
.
errorMessage
=
''
;
...
...
@@ -60,7 +87,7 @@ export class EmployeeComponent {
// this.isWork = true;
// this.isOptions = true;
this
.
form
.
form
.
markAsPristine
();
this
.
scroller
.
scrollToPosition
([
0
,
0
]);
this
.
scroller
.
scrollToPosition
([
0
,
0
]);
}
}
// #endregion
...
...
@@ -72,7 +99,7 @@ export class EmployeeComponent {
handleEdit
():
void
{
this
.
isEditing
=
true
;
this
.
scroller
.
scrollToPosition
([
0
,
0
]);
this
.
scroller
.
scrollToPosition
([
0
,
0
]);
}
}
Clinics.Frontend/src/app/components/receptionist/waiting-list-item/waiting-list-item.component.html
View file @
a8c67c7a
...
...
@@ -8,7 +8,7 @@
<!-- #region Name-->
<div
class=
"mb-3"
class=
"custom-user-full-name"
>
<h3>
أحمد عبدالله توفيق العلي
</h3>
<h3>
{{model.fullName}}
</h3>
</div>
<!-- #endregion -->
...
...
@@ -16,12 +16,12 @@
<div
class=
"custom-user-data mb-4 mt-4"
>
<span>
نوع الزيارة:
</span>
<span
>
</span>
<span
style=
"margin-right: 0.5em;"
>
{{getType()}}
</span>
</div>
<div
class=
"custom-user-data mb-4 mt-4"
>
<span>
ساعة الوصول:
</span>
<span
>
</span>
<span
style=
"margin-right: 0.5em;"
dir=
"ltr"
>
{{ model.arrivalTime | date: 'hh:mm a' }}
</span>
</div>
<!-- #endregion -->
...
...
Clinics.Frontend/src/app/components/receptionist/waiting-list-item/waiting-list-item.component.ts
View file @
a8c67c7a
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
NgbModal
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
WaitingListRecord
}
from
'../../../classes/waitingList/waiting-list-record'
;
import
{
WaitingListService
}
from
'../../../services/waitingList/waiting-list.service'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
@
Component
({
selector
:
'app-waiting-list-item'
,
...
...
@@ -8,10 +11,23 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
})
export
class
WaitingListItemComponent
{
constructor
(
private
modalService
:
NgbModal
constructor
(
private
modalService
:
NgbModal
,
private
waitingListService
:
WaitingListService
,
private
toastrService
:
ToastrService
)
{}
@
Input
(
"model"
)
model
:
WaitingListRecord
=
new
WaitingListRecord
(
0
,
0
,
''
,
true
,
new
Date
(
Date
.
now
()));
@
Output
(
"deleted"
)
deleted
:
EventEmitter
<
any
>
=
new
EventEmitter
();
)
{}
readonly
types
=
{
Employee
:
"موظف"
,
FamilyMember
:
"أفراد عائلة"
}
getType
()
{
if
(
this
.
model
.
isEmployee
)
return
this
.
types
.
Employee
;
return
this
.
types
.
FamilyMember
;
}
onClickDelete
(
modal
:
any
):
void
{
this
.
modalService
.
open
(
modal
,
{
...
...
@@ -21,6 +37,15 @@ export class WaitingListItemComponent {
}
onDelete
():
void
{
this
.
waitingListService
.
delete
(
this
.
model
.
id
)
.
subscribe
(
result
=>
{
if
(
result
.
status
===
true
)
{
this
.
toastrService
.
success
(
'تم الحذف بنجاح'
);
this
.
deleted
.
emit
();
}
else
{
this
.
toastrService
.
error
(
'حدث خطأ، يرجى اعادة المحاولة'
);
}
})
}
}
Clinics.Frontend/src/app/components/receptionist/waiting-list/waiting-list.component.html
View file @
a8c67c7a
...
...
@@ -17,8 +17,8 @@
<!-- #region container-->
<div
class=
"container"
>
<div
class=
"row gy-5 "
>
<div
class=
"col-lg-4 col-md-6"
>
<app-waiting-list-item></app-waiting-list-item>
<div
*
ngFor=
"let record of records"
class=
"col-lg-4 col-md-6"
>
<app-waiting-list-item
[
model
]="
record
"
(
deleted
)="
onRecordDeleted
()"
></app-waiting-list-item>
</div>
</div>
</div>
...
...
Clinics.Frontend/src/app/components/receptionist/waiting-list/waiting-list.component.ts
View file @
a8c67c7a
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
WaitingListRecord
}
from
'../../../classes/waitingList/waiting-list-record'
;
import
{
WaitingListService
}
from
'../../../services/waitingList/waiting-list.service'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
@
Component
({
selector
:
'app-waiting-list'
,
templateUrl
:
'./waiting-list.component.html'
,
styleUrl
:
'./waiting-list.component.css'
})
export
class
WaitingListComponent
{
export
class
WaitingListComponent
implements
OnInit
{
constructor
(
private
waitingListService
:
WaitingListService
,
private
toastrService
:
ToastrService
)
{}
ngOnInit
():
void
{
this
.
updateList
();
}
updateList
():
void
{
this
.
waitingListService
.
getAll
()
.
subscribe
(
result
=>
{
if
(
result
===
null
)
this
.
toastrService
.
error
(
"حدث خطأ، يرجى إعادة المحاولة"
);
else
this
.
records
=
result
;
});
}
records
:
WaitingListRecord
[]
=
[];
onRecordDeleted
():
void
{
this
.
updateList
();
}
}
Clinics.Frontend/src/app/services/doctors/doctors.service.ts
0 → 100644
View file @
a8c67c7a
import
{
HttpClient
,
HttpErrorResponse
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
*
as
config
from
'../../../../config'
;
import
{
catchError
,
map
,
Observable
,
of
}
from
'rxjs'
;
import
{
Doctor
}
from
'../../classes/doctor/doctor'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
DoctorsService
{
constructor
(
private
http
:
HttpClient
)
{
}
private
readonly
DOCTORS_ENDPOINT
:
string
=
`
${
config
.
apiUrl
}
/Doctors`
;
getAll
():
Observable
<
Doctor
[]
|
null
>
{
return
this
.
http
.
get
<
{
doctors
:
Doctor
[]}
>
(
this
.
DOCTORS_ENDPOINT
)
.
pipe
(
map
((
response
:
{
doctors
:
Doctor
[]})
=>
{
console
.
log
(
response
.
doctors
);
return
response
.
doctors
;
}),
catchError
((
error
:
HttpErrorResponse
)
=>
{
console
.
error
(
error
);
return
of
(
null
);
})
)
}
}
Clinics.Frontend/src/app/services/employees/employees-data.service.ts
0 → 100644
View file @
a8c67c7a
import
{
HttpClient
,
HttpErrorResponse
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
*
as
config
from
'../../../../config'
;
import
{
EmployeeData
}
from
'../../classes/employeeData/employee-data'
;
import
{
catchError
,
map
,
Observable
,
of
}
from
'rxjs'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
EmployeesDataService
{
constructor
(
private
http
:
HttpClient
)
{
}
private
readonly
EMPLOYEES_ENDPOINT
:
string
=
`
${
config
.
apiUrl
}
/Employees`
;
create
(
employeeData
:
EmployeeData
):
Observable
<
{
status
:
boolean
,
errorMessage
:
string
|
null
,
id
:
number
|
null
}
>
{
const
body
:
any
=
{
// No id in create method
firstName
:
employeeData
.
firstName
,
middleName
:
employeeData
.
middleName
,
lastName
:
employeeData
.
lastName
,
dateOfBirth
:
employeeData
.
dateOfBirth
,
gender
:
employeeData
.
gender
,
serialNumber
:
employeeData
.
serialNumber
.
toString
(),
centerStatus
:
employeeData
.
centerStatus
,
};
console
.
log
(
body
);
return
this
.
http
.
post
<
{
id
:
number
}
>
(
this
.
EMPLOYEES_ENDPOINT
,
body
)
.
pipe
(
map
((
response
:
{
id
:
number
})
=>
{
return
{
status
:
true
,
errorMessage
:
null
,
id
:
response
.
id
};
}),
catchError
((
error
:
HttpErrorResponse
)
=>
{
console
.
error
(
error
);
return
of
({
status
:
false
,
errorMessage
:
error
.
error
.
detail
,
id
:
null
})
})
);
}
getBySerialNumber
(
serialNumber
:
string
):
Observable
<
{
status
:
boolean
,
errorMessage
:
string
|
null
,
employeeData
:
EmployeeData
|
null
}
>
{
const
body
=
{
serialNumber
:
serialNumber
.
toString
()};
return
this
.
http
.
post
<
EmployeeData
>
(
`
${
this
.
EMPLOYEES_ENDPOINT
}
/SerialNumber`
,
body
)
.
pipe
(
map
((
response
:
EmployeeData
)
=>
{
return
{
status
:
true
,
errorMessage
:
null
,
employeeData
:
response
};
}),
catchError
((
error
:
HttpErrorResponse
)
=>
{
return
of
({
status
:
false
,
errorMessage
:
error
.
error
.
detail
,
employeeData
:
null
});
})
);
}
getById
(
id
:
number
):
Observable
<
{
status
:
boolean
,
errorMessage
:
string
|
null
,
employeeData
:
EmployeeData
|
null
}
>
{
return
this
.
http
.
get
<
EmployeeData
>
(
`
${
this
.
EMPLOYEES_ENDPOINT
}
/
${
id
}
`
,)
.
pipe
(
map
((
response
:
EmployeeData
)
=>
{
return
{
status
:
true
,
errorMessage
:
null
,
employeeData
:
response
};
}),
catchError
((
error
:
HttpErrorResponse
)
=>
{
return
of
({
status
:
false
,
errorMessage
:
error
.
error
.
detail
,
employeeData
:
null
});
})
);
}
}
Clinics.Frontend/src/app/services/waitingList/waiting-list.service.ts
0 → 100644
View file @
a8c67c7a
import
{
Injectable
}
from
'@angular/core'
;
import
*
as
config
from
'../../../../config'
import
{
catchError
,
map
,
Observable
,
of
}
from
'rxjs'
;
import
{
WaitingListRecord
}
from
'../../classes/waitingList/waiting-list-record'
;
import
{
HttpClient
,
HttpErrorResponse
}
from
'@angular/common/http'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
WaitingListService
{
constructor
(
private
http
:
HttpClient
)
{}
private
readonly
WAITINGLIST_ENDPOINT
:
string
=
`
${
config
.
apiUrl
}
/WaitingList`
;
public
getAll
():
Observable
<
WaitingListRecord
[]
|
null
>
{
return
this
.
http
.
get
<
{
waitingListRecords
:
WaitingListRecord
[]}
>
(
this
.
WAITINGLIST_ENDPOINT
)
.
pipe
(
map
((
response
:
{
waitingListRecords
:
WaitingListRecord
[]})
=>
{
return
response
.
waitingListRecords
;
}),
catchError
((
error
:
HttpErrorResponse
)
=>
{
console
.
error
(
error
.
error
.
detail
);
return
of
(
null
);
})
);
}
public
delete
(
id
:
number
):
Observable
<
{
status
:
boolean
,
errorMessage
:
string
|
null
}
>
{
return
this
.
http
.
delete
(
`
${
this
.
WAITINGLIST_ENDPOINT
}
/
${
id
}
`
)
.
pipe
(
map
((
_
=>
{
return
{
status
:
true
,
errorMessage
:
null
}
})),
catchError
((
error
:
HttpErrorResponse
)
=>
{
console
.
error
(
error
.
error
.
detail
)
return
of
(
{
status
:
false
,
errorMessage
:
error
.
error
.
detail
}
)
})
);
}
public
createBySerialNumber
(
serialNumber
:
string
)
:
Observable
<
{
status
:
boolean
,
errorMessage
:
string
|
null
}
>
{
return
this
.
http
.
post
(
this
.
WAITINGLIST_ENDPOINT
,
{
serialNumber
:
serialNumber
.
toString
()})
.
pipe
(
map
(
_
=>
{
return
{
status
:
true
,
errorMessage
:
null
}
}),
catchError
((
error
:
HttpErrorResponse
)
=>
{
return
of
(
{
status
:
false
,
errorMessage
:
error
.
error
.
detail
}
)
})
);
}
}
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