Esempio n. 1
0
    private void VierPermissionCateID()
    {
        CateNewsPermissionBSO cateNewsPermissionBSO = new CateNewsPermissionBSO();
        CateNewsPermission    cateNewsPermission    = new CateNewsPermission();

        foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items)
        {
            CheckBox chkId = (CheckBox)dataItem.FindControl("chkId");

            if (cateNewsPermissionBSO.CheckExitPermission(Convert.ToInt32(hddRoles_ID.Value), Convert.ToInt32(dataItem["CateNewsID"].Text)))
            {
                chkId.Checked = true;
            }
        }
    }
    private void VierPermissionID()
    {
        //PermissionBSO permissionBSO = new PermissionBSO();
        //DataTable table = permissionBSO.GetPermissionAll();
        //DataView dataView = new DataView(table);
        //dataView.Sort = "PermissionID ASC";
        //DataTable dataTable = dataView.ToTable();
        //commonBSO commonBSO = new commonBSO();

        CateNewsPermissionBSO cateNewsPermissionBSO = new CateNewsPermissionBSO();
        CateNewsPermission    cateNewsPermission    = new CateNewsPermission();

        foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items)
        {
            //CheckBoxList chklist = (CheckBoxList)dataItem.FindControl("chklist");
            CheckBox chkId = (CheckBox)dataItem.FindControl("chkId");

            //commonBSO.FillToCheckBoxList(chklist, dataTable, "PermissionName", "Value");

            if (cateNewsPermissionBSO.CheckExitPermission(Convert.ToInt32(hddRoles.Value), Convert.ToInt32(dataItem["CateNewsID"].Text)))
            {
                //Permission
                //cateNewsPermission = cateNewsPermissionBSO.GetCateNewsPermission(Convert.ToInt32(hddRoles.Value), Convert.ToInt32(dataItem["CateNewsID"].Text));

                //if (cateNewsPermission != null)
                //{
                //    string sPermission = cateNewsPermission.Permission;
                //    if (!sPermission.Equals(""))
                //    {
                //        string[] sSlip = sPermission.Split(new char[] { ',' });
                //        foreach (string s in sSlip)
                //        {
                //            foreach (ListItem items in chklist.Items)
                //            {
                //                if (items.Value == s)
                //                    items.Selected = true;
                //            }
                //        }
                //    }
                //}

                //CateID
                chkId.Checked = true;
            }
        }
    }