Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i done with approve /reject documents when admin once approved document then when admin again login then he/she not able to approved/reject document when once approved ...
how i done this?
here is the code of submit button
C#
string connStr = ConfigurationManager.ConnectionStrings["mydms"].ConnectionString;
           SqlConnection mySQLconnection = new SqlConnection(connStr);
           if (mySQLconnection.State == ConnectionState.Closed)
           {
               mySQLconnection.Open();
           }
              // DropDownList drdList;
          // SqlCommand mySqlCommand;


           foreach (GridViewRow row in GrdFileApprove.Rows)
           {

               if (row.RowType == DataControlRowType.DataRow)
               {
                   DropDownList DropDownListcontrol = row.FindControl("DropDownList4") as DropDownList;

                   SqlCommand cmd = new SqlCommand("approveddd", mySQLconnection);
                   cmd.CommandType = CommandType.StoredProcedure;





                   cmd.Parameters.Add("@DocID", SqlDbType.Int).Value = Convert.ToInt32((row.Cells[1].Text));

                   cmd.Parameters.Add("@ApproveID", SqlDbType.Int).Value = Convert.ToInt32(DropDownListcontrol.SelectedValue);
                   cmd.Parameters.Add("@ApproveBy", SqlDbType.VarChar, 50).Value = (Session["Login2"]);

                   cmd.ExecuteNonQuery();
               }
               else
               {
                   apfi.Text = "Error";
               }
           }
Posted
Comments
Prasad Khandekar 8-Oct-13 11:52am    
Hello Ayesha,

You are already tagging the approver's id (ApproveBy) use it to filter out those rows which are already approved by the logged in admin.

Regards,
Diya Ayesa 8-Oct-13 11:56am    
how?
MuhammadUSman1 8-Oct-13 23:33pm    
Check my suggestion in solution.

Apply conditional logic. Check this sample

Conditional Binding Expression with ASP.NET GridView[^]
 
Share this answer
 
Comments
Diya Ayesa 8-Oct-13 13:10pm    
or i can hide row when once approved/reject document
thatraja 8-Oct-13 13:17pm    
If you want to hide then you just rebind the Grid with filtered data.
Diya Ayesa 8-Oct-13 13:22pm    
how i done with code?plz give me idea
thatraja 9-Oct-13 3:09am    
Did you check the link in my answer? It's an almost a direct answer
Diya Ayesa 8-Oct-13 13:40pm    
????//
Quote:
Add one field in database (IsApproved) and set bit 0 for not approved and 1 for approved, if admin approved set bit from 0 to 1 and when login agian use check if bit is 1 then disable other wise enable to approved document.

I think it'll help you to solve problem
 
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