日期:2014-05-17 浏览次数:20453 次
protected void gvDepartMain_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow)//判断行类型 { string gvId = GridView1.DataKeys[e.Row.RowIndex].Value.ToString();//得到部门id DepartInfo ev = DepartManager.GetDepartByID(gvId); UserInfo user = (UserInfo)Session["CurrentUser"]; string userdepar=ev.IDepartID.Substring(0, 2); if (userdepar ==user.Depaer) { e.Row.Cells[0].Text = ev.VcDepartName; e.Row.Cells[1].Text=ev.DepaerOpp } else { e.Row.Visible = false; } } }