Esempio n. 1
0
 protected void EgvSpecial_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         SpecialTree dataItem = (SpecialTree)e.Row.DataItem;
         Label       label    = (Label)e.Row.FindControl("LabName");
         CheckBox    box      = (CheckBox)e.Row.FindControl("ChkSpecialInput");
         CheckBox    box2     = (CheckBox)e.Row.FindControl("ChkSpecialManage");
         HiddenField field    = (HiddenField)e.Row.FindControl("HdnSpecialId");
         if (dataItem != null)
         {
             label.Text = Special.TreeLine(dataItem.TreeLineType) + dataItem.Name;
             if (dataItem.IsSpecialCategory)
             {
                 field.Value  = "0";
                 box.Visible  = false;
                 box2.Visible = false;
             }
             else
             {
                 field.Value = dataItem.Id.ToString();
             }
             if (!dataItem.IsSpecialCategory)
             {
                 if (dataItem.Id == -1)
                 {
                     this.m_inputSpecialId  = box.ClientID;
                     this.m_manageSpecialId = box2.ClientID;
                     box.Attributes.Add("onclick", "ChkSpecialAll(this.form,'" + box.ID + "'," + this.m_inputSpecialId + ")");
                     box2.Attributes.Add("onclick", "ChkSpecialAll(this.form,'" + box2.ID + "'," + this.m_manageSpecialId + ")");
                 }
                 else
                 {
                     box.Attributes.Add("onclick", "ChkWipeOffSpecialAll(" + this.m_inputSpecialId + ")");
                     box2.Attributes.Add("onclick", "ChkWipeOffSpecialAll(" + this.m_manageSpecialId + ")");
                 }
                 IList <RoleSpecialPermissionsInfo> specialPermissionsByRoleId = RolePermissions.GetSpecialPermissionsByRoleId(this.m_RoleId, OperateCode.SpecialContentInput);
                 IList <RoleSpecialPermissionsInfo> list2 = RolePermissions.GetSpecialPermissionsByRoleId(this.m_RoleId, OperateCode.SepcialContentManage);
                 foreach (RoleSpecialPermissionsInfo info in specialPermissionsByRoleId)
                 {
                     if (info.SpecialId == DataConverter.CLng(field.Value))
                     {
                         if (dataItem.Id == -1)
                         {
                             this.m_inputSpecialAll = true;
                             box.Checked            = true;
                         }
                         else if (!this.m_inputSpecialAll)
                         {
                             box.Checked = true;
                         }
                     }
                 }
                 foreach (RoleSpecialPermissionsInfo info2 in list2)
                 {
                     if (info2.SpecialId == DataConverter.CLng(field.Value))
                     {
                         if (dataItem.Id == -1)
                         {
                             this.m_manageSpecialAll = true;
                             box2.Checked            = true;
                         }
                         else if (!this.m_manageSpecialAll)
                         {
                             box2.Checked = true;
                         }
                     }
                 }
             }
         }
     }
 }