Break and Resume?

R

Ron

Hi all:

I have an asp.net (using SQLserver) page in a class registration
application where a supervisor can register for multiple employees.
If there are no errors, duplicates the program flows like this:

USER - 1. Select Class, 2. Select Employees, 3. Confirm
BACK-END - For each employee:

1. Validate-->Has the employee registered already(pending)? or Has the
employee registered and cancelled already(cancelled)?
2. Add name to label.
3. Show the label, "Joe Schmo and Jane Schmo have been registered for
ASP.NET"


If there is an error and 'Validate' comes back as pending or
cancelled. I want the app. to break and either:
A) inform the user that the employee is already enrolled, or
B) allow the user to 'uncancel' the employee, respectively

and then resume resigistering the rest of the employees. The breaking
and resuming is where I need the guidance I guess. I hope this makes
sense. If not, I will repost w/ code instead. Thanks.
--Ron
 
P

Patrice

Try to repost and say directly what is the exact problem you ran into. My
guess it that you have no answer as you ask for general guidance rather than
exposing the exact point you have a problem with...

As a side note do you have to do this ? If you can't enroll employees that
are already enrolled just don't allow to select them...

Patrice
 
K

Kevin Spencer

I count exactly TWO question marks in your original post:

So, I suppose the answer to your repost question is not "Stupid question"
but "No question."

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
R

Ron Bell

Thanks, Kevin, for taking the time to count my question marks. But if
you took the time to read the post instead of counting ??s then you
would see where I 'ask' my question:

"The breaking and resuming is where I need the guidance I guess."

Maybe I should rephrase:

Is there a way to break from your code to wait for user input, perform
code reactive to the users input and then resume the original code??????
(<--6)

Please let me know if I am not being clear.
 
P

Patrice

I'm still not sure to fully understand the question.

What about displaying a page with problems and asking for solutions and when
the user clicks, you perform the whole process accordingly ???!!!! IMO the
bad reasoning is to try to interleave processing and asking for user input
"on the fly" ?

Generally it's best to ask beforehand for all questions you may have and
then start the process with the whole information (even from a usability
point of view)...

Or do I miss something ?

Patrice
 
R

Ron Bell

No Patrice, actually that makes a lot of sense. I'll see how I can make
that work. Thanks a lot.

--Ron
 
K

Kevin Spencer

Hi Ron,
Please let me know if I am not being clear.

You WERE not being clear. You now are.
Thanks, Kevin, for taking the time to count my question marks. But if
you took the time to read the post instead of counting ??s then you
would see where I 'ask' my question:

What I took time to do was not to count your question marks, but to
communicate to you what was wrong with your post. One major key to solving a
problem is to first be able to state the exact nature of the problem. In
other words, the quality of an answer depends largely upon the quality of
the question. Ever played 20 questions? Same principle.

You did NOT ask a question. A key to effective communication is to think
about how others will perceive what you say. While you certainly know
exactly what you're looking for, the rest of us live in other parts of the
world, and have no knowledge of you or your situation.
"The breaking and resuming is where I need the guidance I guess."

This is not a question, nor does it adequately describe any problem that you
are having. It is a generalized statement. If you can't describe what you're
looking for, how can we help you find it?
Is there a way to break from your code to wait for user input, perform
code reactive to the users input and then resume the original code??????

THAT is a question, which I am now happy to answer.

An interactive application, such as a WebForm, has 2 distinct elements that
comprise its behavior: Input and Output. Output is how the application
responds to Input. Input is of course, actions taken by the user. In an
ASP.Net application, Input is processed when a Request is recieved by the
server. Output is the HTML document that the server returns to the client.
PostBacks transmit input from the user to the server for processing. The
Response object provides the output.

You can visualize an application as a series of transactions, in which the
user inputs data, and then waits for the app to respond with output.
Similarly, the app responds to input by creating output, and then waits for
the user to respond with more input. So, in fact, what you describe as
"break from your code to wait for user input" is already occurring. It
occurs every time the server sends a Response to the client. It then waits
for more input.
If there is an error and 'Validate' comes back as pending or
cancelled. I want the app. to break and either:
A) inform the user that the employee is already enrolled, or
B) allow the user to 'uncancel' the employee, respectively

When you say "'Validate' comes back" you are describing input. The user has
finished filling out a form, and posted it, thereby sending input via the
Request object. No need to "break." Just respond with output telling the
user to fix the problem with their input. Once the user responds with
corected input, the app continues on its merry way.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
K

Kevin Spencer

BTW, Ron, this thread is a perfect example of what I described. You needed
help, so you fired up your newsreader, and sought out help from somebody. I
was an "application" that responded to your input by outputting that
somethinig was wrong with your input. You read the output and corrected your
error. I then responded to you with the ouput that you desired (I hope). If
not, you will input more information that helps me to adjust my respone
(output) to you. Once we have finished our interaction, hopefully, I (the
"application") will continue listening for requests. In other words,
"resume."

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top