Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing Online Attendance System.
Now I want that when a user Login and fill the first date attendance and click on the Button then Button is disable on the .aspx Page because I want that he did not
changed it.

I have done it but the Problem is:--

When the second user Login then that Button will see the disable so how he fill
the attendance of first Date?

Now I want :------
When the second user Login and fill the first date attendance then that Button is not disable on the same .aspx Page.

So How it is possible? If you have any solution, Please tell me.

It is possible or not.If it is not possible then How to make a Online Attendace System.
Posted

Maintain the session for the users and based on the session value set the button's enabled property from code.

Sessions are seperate for different users so there will not be confliction.

e.g.

Session["Allow"]="Yes" for user1 and Session["Allow"]="No" for user2


Now check the session value in code and set button's enabled property to true or false.


You can set Session["Allow"] value on user's login as per the permission whether he is allowed to insert record or not.
 
Share this answer
 
v2
Dear Shukla Pawan,

This is logic part.
So when the user want to go for attendance, in the page load you need to check weather he posted attendance or not, based on the status of attendance you have to do disable or enable the attendance post button.


Thanks
 
Share this answer
 
Hello Shukla Pawan

Just maintain a seperate column in database table.

When first user gives attanedance then just insert some value in table.
And if again that user give attendance then check previous value.

If he has given the attendance then disable the button.

You can check this condition on page load event or button click event.

This is only a logical part.....
 
Share this answer
 
Oh shukla ji
What is Your Table Structure where you save attendence data
it should be like this..

Table: tblatt

userid int
dayid int

when user1 login and add attendence then
add row with
SQL
userid   dayid
1         1
2         1
3         1
1         2
2         2

now in above table and data
if user1 login on 2nd day then check that ..

SQL
select count(*) ct from tblatt where userid=1 and dayid=2


then result is

SQL
ct
1


datatable returns 1 row then you should disable button and if
user3 login then result of above query
SQL
select count(*) ct from tblatt where userid=3 and dayid=2

is

SQL
ct


i.e. blank. no row given by database
then enable button
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900