//遍历绑定后的记录
for (int i = 0; i < dt.Rows.Count;i++)
{
//取得权限字符串
string value = dt.Rows[i]["food_powerString"].ToString();
char[] ps = value.ToCharArray();
//管理权限是否可用
if (ps[6] == '1')
{
//管理勾选
CheckBox ch = (CheckBox)gv_userall.Rows[i].Cells[6].FindControl("cbx_Mana");
ch.Checked = true;
}
//成本核算是否可用
if (ps[7] == '1')
{
//成本核算勾选
CheckBox ch = (CheckBox)gv_userall.Rows[i].Cells[4].FindControl("cbx_Costing");
ch.Checked = true;
}
if (ps[8] == '1')
{
//打印权限勾选
CheckBox ch = (CheckBox)gv_userall.Rows[i].Cells[5].FindControl("cbx_Print");
ch.Checked = true;
}
if (ps[9] == '1')
{
//配餐权限
CheckBox ch = (CheckBox)gv_userall.Rows[i].Cells[3].FindControl("cbx_Catering");
ch.Checked = true;
}
}