嗨我有一个id为usertypeId的表,managerId,SupervisorId n代表id ..
当perticuler用户登录时.. 假设经理然后它将显示与经理相关的数据。 当我们要删除数据时,登录用户不会被删除,但是当假设superviosr被删除时,其相关数据就像 代表被删除..
这是我的代码:
if (Session["UserTypeId"].ToString() == "2")
{
DataTable dt1 = new BALUserProfile().SelectForGridManager(
new BOLUserProfile() { Id = int.Parse(Session["UserId"].ToString()),
ManagerId = int.Parse(Session["UserId"].ToString()) });
for (int i = 0; i < dt1.Rows.Count; i++)
{
if (dt1.Rows[i]["Id"].ToString() == Session["UserId"].ToString() &&
lblGUserTypeId1.ToString() == "2")
{
lblMessageGrid.Visible = true;
lblMessageGrid.Text = "Data Can Not Be Delete";
}
else
{
//ObjBOL.Id = int.Parse(dt1.Rows[i]["Id"].ToString());
//ObjBOL1.Id = int.Parse(dt1.Rows[i]["Id"].ToString());
ObjBAL.Delete(ObjBOL);
ObjBAL1.Delete(ObjBOL1);
}
}
} //this was missing
你知道但是谢谢......