/// <summary> /// 活动报名表数据提交 /// </summary> public GetResponseParams <bool> WEventSubmitEventApply(string EventID, string UserID, WEventUserMappingEntity userMappingEntity, IList <QuesAnswerEntity> quesAnswerList) { #region 判断对象不能为空 if (EventID == null || EventID.ToString().Equals("")) { return(new GetResponseParams <bool> { Flag = "0", Code = "419", Description = "活动标识为空", }); } #endregion GetResponseParams <bool> response = new GetResponseParams <bool>(); response.Flag = "1"; response.Code = "200"; response.Description = "成功"; try { var quesAnswerBLL = new QuesAnswerBLL(CurrentUserInfo); // WEventUserMapping var wEventUserMappingBLL = new WEventUserMappingBLL(CurrentUserInfo); //if (!wEventUserMappingBLL.ExsitWEventUserMapping(userMappingEntity)) //{ userMappingEntity.Mapping = Common.Utils.NewGuid(); userMappingEntity.EventID = EventID; userMappingEntity.UserID = UserID; wEventUserMappingBLL.Create(userMappingEntity); //} // QuesAnswer if (quesAnswerList != null) { //根据活动删除所有已有答案 bool bRetun = quesAnswerBLL.DeleteQuesAnswerByEventID(EventID, UserID); string createBy = BaseService.NewGuidPub(); foreach (var quesAnswerItem in quesAnswerList) { quesAnswerBLL.SubmitQuesQuestionAnswerWEvent(userMappingEntity.UserID, quesAnswerItem.QuestionID, quesAnswerItem.QuestionValue, createBy); } } //int iBool = _currentDAO.SetEventApplyCount(EventID, UserID); response.Params = true; return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; response.Description = "失败";//+ ":" + ex.ToString(); return(response); } }
public void UpdateWEventByPhone(WEventUserMappingEntity pEntity) { this.itemService.UpdateWEventByPhone(pEntity); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Update(WEventUserMappingEntity pEntity, IDbTransaction pTran) { Update(pEntity, true, pTran); }
public void Update(WEventUserMappingEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran) { _currentDAO.Update(pEntity, pIsUpdateNullField, pTran); }
/// <summary> /// 创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> public void Create(WEventUserMappingEntity pEntity) { _currentDAO.Create(pEntity); }
/// <summary> /// 在事务内创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Create(WEventUserMappingEntity pEntity, IDbTransaction pTran) { _currentDAO.Create(pEntity, pTran); }
/// <summary> /// 根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public WEventUserMappingEntity[] QueryByEntity(WEventUserMappingEntity pQueryEntity, OrderBy[] pOrderBys) { return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys)); }
/// <summary> /// 分页根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public PagedQueryResult <WEventUserMappingEntity> PagedQueryByEntity(WEventUserMappingEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex) { return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex)); }
/// <summary> /// 删除 /// </summary> /// <param name="pEntity"></param> public void Delete(WEventUserMappingEntity pEntity) { _currentDAO.Delete(pEntity); }
public void Update(WEventUserMappingEntity pEntity, bool pIsUpdateNullField) { _currentDAO.Update(pEntity, pIsUpdateNullField); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> public void Update(WEventUserMappingEntity pEntity) { Update(pEntity, true); }
/// <summary> /// 活动报名表数据提交 /// </summary> public string submitEventApply() { string ReqContent = string.Empty; string content = string.Empty; var respObj = new submitEventApplyRespData(); string respStr = string.Empty; try { ReqContent = Request["Form"]; //ReqContent = "{\"common\":{\"locale\":\"zh\",\"userId\":\"4f4ef63846f646b68e796cbc3604f2ed\",\"openId\":\"o8Y7Ejv3jR5fEkneCNu6N1_TIYIM\",\"customerId\":\"f6a7da3d28f74f2abedfc3ea0cf65c01\"},\"special\":{\"eventId\":\"8D41CDD7D5E4499195316E4645FCD7B9\",\"questions\":[{\"questionId\":\"87871FCE7117481DB2F72F28D627579F\",\"isSaveOutEvent\":\"0\",\"cookieName\":\"110801\",\"questionValue\":\"E9EAAE121543475EB57B1936EB98B4B7\"},{\"questionId\":\"CF21F654796F4E0B8F6F47D9D05B9407\",\"isSaveOutEvent\":\"0\",\"cookieName\":\"110802\",\"questionValue\":\"81E327E3252F4071AD9556F89580DCE2\"},{\"questionId\":\"4A73FEA6C1484ED4B1730A1EBC54E5B8\",\"isSaveOutEvent\":\"0\",\"cookieName\":\"110803\",\"questionValue\":\"11778879013148F2A424D5220FB02E09\"}],\"userName\":\"\",\"mobile\":\"\",\"email\":\"\"}}"; //ReqContent = HttpUtility.HtmlDecode(ReqContent); var reqContentObj = ReqContent.DeserializeJSONTo <submitEventApplyReqData>(); Loggers.Debug(new DebugLogInfo() { Message = string.Format( "submitEventApply ReqContent:{0}", ReqContent) }); if (!string.IsNullOrEmpty(reqContentObj.common.customerId)) { customerId = reqContentObj.common.customerId; } LoggingSessionInfo loggingSessionInfo = Default.GetBSLoggingSession(customerId, "1"); var service = new LEventsBLL(loggingSessionInfo); // WEventUserMappingEntity WEventUserMappingEntity userMappingEntity = new WEventUserMappingEntity(); userMappingEntity.UserName = reqContentObj.special.userName; userMappingEntity.Mobile = reqContentObj.special.mobile; userMappingEntity.Email = reqContentObj.special.email; // quesAnswerList IList <QuesAnswerEntity> quesAnswerList = new List <QuesAnswerEntity>(); if (reqContentObj.special.questions != null) { foreach (var question in reqContentObj.special.questions) { QuesAnswerEntity quesAnswerEntity = new QuesAnswerEntity(); quesAnswerEntity.QuestionID = question.questionId; quesAnswerEntity.QuestionValue = question.questionValue; quesAnswerList.Add(quesAnswerEntity); } } GetResponseParams <bool> returnDataObj = service.WEventSubmitEventApply( reqContentObj.special.eventId, reqContentObj.common.userId, userMappingEntity, quesAnswerList); respObj.code = returnDataObj.Code; respObj.description = returnDataObj.Description; //Jermyn20131108 提交问题之后微信推送 Jermyn20131209 更改了业务逻辑,暂时关闭 //PushWeiXin(reqContentObj.common.openId, loggingSessionInfo, reqContentObj.special.eventId, reqContentObj.common.userId); Loggers.Debug(new DebugLogInfo() { Message = string.Format( "submitEventApply RespContent:{0}", respObj.ToJSON()) }); } catch (Exception ex) { respObj.code = "103"; respObj.description = "数据库操作错误"; //respObj.exception = ex.ToString(); } content = respObj.ToJSON(); return(content); }
/// <summary> /// 发送微信消息 /// </summary> /// <param name="VipId">用户标识</param> /// <param name="EventId">活动标识</param> /// <param name="strError">错误提示</param> /// <returns></returns> public bool SetEventVipSeatPush(string VipId, string EventId, out string strError) { strError = "成功."; #region //1.判断用户是否关注过活动 WEventUserMappingBLL eventServer = new WEventUserMappingBLL(this.CurrentUserInfo); var eventList = eventServer.QueryByEntity(new WEventUserMappingEntity { UserID = VipId , IsDelete = 0 , EventID = EventId }, null); if (eventList == null || eventList.Length == 0) { #region WEventUserMappingEntity eventUserMappingInfo = new WEventUserMappingEntity(); eventUserMappingInfo.Mapping = Common.Utils.NewGuid(); eventUserMappingInfo.EventID = EventId; eventUserMappingInfo.UserID = VipId; eventServer.Create(eventUserMappingInfo); #endregion } #endregion #region //2.判断用户是否注册 VipBLL vipServer = new VipBLL(this.CurrentUserInfo); VipEntity vipInfo = new VipEntity(); vipInfo = vipServer.GetByID(VipId); if (vipInfo == null || vipInfo.VIPID.Equals("")) { strError = "用户不存在"; return(false); } #endregion else { #region EventVipEntity eventVipInfo = new EventVipEntity(); var eventVipList = _currentDAO.QueryByEntity(new EventVipEntity { Phone = vipInfo.Phone , IsDelete = 0 }, null); if (eventVipList == null || eventVipList.Length == 0) { strError = "没有合适的员工."; return(false); } else { eventVipInfo = eventVipList[0]; } #endregion LEventsEntity lEventsEntity = new LEventsEntity(); lEventsEntity = new LEventsBLL(this.CurrentUserInfo).GetByID(EventId); //string message = "尊贵的" + eventVipInfo.VipName + "先生/女士:\r\n 诚挚地欢迎您参加复星集团2014年全球工作会议,本次会议将于8:30正式开始。请您至5楼静安大宴会厅" + eventVipInfo.Seat + "区域就坐,或参见胸卡背面提示."; string message = new WMaterialWritingBLL(this.CurrentUserInfo).GetWMaterialWritingByModelId(EventId).Content; message = ReplaceTemplate(message, eventVipList[0], vipInfo, lEventsEntity); //组织消息 string code = JIT.CPOS.BS.BLL.WX.CommonBLL.SendWeixinMessage(message, VipId, this.CurrentUserInfo, vipInfo); switch (code) { case "103": strError = "未查询到匹配的公众账号信息"; break; case "203": strError = "发送失败"; break; default: break; } } return(true); }