Beispiel #1
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Update(QuesAnswerEntity pEntity, IDbTransaction pTran)
 {
     Update(pEntity, true, pTran);
 }
Beispiel #2
0
 public void Update(QuesAnswerEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField, pTran);
 }
Beispiel #3
0
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(QuesAnswerEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }
Beispiel #4
0
 /// <summary>
 /// 在事务内创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Create(QuesAnswerEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Create(pEntity, pTran);
 }
Beispiel #5
0
 /// <summary>
 /// 根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public QuesAnswerEntity[] QueryByEntity(QuesAnswerEntity pQueryEntity, OrderBy[] pOrderBys)
 {
     return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys));
 }
Beispiel #6
0
 /// <summary>
 /// 分页根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public PagedQueryResult <QuesAnswerEntity> PagedQueryByEntity(QuesAnswerEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex)
 {
     return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex));
 }
Beispiel #7
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity"></param>
 public void Delete(QuesAnswerEntity pEntity)
 {
     _currentDAO.Delete(pEntity);
 }
Beispiel #8
0
 public void Update(QuesAnswerEntity pEntity, bool pIsUpdateNullField)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField);
 }
Beispiel #9
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Update(QuesAnswerEntity 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 = HttpUtility.HtmlDecode(ReqContent);
                var reqContentObj = ReqContent.DeserializeJSONTo <submitEventApplyReqData>();

                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format(
                        "submitEventApply ReqContent:{0}",
                        ReqContent)
                });

                var service = new QuestionnaireBLL(Default.GetLoggingSession());

                // 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);
                    }
                }

                string userId = reqContentObj.common.userId;
                if (userId == null || userId.Trim().Length == 0)
                {
                    userId = "1";
                }
                //Jermyn20130621 判断特殊的openId=123456,作为公众平台编辑模式进来的判断逻辑
                if (reqContentObj.common.openId.Equals("123456") || reqContentObj.common.openId.Equals("111"))
                {
                    reqContentObj.common.openId = System.Guid.NewGuid().ToString().Replace("-", "");
                }
                if (reqContentObj.special.userName == null || reqContentObj.special.userName.Trim().Length == 0)
                {
                    reqContentObj.special.userName = System.Guid.NewGuid().ToString().Replace("-", "");
                }
                GetResponseParams <bool> returnDataObj = service.WEventSubmitEventApply(
                    reqContentObj.common.openId,
                    reqContentObj.special.eventId,
                    userId,
                    //userMappingEntity,
                    quesAnswerList, reqContentObj.special.userName);

                respObj.Code        = returnDataObj.Code;
                respObj.Description = returnDataObj.Description;

                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format(
                        "submitEventApply RespContent:{0}",
                        respObj.ToJSON())
                });

                #region 推送消息

                string msgUrl  = ConfigurationManager.AppSettings["push_weixin_msg_url"].Trim();
                string msgText = "感谢您积极参与我们的活动。";
                string msgData = "<xml><OpenID><![CDATA[" + reqContentObj.common.openId + "]]></OpenID><Content><![CDATA[" + msgText + "]]></Content></xml>";

                var msgResult = Common.Utils.GetRemoteData(msgUrl, "POST", msgData);

                #endregion
            }
            catch (Exception ex)
            {
                respObj.Code        = "103";
                respObj.Description = "数据库操作错误";
                respObj.Exception   = ex.ToString();
            }
            content = respObj.ToJSON();
            return(content);
        }
Beispiel #11
0
        /// <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);
        }