一旦批准,然后禁用 [英] once approved then disable

查看:174
本文介绍了一旦批准,然后禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了当管理员再次批准文件时批准/拒绝文件,然后当管理员再次登录时他/她一旦批准就无法批准/拒绝文件...
我是怎么做到的?
这是提交按钮的代码

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

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";
               }
           }

推荐答案

应用条件逻辑.检查此样本

使用ASP.NET GridView的条件绑定表达式 [ ^ ]
Apply conditional logic. Check this sample

Conditional Binding Expression with ASP.NET GridView[^]


报价:

在数据库中添加一个字段(IsApproved),并将位0设置为未批准,将1设置为1对于批准,如果管理员批准将位从0设置为1,并且在登录agian时使用,请检查该位是否为1,然后禁用对批准文档的其他明智启用.

我认为它将帮助您解决问题

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


这篇关于一旦批准,然后禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆