Hello all! I would like to discuss an application scenario so that I, later, will be able to properly identify issue I am facing. The reason I am doing this on a WinApp is that ASP.NET scheduler turned out to be restricted and could not cope with the huge list of Resource and massive number of appointments.
The scenario is as follows:
- I require showing Jobs on a scheduler
- A job has the following characteristics: It is only one day long
- A resource (Locum (worker), in my case) can have a maximum of two jobs per day. A job has a ShiftType (Shift 1 and Shift 2). Therefore, a job’s StartTime can be (Date) + 8:00AM and EndTime be (Date) + 4:00PM. A field named JobShiftTypeID decided the shift. There are three values at current: None, Shift 1, and Shift 2. I’d like to custom paint (backgroung color/gradient) a job based upon this value
- A job will never extend beyond 24 hours
- Similarly, a job’s job date cannot be changed. Therefore, a job for 21-Dec-2010 will only move from one resource to another but cannot move from one date to another (Disable horizontal drag-drop). If a Job is dragged from Worker A to Worker B, then there first is required a few checks to see if the job can actually be allotted to Worker B. If not, there will be no change but a MessageBox will inform the user that the move is invalid. All this can be done through an event
- A job can be of different types and LocumTypeID indicates the current. I’d like the job have a custom paint (an image) based upon this field’s value
- A job has different states and JobStatusID indicates the current. Displaying an icon over the job is desired
- Jobs are created through a well defined process and doesn’t require a scheduler. Once a job is ready for booking, the system takes each of the ready for booking job and goes through a heavy process of selecting most preferred work for it and places the result set in a temporary JobBooking table
- Job and JobBooking has a one-to-one relation
- The LINQ that shall feed the scheduler will fetch data through a query that’ll bring forth fields from both tables with the Job ID as the unique identifier
- Since there is a certain amount of rules to go through upon performing and job switching, canceling, deletion etc, all operations to persists data to the DB need to hand-coded manually and the scheduler cannot be automatic in that regard
- LINQ to SQL is used as the Data access Layer and there needs to be a way to bind the scheduler with LINQ data source or SchedularDataSource should be fed with LINQ
- The field in JobBooking named LocumID is the common field between Locums (coming from Locum table as the primary resource) and will help place the job card against correct locum (resource)
CREATE
TABLE
[dbo].[Job]
(
[OID] [
bigint
] IDENTITY(1, 1)
NOT
NULL
,
[BatchID] [
varchar
](250)
NOT
NULL
,
[PharmacyID] [
bigint
]
NOT
NULL
,
[BranchID] [
bigint
]
NOT
NULL
,
[PharmacyCoordinatorID] [
bigint
]
NOT
NULL
,
[LocumTypeID] [
int
]
NOT
NULL
,
[JobShiftTypeID] [
int
]
NOT
NULL
,
[JobDate] [smalldatetime]
NOT
NULL
,
[Rate] [money]
NOT
NULL
,
[RatePlus] [money]
NOT
NULL
,
[StartTime] [smalldatetime]
NOT
NULL
,
[EndTime] [smalldatetime]
NOT
NULL
,
[PriorityID] [tinyint]
NOT
NULL
,
[JobCode] [
varchar
](100)
NOT
NULL
,
[JobStatusID] [
int
]
NOT
NULL
,
[UserID] [
bigint
]
NOT
NULL
,
[RegisteredDate] [smalldatetime]
NOT
NULL
,
[LastModifiedAt] [
timestamp
]
NOT
NULL
,
CONSTRAINT
[PK__Jobs__056690C222951AFD]
PRIMARY
KEY
CLUSTERED ([OID]
ASC
)
WITH
(PAD_INDEX =
OFF
, STATISTICS_NORECOMPUTE =
OFF
, IGNORE_DUP_KEY =
OFF
, ALLOW_ROW_LOCKS =
ON
, ALLOW_PAGE_LOCKS =
ON
)
ON
[
PRIMARY
]
)
ON
[
PRIMARY
]
Job Booking Table structure:
CREATE
TABLE
[dbo].[JobBooking](
[OID] [
bigint
] IDENTITY(1,1)
NOT
NULL
,
[LocumID] [
bigint
]
NOT
NULL
,
[JobID] [
bigint
]
NOT
NULL
,
[BookingTime] [smalldatetime]
NOT
NULL
,
[LastModifiedAt] [
timestamp
]
NOT
NULL
,
CONSTRAINT
[PK__Bookings__73951AED4AA30C57]
PRIMARY
KEY
CLUSTERED
(
[OID]
ASC
)
WITH
(PAD_INDEX =
OFF
, STATISTICS_NORECOMPUTE =
OFF
, IGNORE_DUP_KEY =
OFF
, ALLOW_ROW_LOCKS =
ON
, ALLOW_PAGE_LOCKS =
ON
)
ON
[
PRIMARY
]
)
ON
[
PRIMARY
]
GO
Job Supporting Tables structure:
CREATE
TABLE
[dbo].[JobShiftType]
(
[OID] [
int
] IDENTITY(1, 1)
NOT
NULL
,
[
Name
] [
varchar
](50)
NOT
NULL
,
[LastModifiedAt] [
timestamp
]
NOT
NULL
,
CONSTRAINT
[PK_Shift]
PRIMARY
KEY
CLUSTERED ([OID]
ASC
)
WITH
(PAD_INDEX =
OFF
, STATISTICS_NORECOMPUTE =
OFF
, IGNORE_DUP_KEY =
OFF
, ALLOW_ROW_LOCKS =
ON
, ALLOW_PAGE_LOCKS =
ON
)
ON
[
PRIMARY
]
)
ON
[
PRIMARY
]
GO
SET
IDENTITY_INSERT [dbo].[JobShiftType]
ON
INSERT
[dbo].[JobShiftType] ([OID], [
Name
])
VALUES
(1, N
'None'
)
INSERT
[dbo].[JobShiftType] ([OID], [
Name
])
VALUES
(2, N
'Shift 1'
)
INSERT
[dbo].[JobShiftType] ([OID], [
Name
])
VALUES
(3, N
'Shift 2'
)
SET
IDENTITY_INSERT [dbo].[JobShiftType]
OFF
CREATE
TABLE
[dbo].[LocumType]
(
[OID] [
int
] IDENTITY(1, 1)
NOT
NULL
,
[
Name
] [
varchar
](100)
NOT
NULL
,
[Code] [
varchar
](4)
NOT
NULL
,
[PictureID] [
int
]
NOT
NULL
,
[LastModifiedAt] [
timestamp
]
NOT
NULL
,
CONSTRAINT
[PK__LocumTyp__3776C388173876EA]
PRIMARY
KEY
CLUSTERED ([OID]
ASC
)
WITH
(PAD_INDEX =
OFF
, STATISTICS_NORECOMPUTE =
OFF
, IGNORE_DUP_KEY =
OFF
, ALLOW_ROW_LOCKS =
ON
, ALLOW_PAGE_LOCKS =
ON
)
ON
[
PRIMARY
]
)
ON
[
PRIMARY
]
GO
SET
IDENTITY_INSERT [dbo].[LocumType]
ON
INSERT
[dbo].[LocumType] ([OID], [
Name
], [Code], [PictureID])
VALUES
(1, N
'Type A'
, N
'P '
, 1)
INSERT
[dbo].[LocumType] ([OID], [
Name
], [Code], [PictureID])
VALUES
(2, N
'Type B'
, N
'D '
, 2)
INSERT
[dbo].[LocumType] ([OID], [
Name
], [Code], [PictureID])
VALUES
(3, N
'Type C'
, N
'ACT '
, 3)
SET
IDENTITY_INSERT [dbo].[LocumType]
OFF
CREATE
TABLE
[dbo].[JobStatus]
(
[OID] [
int
] IDENTITY(1, 1)
NOT
NULL
,
[
Name
] [
varchar
](100)
NOT
NULL
,
[Code] [
varchar
](5)
NOT
NULL
,
[PictureID] [
int
]
NOT
NULL
,
[LastModifiedAt] [
timestamp
]
NOT
NULL
,
CONSTRAINT
[PK_JobStatuses]
PRIMARY
KEY
CLUSTERED ([OID]
ASC
)
WITH
(PAD_INDEX =
OFF
, STATISTICS_NORECOMPUTE =
OFF
, IGNORE_DUP_KEY =
OFF
, ALLOW_ROW_LOCKS =
ON
, ALLOW_PAGE_LOCKS =
ON
)
ON
[
PRIMARY
]
)
ON
[
PRIMARY
]
GO
SET
IDENTITY_INSERT [dbo].[JobStatus]
ON
INSERT
[dbo].[JobStatus] ([OID], [
Name
], [Code], [PictureID])
VALUES
(1, N
'Ready to book'
, N
'J_RTB'
, 13)
INSERT
[dbo].[JobStatus] ([OID], [
Name
], [Code], [PictureID])
VALUES
(2, N
'Pending'
, N
'J_P'
, 14)
INSERT
[dbo].[JobStatus] ([OID], [
Name
], [Code], [PictureID])
VALUES
(3, N
'Booked'
, N
'J_B'
, 15)
INSERT
[dbo].[JobStatus] ([OID], [
Name
], [Code], [PictureID])
VALUES
(4, N
'Cancelled'
, N
'J_CAN'
, 16)
INSERT
[dbo].[JobStatus] ([OID], [
Name
], [Code], [PictureID])
VALUES
(6, N
'CallBack'
, N
'J_CAL'
, 17)
SET
IDENTITY_INSERT [dbo].[JobStatus]
OFF
Here are the actions that are required:
- Be able to limit the scheduler (From 01-Jan-2009 to any specified date)
- The date format needs to be dd-MMM-yyyy everywhere
- The culture required is System.Globalization.CultureInfo("en-GB") everywhere
- User be able to drag a job (appointment) only vertically
- User be able to drag multiple-selected jobs (appointment) only vertically
- A job cannot be stretched in any direction
- For a Locum (resource), there can be a maximum of two jobs per day
- Double clicking a job needs to show a custom dialog as user need not modify different aspects of a job except it’s resource (Locum)
- The scheduler is only limited to TimeLine view grouped by Resource (Locums)
- The jobs never have any kind of recurrence
- Need to customize the context menu displayed on jobs and empty time slots
- Need to control the number of day-slots displayed in the timeline view
- Need to show a tooltip with a lot of job related info. The tooltip will show job related stuff like rates and job location and the coordinator to hail. I suppose that these fields, though not related to the scheduler, will still be available in the array of data items. I do know the appointment class is customizable
Waiting for a response.
Thanks.