Exemplo n.º 1
0
 public void Enable(string ids, bool isEnable)
 {
     using (TransactionScope scope = new TransactionScope())
     {
         string   newids    = ids.Substring(0, ids.Length - 1);
         string[] moduleids = newids.Split('|');
         foreach (var id in moduleids)
         {
             _repository.Enable(int.Parse(id), isEnable);
         }
         unitOfWork.Commit();
         string mes = "管理员";
         if (isEnable)
         {
             mes += "启用";
         }
         else
         {
             mes += "禁用";
         }
         _adminLogService.Log(mes, "操作ID:" + ids);
         scope.Complete();
     }
 }