Пример #1
0
        /// <summary>
        /// 市场活动响应
        /// </summary>
        /// <returns></returns>
        public string MarketEventResponse()
        {
            var    loggingSesssionInfo = Default.GetLoggingSession();
            string content             = string.Empty;

            GetResponseParams <bool> response = new GetResponseParams <bool>();

            response.Code        = "200";
            response.Description = "操作成功";

            try
            {
                string openID  = Request["openID"].ToString().Trim();
                string eventID = Request["eventID"].ToString().Trim();

                if (!string.IsNullOrEmpty(openID) && !string.IsNullOrEmpty(eventID))
                {
                    MarketEventResponseBLL responseServer = new MarketEventResponseBLL(loggingSesssionInfo);
                    responseServer.MarketEventResponse(openID, eventID);
                }
            }
            catch (Exception ex)
            {
                response.Code        = "201";
                response.Description = "操作失败:" + ex.ToString();
            }

            content = string.Format("{{\"description\":\"{0}\",\"code\":\"{1}\"}}",
                                    response.Description, response.Code);
            return(content);
        }
Пример #2
0
        /// <summary>
        /// 活动响应
        /// </summary>
        /// <returns></returns>
        public string GetEventRequestData()
        {
            string content         = string.Empty;
            var    responseService = new MarketEventResponseBLL(this.CurrentUserInfo);
            string EventID         = FormatParamValue(Request("eventId"));
            int    pageIndex       = Utils.GetIntVal(FormatParamValue(Request("page"))) - 1;

            Loggers.Debug(new DebugLogInfo()
            {
                Message = string.Format("EventID:{0}", EventID)
            });
            if (EventID != null && !EventID.Equals(""))
            {
                var data = responseService.GetEventResponseInfo(EventID, pageIndex, PageSize);
                Loggers.Debug(new DebugLogInfo()
                {
                    Message = string.Format("GetEventRequestData:{0}", data.ToJSON())
                });
                content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                        data.MarketEventResponseInfoList.ToJSON(),
                                        data.ICount);
            }

            return(content);
        }