Ejemplo n.º 1
0
 public void DeleteRule(PolicyId policyId, RuleId ruleId)
 {
     using (var scope = new TransactionScope())
     {
         var policy = policyRep.GetRuleBasePolicyById(policyId);
         var rule   = ruleService.GetById(ruleId);
         policy.RemoveRule(rule);
         ruleService.DeleteRule(ruleId);
         scope.Complete();
     }
 }
Ejemplo n.º 2
0
 public void Delete(int IdRule)
 {
     try
     {
         _ruleService.DeleteRule(IdRule);
     }
     catch (Exception e)
     {
         string message = e.Message;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        ///  删除角色
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// Author  : Napoleon
        /// Created : 2015-01-27 16:42:22
        public ActionResult DeleteRule(string id)
        {
            int    count = _ruleService.DeleteRule(id);
            string status = "failue", msg, json;

            switch (count)
            {
            case -1:
                msg = "删除失败,请先删除对应父节点!";
                break;

            case 1:
                status = "success";
                msg    = "删除成功!";
                break;

            default:
                msg = "删除失败!";
                break;
            }
            json = PublicFunc.ModelToJson(status, msg);
            return(Content(json));
        }
Ejemplo n.º 4
0
 public bool Delete(int id)
 {
     return(_ruleService.DeleteRule(id));
 }