コード例 #1
0
        /// <summary>
        /// 根据微信公众号ID获取关注回复
        /// </summary>
        /// <param name="sWeChatId"></param>
        /// <returns></returns>
        public override ES_WeChatConcern Get(string sWeChatId)
        {
            var concern = query.SingleQuery <ES_WeChatConcern>(@"select * from ES_WeChatConcern where sWeChatId=@sWeChatId", new { sWeChatId = sWeChatId });

            if (concern == null)
            {
                concern = new ES_WeChatConcern();
            }
            return(concern);
        }
コード例 #2
0
 /// <summary>
 /// 保存关注回复的操作
 /// </summary>
 /// <returns></returns>
 public ActionResult Save(ES_WeChatConcern WeChatConcern)
 {
     if (Request.HttpMethod.ToUpper() == MethodType.GET)
     {
         return(View(Manager.Get(WeChatConcern.sWeChatId)));
     }
     else
     {
         if (Manager.Save(WeChatConcern) > 0)
         {
             result.success = true;
         }
         return(Json(result));
     }
 }
コード例 #3
0
 /// <summary>
 /// 保存关注回复
 /// </summary>
 /// <param name="WeChatConcern"></param>
 /// <returns></returns>
 public override int Save(ES_WeChatConcern WeChatConcern)
 {
     using (var Context = new Entities())
     {
         if (WeChatConcern.ID == Guid.Empty)
         {//添加
             WeChatConcern.ID = GuidHelper.NewGuid();
             Context.Insert <ES_WeChatConcern>(WeChatConcern);
             return(Context.SaveExtendChanges());
         }
         else
         {//编辑
             Context.Update <ES_WeChatConcern>(WeChatConcern);
             var res = Context.SaveExtendChanges();
             return(res);
         }
     }
 }
コード例 #4
0
 /// <summary>
 /// 保存关注回复
 /// </summary>
 /// <param name="WeChatConcern"></param>
 /// <returns></returns>
 public abstract int Save(ES_WeChatConcern WeChatConcern);