protected void btnSave_Click(object sender, EventArgs e)
 {
     if (nFunctionId <= 0 || nUserId <= 0)
         return;
     _InitExistPermission();
     foreach (ListItem cbSel in cbl_Actions.Items)
     {
         int nId = TypeUtil.ParseInt(cbSel.Value, 0);
         if (!cbSel.Enabled || htRoleAction.ContainsKey(nId))
             continue;
         if (!cbSel.Selected && htUserAction.ContainsKey(nId))
         {
             SystemUserActionPermission.Delete(((SystemUserActionPermission)htUserAction[nId]).Id);
         }
         else if (cbSel.Selected && !htUserAction.ContainsKey(nId))
         {
             SystemUserActionPermission oAdd = new SystemUserActionPermission();
             oAdd.ActionId = nId;
             oAdd.UserId = nUserId;
             oAdd.FunctionId = nFunctionId;
             SystemUserActionPermission.Save(oAdd);
         }
     }
     _InitAction();
     PageUtil.PageAlert(this.Page, "保存成功!");
 }
 public static SystemUserActionPermission[] Get(int _nUserId, int _nFunctionId)
 {
     SystemUserActionPermission[] result;
     if (_nUserId <= 0 || _nFunctionId <= 0)
     {
         result = null;
     }
     else
     {
         SystemUserActionPermission oGet = new SystemUserActionPermission();
         oGet.UserId = _nUserId;
         oGet.FunctionId = _nFunctionId;
         result = EntityAccess<SystemUserActionPermission>.Access.List(oGet);
     }
     return result;
 }
 public static int Save(SystemUserActionPermission _Entity)
 {
     int result;
     if (null == _Entity)
     {
         result = -1;
     }
     else
     {
         result = EntityAccess<SystemUserActionPermission>.Access.Save(_Entity);
     }
     return result;
 }