/// <summary>
        /// 操作规则说明
        /// </summary>
        /// <param name="ruleDescriptionDTO"></param>
        /// <returns></returns>
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UseRuleDescriptionExt(Jinher.AMP.BTP.Deploy.CustomDTO.RuleDescriptionDTO ruleDescriptionDTO)
        {
            Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO result = new ResultDTO();
            try
            {
                ContextSession contextSession = ContextFactory.CurrentThreadContext;


                var query = RuleDescription.ObjectSet().Where(q => q.Id == ruleDescriptionDTO.Id).FirstOrDefault();
                if (query == null)
                {
                    RuleDescription rd = new RuleDescription();
                    rd.Id          = ruleDescriptionDTO.Id;
                    rd.Description = ruleDescriptionDTO.Description;
                    rd.AppId       = ruleDescriptionDTO.appId;
                    rd.EntityState = EntityState.Added;
                    contextSession.SaveObject(rd);
                }
                else
                {
                    query.Description = ruleDescriptionDTO.Description;
                    query.EntityState = EntityState.Modified;
                    contextSession.SaveObject(query);
                }
                int num = contextSession.SaveChanges();
                if (num > 0)
                {
                    result.ResultCode = 0;
                    result.Message    = "成功";
                    return(result);
                }
                else
                {
                    result.ResultCode = 1;
                    result.Message    = "失败";
                    return(result);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("操作规则说明UserRedEnvelopeSV-UseRuleDescriptionExt,参数ruleDescriptionDTO:{0}", JsonHelper.JsonSerializer(ruleDescriptionDTO)), ex);
                result.ResultCode = 1;
                result.Message    = ex.Message;
                return(result);
            }
        }
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UseRuleDescription(Jinher.AMP.BTP.Deploy.CustomDTO.RuleDescriptionDTO ruleDescriptionDTO)
        {
            //定义返回值
            Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO result;

            try
            {
                //调用代理方法
                result = base.Channel.UseRuleDescription(ruleDescriptionDTO);
            }
            catch
            {
                //抛异常
                throw;
            }
            finally
            {
                //关链接
                ChannelClose();
            }            //返回结果
            return(result);
        }
Example #3
0
 public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UseRuleDescription(Jinher.AMP.BTP.Deploy.CustomDTO.RuleDescriptionDTO ruleDescriptionDTO)
 {
     base.Do(false);
     return(this.UseRuleDescriptionExt(ruleDescriptionDTO));
 }
 public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UseRuleDescription(Jinher.AMP.BTP.Deploy.CustomDTO.RuleDescriptionDTO ruleDescriptionDTO)
 {
     base.Do();
     return(this.Command.UseRuleDescription(ruleDescriptionDTO));
 }