/// <summary> /// 6.1 获取微信墙未读取的数据集合 /// </summary> /// <param name="eventKeyword"></param> /// <returns></returns> public WeixinWallEntity GetWeiXinWall(string eventKeyword) { WeixinWallEntity wallInfo = new WeixinWallEntity(); IList <WeixinWallEntity> wallList = new List <WeixinWallEntity>(); wallInfo.WallsCount = _currentDAO.GetWeiXinWallCount(eventKeyword); if (wallInfo.WallsCount > 0) { DataSet ds = new DataSet(); ds = _currentDAO.GetWeiXinWall(eventKeyword); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { wallList = DataTableToObject.ConvertToList <WeixinWallEntity>(ds.Tables[0]); } wallInfo.WallList = wallList; } return(wallInfo); }
public string getWeixinWallInfo() { string content = string.Empty; var respData = new getWeixinWallInfoRespData(); try { string reqContent = Request["ReqContent"]; Loggers.Debug(new DebugLogInfo() { Message = string.Format("getWeixinWallInfo: {0}", reqContent) }); var reqObj = reqContent.DeserializeJSONTo <getWeixinWallInfoReqData>(); string customerId = reqObj.common.customerId; #region if (customerId == null || customerId.Trim().Equals("")) { respData.code = "110"; respData.description = "customerId不能为空"; return(respData.ToJSON()); } if (reqObj.special.eventKeyword == null || reqObj.special.eventKeyword.Trim().Equals("")) { respData.code = "110"; respData.description = "eventKeyword不能为空"; return(respData.ToJSON()); } #endregion var loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1"); //Default.WriteLog(loggingSessionInfo, "setiAlumniOrderInfo", reqObj, respData, reqObj.special.ToJSON()); WeixinWallBLL server = new WeixinWallBLL(loggingSessionInfo); string strError = string.Empty; string strMsg = string.Empty; WeixinWallEntity wallInfo = new WeixinWallEntity(); wallInfo = server.GetWeiXinWall(reqObj.special.eventKeyword.Trim()); if (wallInfo == null) { respData.code = "200"; respData.description = "没有存在的记录"; } else { var contentObj = new getWeixinWallInfoRespContentData(); contentObj.wallsCount = wallInfo.WallsCount.ToString(); if (wallInfo.WallsCount > 0) { contentObj.walls = new List <getWeixinWallEntity>(); IList <WeixinWallEntity> wallList = new List <WeixinWallEntity>(); foreach (WeixinWallEntity info in wallInfo.WallList) { getWeixinWallEntity reqInfo = new getWeixinWallEntity(); reqInfo.displayIndex = info.DisplayIndex.ToString(); reqInfo.content = info.Content; reqInfo.createTime = info.CreateTime.ToString(); reqInfo.wallId = info.WallId; reqInfo.userName = info.UserName; reqInfo.imageUrl = info.ImageUrl; contentObj.walls.Add(reqInfo); } } respData.content = contentObj; respData.code = "200"; respData.description = "成功"; } return(respData.ToJSON()); } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); } content = respData.ToJSON(); return(content); }
public string setWeixinWallInfo() { string content = string.Empty; var respData = new Default.LowerRespData(); try { string reqContent = Request["ReqContent"]; //reqContent = "{\"common\":{\\\"weiXinId\\\":\\\"gh_bf70d7900c28\\\",\\\"openId\\\":\\\"o8Y7Ejm0kL4QB8-h_Z0Bncl619v4\\\"},\"special\":{\\\"salesPrice\\\":\\\"235\\\",\\\"stdPrice\\\":\\\"250\\\",\\\"orderCode\\\":\\\"DO2013080800001\\\",\\\"totalAmount\\\":\\\"470\\\",\\\"deliveryName\\\":\\\"�ŵ����\\\",\\\"qty\\\":\\\"2\\\",\\\"deliveryRemark\\\":\\\"\\\",\\\"orderId\\\":\\\"E370FC0B39A77078E044005056BE1CB0\\\"}}"; //reqContent = Server.UrlDecode(reqContent); //reqContent = HttpUtility.UrlDecode(reqContent); //reqContent = reqContent.Replace("\\\"","\""); Loggers.Debug(new DebugLogInfo() { Message = string.Format("setWeixinWallInfo: {0}", reqContent) }); var reqObj = reqContent.DeserializeJSONTo <setWeiXinWallInfoReqData>(); string OpenID = reqObj.common.openId; string WeiXin = reqObj.common.weiXinId; string customerId = reqObj.common.customerId; #region if (OpenID == null || OpenID.Trim().Equals("")) { respData.code = "110"; respData.description = "OpenID不能为空"; return(respData.ToJSON()); } if (WeiXin == null || WeiXin.Trim().Equals("")) { respData.code = "110"; respData.description = "WeiXin不能为空"; return(respData.ToJSON()); } if (customerId == null || customerId.Trim().Equals("")) { respData.code = "110"; respData.description = "customerId不能为空"; return(respData.ToJSON()); } if (reqObj.special.eventKeyword == null || reqObj.special.eventKeyword.Trim().Equals("")) { respData.code = "110"; respData.description = "eventKeyword不能为空"; return(respData.ToJSON()); } if (reqObj.special.content == null || reqObj.special.content.Trim().Equals("")) { respData.code = "110"; respData.description = "content不能为空"; return(respData.ToJSON()); } #endregion var loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1"); //Default.WriteLog(loggingSessionInfo, "setiAlumniOrderInfo", null, respData, reqObj.special.ToJSON()); WeixinWallBLL server = new WeixinWallBLL(loggingSessionInfo); string strError = string.Empty; string strMsg = string.Empty; WeixinWallEntity wallInfo = new WeixinWallEntity(); wallInfo.WallId = BaseService.NewGuidPub(); wallInfo.EventKeyword = reqObj.special.eventKeyword.Trim(); wallInfo.Content = reqObj.special.content.Trim(); wallInfo.OpenId = OpenID.Trim(); wallInfo.WeiXinId = WeiXin.Trim(); wallInfo.CreateBy = OpenID.Trim(); wallInfo.LastUpdateBy = OpenID.Trim(); wallInfo.HasReader = 0; server.Create(wallInfo); respData.code = "200"; respData.description = "成功"; return(respData.ToJSON()); } catch (Exception ex) { respData.code = "103"; respData.description = "数据库操作错误"; respData.exception = ex.ToString(); } content = respData.ToJSON(); return(content); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Update(WeixinWallEntity pEntity, IDbTransaction pTran) { Update(pEntity, true, pTran); }
public void Update(WeixinWallEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran) { _currentDAO.Update(pEntity, pIsUpdateNullField, pTran); }
/// <summary> /// 创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> public void Create(WeixinWallEntity pEntity) { _currentDAO.Create(pEntity); }
/// <summary> /// 在事务内创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Create(WeixinWallEntity pEntity, IDbTransaction pTran) { _currentDAO.Create(pEntity, pTran); }
/// <summary> /// 分页根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public PagedQueryResult <WeixinWallEntity> PagedQueryByEntity(WeixinWallEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex) { return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex)); }
/// <summary> /// 根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public WeixinWallEntity[] QueryByEntity(WeixinWallEntity pQueryEntity, OrderBy[] pOrderBys) { return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys)); }
/// <summary> /// 删除 /// </summary> /// <param name="pEntity"></param> public void Delete(WeixinWallEntity pEntity) { _currentDAO.Delete(pEntity); }
public void Update(WeixinWallEntity pEntity, bool pIsUpdateNullField) { _currentDAO.Update(pEntity, pIsUpdateNullField); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> public void Update(WeixinWallEntity pEntity) { Update(pEntity, true); }