Currently, the user can request for a service and submit the form, and then this form should have “manager approval”. After submitting the form both user& manager can view it from
“Ticket History page”, but the manager should see “Edit” button which should be
hidden from the user. After clicking on the edit button the approval section should appear in the same page to accept or reject the request. In addition, he should be able to click the edit button onetime only then it should be hidden again. (So that
he can’t change the approval status again)
How can I hide the edit button form the user and show it for the manager? How can I show the approval section by clicking on the edit button, and hide it again once he approve/reject
the request?
You must be saving approve or reject status in database.
Keep the defaul value of Status column in database as 0.
When manager clicks Approve, insert 1 in the status column of the database and if manager clicks Reject, insert 2 in the status column in the database
Get the data from the database and check whether the status is 0 or not, if you get 0 data from status column in database, show the Edit button otherwise don't show.
Please mark it as answer if it resolves the issue.
sheikha
Member
11 Points
110 Posts
Edit button
May 22, 2009 08:09 AM|LINK
Hi all,
Currently, the user can request for a service and submit the form, and then this form should have “manager approval”. After submitting the form both user& manager can view it from “Ticket History page”, but the manager should see “Edit” button which should be hidden from the user. After clicking on the edit button the approval section should appear in the same page to accept or reject the request. In addition, he should be able to click the edit button onetime only then it should be hidden again. (So that he can’t change the approval status again)
How can I hide the edit button form the user and show it for the manager? How can I show the approval section by clicking on the edit button, and hide it again once he approve/reject the request?
Note: I am using ASP.Net 2.0, VB languageI really need your help J
Waiting for replies...
sumitd
Star
12168 Points
2151 Posts
Re: Edit button
May 22, 2009 09:57 AM|LINK
{
//Code to get the managerinforamtion
if(Manager)
{
Session["Manager"] = "Yes";
}
else
{
Session["Manager"] = "No";
}
}
Now whereever you want to check any action based on the role, you can put below code
if(Session["Manager"] != null)
{
if(Session["Manager"].ToString().Equals("Yes"))
{
//Code to hide button or take other action
}
}
now whereever you
Visit: www.msblogdirectory.com
www.dotnetspeaks.com
sheikha
Member
11 Points
110 Posts
Re: Edit button
May 22, 2009 12:05 PM|LINK
Hi sumitd,
Thanks a lot, it worked fine with me, [Yes]
But how can I hide the edit button again once the manager approve or reject the request?
For example, if the manager tried to enter the same request again, and he already approved it or rejected it , I want the edit button to be hidden.
Can someone help me??
sumitd
Star
12168 Points
2151 Posts
Re: Edit button
May 22, 2009 03:43 PM|LINK
You must be saving approve or reject status in database.
Keep the defaul value of Status column in database as 0.
When manager clicks Approve, insert 1 in the status column of the database and if manager clicks Reject, insert 2 in the status column in the database
Get the data from the database and check whether the status is 0 or not, if you get 0 data from status column in database, show the Edit button otherwise don't show.
Visit: www.msblogdirectory.com
www.dotnetspeaks.com