当任何用户上传文档然后此文档转到supervsior批准所以当supervsior批准/拒绝此文档时,我希望此特定行不可点击或我想隐藏该行 图片 pic
这里是代码
protected void Button1_Click(object sender, EventArgs e)
{
try
{
string connStr = ConfigurationManager.ConnectionStrings["mydms"].ConnectionString;
SqlConnection mySQLconnection = new SqlConnection(connStr);
string empId = string.Empty;
DataTable dt = new DataTable();
if (mySQLconnection.State == ConnectionState.Closed)
{
mySQLconnection.Open();
for (int i = 0; i < Repeater2.Items.Count; i++)
{
DropDownList DropDownListcontrol = ((DropDownList)Repeater2.Items[i].FindControl("DropDownList4"));
HiddenField DocId = ((HiddenField)Repeater2.Items[i].FindControl("DocId"));
//Label DocId = ((Label)Repeater2.Items[i].FindControl("DocId"));
//Label Label2 = ((Label)Repeater2.Items[i].FindControl("Label2"));
//if (Label2.Text.ToString() != "")
//{
// string emailId = Label2.Text.ToString();
//}
SqlCommand cmd = new SqlCommand("approveddd", mySQLconnection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@DocID", SqlDbType.Int).Value = Convert.ToInt32((DocId.Value));
cmd.Parameters.Add("@ApproveID", SqlDbType.Int).Value = Convert.ToInt32(DropDownListcontrol.SelectedValue);
cmd.Parameters.Add("@ApproveBy", SqlDbType.VarChar, 50).Value = (Session["Login2"]);
cmd.Parameters.Add("@DesigID", SqlDbType.Int).Value = (Session["UserDesignationID"]);
string DocName = ((Label)Repeater2.Items[i].FindControl("DocName")).Text;
string emailId = ((Label)Repeater2.Items[i].FindControl("YourEamil")).Text;
DropDownList dropdownvalue = ((DropDownList)Repeater2.Items[i].FindControl("DropDownList4"));
string approver = Session["Login2"] != null ? Session["Login2"].ToString() : string.Empty;
string Designationn = Session["UserDesignationID"] != null ? Session["UserDesignationID"].ToString() : string.Empty;
string docname = String.Empty;
string emailID = String.Empty;
string dropdownvalues = String.Empty;
if (Session["Login2"] != null)
{
approver = Session["Login2"].ToString();
}
if (Session["UserDesignationID"] != null)
{
Designationn = Session["UserDesignationID"].ToString();
}
if (DocName.ToString() != "")
{
docname = DocName.ToString();
}
else
{
docname = "Unavailable";
}
if (emailId.ToString() != "")
{
emailID = emailId.ToString();
}
else
{
emailID = "Unavailable";
}
if (dropdownvalue.SelectedItem.ToString() != "")
{
dropdownvalues = dropdownvalue.SelectedItem.ToString();
}
else
{
dropdownvalues = "Unavailable";
}
//SendEmailUsingGmail(docname.ToString(), dropdownvalue.ToString(), emailId.ToString());
//SendEmailUsingGmail(DocName.ToString(), emailId.ToString(), dropdownvalue.ToString());
SendEmailUsingGmail(DocName, emailId, dropdownvalues, approver, Designationn);
cmd.ExecuteNonQuery();
Successz.Text = "Documents Approve and Email Successfully Send To Users";
//UPDATE APPPROVEID IN DOCUMENTINFO TABLE
//DMSLIB.Doc myDoc = new DMSLIB.Doc();
//myDoc.MarkDocAs(Convert.ToInt16(DocId.Text), Convert.ToInt32(DropDownListcontrol.SelectedValue));
}
}
else
{
Supvisor.Text = "Error";
}
if (mySQLconnection.State == ConnectionState.Open)
{
mySQLconnection.Close();
}
}
catch
{
Supvisor.Text = "Already Approved";
}
}