Ideas or direction needed for approval path

G

Guest

I have this .NET web project that I will need to create web forms that will
allow employees to request personnel actions (for example, request for
vacation time). Depending on what department the employee is in determines
who approvals the vacation time and what paths it follows to get approved.
It could go up to three levels before the vacation time is finally approved.

I guess my problem is that I do not really know where to start with this or
what I should be looking at to get a solution. I am looking for ideas, web
sites, or anything that could get me going in the right direction. I have
looked at the design pattern called Chain of Responsibility, but I think this
is not going to work for me. I have also looked at controlling this all in a
database giving each request an ID number related to a person to approve ID
number. I need this stuff to be scalable.

This is the process that an employee would go through to get vacation time
approved. The employee would log in to a web site and click on a menu that
would display a web form that would ask them about the dates they need to
take off. The employee would then click on a "submit" button.

After the employee clicks on the "submit" button the request will then go to
their supervisor (the supervisor will be notified by e-mail about this
request). The supervisor will then log in to the same web site that the
employee did and will be able to see this request. The supervisor will be
able to approve or reject the request. If the request is approved the
request will go to the supervisor's supervisor for approval. If rejected the
request will go back to the employee with a reason why it was rejected.

After the last supervisor has approved the request, the request will be sent
back to the employee, telling the employee that their request has been
accepted.

Thanks for any help,
Charles
 
R

Rob R. Ainscough

Note to self, don't work for this company.

Sounds like an internal application -- I'd go with a Windows Form app and
clickonce deployment via companies internal web site. You'll be able to
produce the app a lot faster via Windows Form and you will have much more
user interface flexibility -- the only requirement is that everyone on the
network have Windows OS.

Definitely a state model with parent/child relationships.
 
K

Kevin Spencer

Hi Charles,

Sounds like a tough set of requirements. The first thing I would ask is, how
is the organizational hierarchy of your organization currently stored? It
must be stored somewhere. If it is already stored in a database of one sort
or another, you have something to start with. However, the organizational
hierarchy may or may not be related to the hierarchy of the approval
process.

At any rate, we are talking about a hierarchy, a tree of personnel, correct?
I would start with a database of personnel. Each person would have a unique
identifier in the database. As each person only has one person to whom that
person is immediately responsible, you would have a foreign key field in
that record that holds the id of their "boss." The table is then related to
itself. This can get complicated, but as long as you have only one person to
whom a person is immediately responsible, it should be fine. Otherwise, you
have to use a much more complex solution.

So, assuming that each person only has to pass their request to one person
"upstream" you can start with a fairly simple table structure. Example:

Person:
[id] [int] IDENTITY (1, 1) NOT NULL
[parentid] [int] NULL
[name] [varchar] (50) NOT NULL

Example
id parentid name
-------------------------
1 NULL Joe <-----the big cheese
2 1 Bob
3 1 Judy
4 1 Bill
5 2 Fred
6 2 Mary
7 3 Sam
8 6 Job
9 6 Pop
10 8 Harry

Every person in the organization would go into this table. To identify the
next person "up the ladder" you would run a query like so:

select name, id from person where id =
(select parentid from person where id = 5)

name id
-----------
Bob 2

When you get no resulting records, you've reached "the top of the heap."

You can also find out who is immediatly below a given person:

select name, id from person where parentid = 1

name id
------------
Bob 2
Judy 3
Bill 4

And you can find out who the "siblings" of a person are:

select name, id from person where parentid =
(select parentid from person where id = 4)

name id
------------
Bob 2
Judy 3
Bill 4

In any case, you should get the idea.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top