/// <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); } }
/// <summary> /// 活动抽奖日志列表 /// </summary> /// <param name="EventID">活动ID</param> /// <param name="Page"></param> /// <param name="PageSize"></param> /// <returns></returns> public GetResponseParams <LLotteryLogEntity> GetEventLotteryLog(string EventID, int Page, int PageSize) { #region 判断对象不能为空 if (EventID == null || EventID.ToString().Equals("")) { return(new GetResponseParams <LLotteryLogEntity> { Flag = "0", Code = "419", Description = "活动ID不能为空", }); } if (PageSize == 0) { PageSize = 15; } #endregion GetResponseParams <LLotteryLogEntity> response = new GetResponseParams <LLotteryLogEntity>(); response.Flag = "1"; response.Code = "200"; response.Description = "成功"; try { #region 业务处理 LLotteryLogEntity usersInfo = new LLotteryLogEntity(); usersInfo.ICount = _currentDAO.GetEventLotteryLogCount(EventID); IList <LLotteryLogEntity> usersInfoList = new List <LLotteryLogEntity>(); if (usersInfo.ICount > 0) { DataSet ds = new DataSet(); ds = _currentDAO.GetEventLotteryLogList(EventID, Page, PageSize); if (ds != null && ds.Tables[0].Rows.Count > 0) { usersInfoList = DataTableToObject.ConvertToList <LLotteryLogEntity>(ds.Tables[0]); } } usersInfo.EntityList = usersInfoList; #endregion response.Params = usersInfo; return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; response.Description = "错误:" + ex.ToString(); return(response); } }
/// <summary> /// 问卷单个问题提交 微活动 /// </summary> /// <param name="UserID"></param> /// <param name="QuestionID"></param> /// <param name="QuestionValue"></param> /// <returns></returns> public GetResponseParams <bool> SubmitQuesQuestionAnswerWEvent(string UserID, string QuestionID, string QuestionValue, string CreateBy) { #region 判断对象不能为空 if (UserID == null || UserID.ToString().Equals("")) { return(new GetResponseParams <bool> { Flag = "0", Code = "405", Description = "用户为空", }); } if (QuestionID == null || QuestionID.ToString().Equals("")) { return(new GetResponseParams <bool> { Flag = "0", Code = "421", Description = "问题标识为空", }); } if (QuestionValue == null || QuestionValue.ToString().Equals("")) { return(new GetResponseParams <bool> { Flag = "0", Code = "422", Description = "答案为空", }); } #endregion GetResponseParams <bool> response = new GetResponseParams <bool>(); response.Flag = "1"; response.Code = "200"; response.Description = "成功"; try { response.Params = _currentDAO.SubmitQuesQuestionAnswerWEvent(UserID, QuestionID, QuestionValue, CreateBy); return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; response.Description = "失败" + ":" + ex.ToString(); return(response); } }
/// <summary> /// 摇奖 /// </summary> /// <param name="UserName">用户名</param> /// <param name="UserID">用户标识</param> /// <param name="EventID">活动标识</param> /// <param name="Longitude"></param> /// <param name="Latitude"></param> /// <returns></returns> public GetResponseParams <ShakeOffLotteryResult> SetShakeOffLottery(string UserName, string UserID, string EventID, float Longitude, float Latitude) { #region 判断对象不能为空 if (EventID == null || EventID.ToString().Equals("")) { return(new GetResponseParams <ShakeOffLotteryResult> { Flag = "0", Code = "419", Description = "EventID不能为空", }); } if (UserID == null || UserID.ToString().Equals("")) { return(new GetResponseParams <ShakeOffLotteryResult> { Flag = "0", Code = "405", Description = "UserId不能为空", }); } #endregion GetResponseParams <ShakeOffLotteryResult> response = new GetResponseParams <ShakeOffLotteryResult>(); response.Flag = "1"; response.Code = "200"; response.Description = "成功"; try { ShakeOffLotteryResult eventsInfo = new ShakeOffLotteryResult(); DataSet ds = new DataSet(); ds = _currentDAO.SetShakeOffLottery(UserName, UserID, EventID, Longitude, Latitude); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { eventsInfo = DataTableToObject.ConvertToObject <ShakeOffLotteryResult>(ds.Tables[0].Rows[0]); } response.Params = eventsInfo; return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; //response.Description = "失败:" + ex.ToString(); return(response); } }
/// <summary> /// 获取评论列表 /// </summary> /// <param name="entriesId">作品ID</param> /// <param name="date">查询日期</param> /// <param name="Page"></param> /// <param name="PageSize"></param> /// <returns></returns> public GetResponseParams <LEventsEntriesCommentEntity> GetCommentList(string entriesId, string date, string IsCrowdDaren, int Page, int PageSize) { GetResponseParams <LEventsEntriesCommentEntity> response = new GetResponseParams <LEventsEntriesCommentEntity>(); response.Flag = "1"; response.Code = "200"; response.Description = "成功"; try { #region 业务处理 var commentEntity = new LEventsEntriesCommentEntity(); commentEntity.ICount = this._currentDAO.GetCommentCount(entriesId, date, IsCrowdDaren); var commentList = new List <LEventsEntriesCommentEntity>(); if (commentEntity.ICount > 0) { var ds = _currentDAO.GetCommentList(entriesId, date, IsCrowdDaren, Page, PageSize); if (ds != null && ds.Tables[0].Rows.Count > 0) { commentList = DataTableToObject.ConvertToList <LEventsEntriesCommentEntity>(ds.Tables[0]); } } commentEntity.CommentList = commentList; #endregion response.Params = commentEntity; return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; response.Description = "错误:" + ex.ToString(); return(response); } }
/// <summary> /// 获取活动明细 /// </summary> /// <param name="EventID"></param> /// <param name="UserID"></param> /// <returns></returns> public GetResponseParams <LEventsEntity> WEventGetEventDetail(string EventID, string UserID) { #region 判断对象不能为空 if (EventID == null || EventID.ToString().Equals("")) { return(new GetResponseParams <LEventsEntity> { Flag = "0", Code = "419", Description = "活动标识不能为空", }); } #endregion GetResponseParams <LEventsEntity> response = new GetResponseParams <LEventsEntity>(); response.Flag = "1"; response.Code = "200"; response.Description = "成功"; try { LEventsEntity eventsInfo = new LEventsEntity(); DataSet ds = new DataSet(); ds = this._currentDAO.GetEventDetailById(EventID);; if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { eventsInfo = DataTableToObject.ConvertToObject <LEventsEntity>(ds.Tables[0].Rows[0]); } response.Params = eventsInfo; return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; response.Description = "失败" + ":" + ex.ToString(); return(response); } }
/// <summary> /// 活动报名表数据获取 /// </summary> /// <param name="EventID">活动标识</param> /// <returns></returns> public GetResponseParams <QuestionnaireEntity> getEventApplyQues(string EventID) { #region if (EventID == null) { return(new GetResponseParams <QuestionnaireEntity> { Flag = "0", Code = "404", Description = "活动标识为空", }); } #endregion GetResponseParams <QuestionnaireEntity> response = new GetResponseParams <QuestionnaireEntity> { Flag = "1", Code = "200", Description = "成功" }; try { QuestionnaireEntity quesInfo = new QuestionnaireEntity(); #region 业务处理 //1.获取问题数量 quesInfo.QuestionCount = _currentDAO.GetEventApplyQuesCount(EventID); //2.获取问题列表 if (quesInfo.QuestionCount > 0) { DataSet ds = new DataSet(); ds = _currentDAO.GetEventApplyQuesList(EventID); IList <QuesQuestionsEntity> questionList = new List <QuesQuestionsEntity>(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { questionList = DataTableToObject.ConvertToList <QuesQuestionsEntity>(ds.Tables[0]); if (questionList != null && questionList.Count > 0) { //3.获取问题选项 foreach (QuesQuestionsEntity questionInfo in questionList) { DataSet ds1 = new DataSet(); ds1 = _currentDAO.GetEventApplyOptionList(questionInfo.QuestionID); if (ds1 != null && ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0) { IList <QuesOptionEntity> optionList = new List <QuesOptionEntity>(); optionList = DataTableToObject.ConvertToList <QuesOptionEntity>(ds1.Tables[0]); questionInfo.QuesOptionEntityList = optionList; } } quesInfo.QuesQuestionEntityList = questionList; } } } #endregion response.Params = quesInfo; return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; response.Description = "失败:" + ex.ToString(); return(response); } }
/// <summary> /// 活动报名表数据提交 /// </summary> public GetResponseParams <bool> WEventSubmitEventApply(string openID, string EventID, string UserID, IList <QuesAnswerEntity> quesAnswerList, string UserName) //WEventUserMappingEntity userMappingEntity, { #region 判断对象不能为空 if (EventID == null || EventID.ToString().Equals("")) { return(new GetResponseParams <bool> { Flag = "0", Code = "419", Description = "活动标识为空", }); } if (quesAnswerList == null || quesAnswerList.Count == 0) { return(new GetResponseParams <bool> { Flag = "0", Code = "419", Description = "活动回答问题集合为空", }); } #endregion GetResponseParams <bool> response = new GetResponseParams <bool>(); response.Flag = "1"; response.Code = "200"; //response. = 0; response.Description = "成功"; try { var quesAnswerBLL = new QuesAnswerBLL(CurrentUserInfo); if (quesAnswerList != null) { //Loggers.Debug(new DebugLogInfo() //{ // Message = string.Format( // "submitEventApply--WEventSubmitEventApply:{0}", "true") //}); string createBy = System.Guid.NewGuid().ToString().Replace("-", ""); foreach (var quesAnswerItem in quesAnswerList) { //Loggers.Debug(new DebugLogInfo() //{ // Message = string.Format( // "submitEventApply--WEventSubmitEventApply:{0}", "循坏" + quesAnswerItem.QuestionValue) //}); quesAnswerBLL.SubmitQuesQuestionAnswerWEvent(openID, EventID, UserName, quesAnswerItem.QuestionID, quesAnswerItem.QuestionValue, createBy); } } //else { // Loggers.Debug(new DebugLogInfo() // { // Message = string.Format( // "submitEventApply--WEventSubmitEventApply:{0}", "false") // }); //} response.Params = true; return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; response.Description = "错误:" + ex.ToString(); return(response); } }
/// <summary> /// 问卷单个问题提交 微活动 /// </summary> /// <param name="UserID"></param> /// <param name="QuestionID"></param> /// <param name="QuestionValue"></param> /// <returns></returns> public GetResponseParams <bool> SubmitQuesQuestionAnswerWEvent(string openID, string eventID, string UserID, string QuestionID, string QuestionValue, string CreateBy) { #region 判断对象不能为空 if (UserID == null || UserID.ToString().Equals("")) { return(new GetResponseParams <bool> { Flag = "0", Code = "405", Description = "错误:用户为空", }); } if (QuestionID == null || QuestionID.ToString().Equals("")) { return(new GetResponseParams <bool> { Flag = "0", Code = "421", Description = "错误:问题为空", }); } if (QuestionValue == null || QuestionValue.ToString().Equals("")) { return(new GetResponseParams <bool> { Flag = "0", Code = "422", Description = "错误答案为空", }); } #endregion GetResponseParams <bool> response = new GetResponseParams <bool>(); response.Flag = "1"; response.Code = "200"; response.Description = "ok"; try { //Loggers.Debug(new DebugLogInfo() //{ // Message = string.Format( // "submitEventApply--SubmitQuesQuestionAnswerWEvent:{0}", "true") //}); response.Params = _currentDAO.SubmitQuesQuestionAnswerWEvent(UserID, QuestionID, QuestionValue, CreateBy); var marketQuesAnswerBll = new MarketQuesAnswerBLL(CurrentUserInfo); marketQuesAnswerBll.SubmitQuestions(openID, eventID, QuestionID, QuestionValue); //Loggers.Debug(new DebugLogInfo() //{ // Message = string.Format( // "submitEventApply--SubmitQuestions:{0}", "true") //}); return(response); } catch (Exception ex) { response.Flag = "0"; response.Code = "103"; response.Description = "错误:" + ex.ToString(); return(response); } }