Пример #1
0
        /// <summary>
        /// 获取Person列表
        /// </summary>
        public string GetPersonListData()
        {
            var    service = new MarketPersonBLL(CurrentUserInfo);
            string content = string.Empty;

            string key = string.Empty;

            if (Request("MarketEventID") != null && Request("MarketEventID") != string.Empty)
            {
                key = Request("MarketEventID").ToString().Trim();
            }

            var queryEntity = new MarketPersonEntity();

            queryEntity.MarketEventID = key;
            int pageIndex = Utils.GetIntVal(FormatParamValue(Request("page"))) - 1;

            var data           = service.GetList(queryEntity, pageIndex, 1000);
            var dataTotalCount = service.GetListCount(queryEntity);

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    data.ToJSON(),
                                    dataTotalCount);
            return(content);
        }
Пример #2
0
 /// <summary>
 /// 测试发送
 /// </summary>
 private void SetEventPush()
 {
     MarketPersonBLL bll     = new MarketPersonBLL(Default.GetLoggingSession());
     string          EventID = "41D86F55613649539C480E697ADA9EBB";
     string          msgUrl  = ConfigurationManager.AppSettings["push_weixin_msg_url"].Trim();
     bool            b       = bll.SetEventPush(EventID, msgUrl, "1", true, true, true);
 }
Пример #3
0
        /// <summary>
        /// 保存EventPerson
        /// </summary>
        public string SaveEventPersonData()
        {
            var    service           = new MarketEventBLL(CurrentUserInfo);
            var    marketWaveBandBLL = new MarketWaveBandBLL(CurrentUserInfo);
            var    marketPersonBLL   = new MarketPersonBLL(CurrentUserInfo);
            var    obj          = new MarketPersonEntity();
            var    eventObj     = new MarketEventEntity();
            string content      = string.Empty;
            string error        = "";
            var    responseData = new ResponseData();

            string key           = string.Empty;
            string MarketEventID = string.Empty;

            if (Request("data") != null && Request("data") != string.Empty)
            {
                key = Request("data").ToString().Trim();
            }
            if (Request("MarketEventID") != null && Request("MarketEventID") != string.Empty)
            {
                MarketEventID = Request("MarketEventID").ToString().Trim();
            }

            obj = key.DeserializeJSONTo <MarketPersonEntity>();

            if (obj.MarketEventID == null || obj.MarketEventID.Trim().Length == 0 ||
                obj.MarketEventID == "null" || obj.MarketEventID == "undefined")
            {
                responseData.success = false;
                responseData.msg     = "活动标示不能为空";
                return(responseData.ToJSON());
            }

            marketPersonBLL.WebDelete(new MarketPersonEntity()
            {
                MarketEventID = obj.MarketEventID
            });
            if (obj.MarketPersonInfoList != null)
            {
                foreach (var item in obj.MarketPersonInfoList)
                {
                    //item.MarketPersonID = Utils.NewGuid();
                    item.MarketEventID = MarketEventID;
                    marketPersonBLL.Create(item);
                }
            }

            eventObj.MarketEventID = MarketEventID;
            eventObj.PersonCount   = obj.MarketPersonInfoList.Count;
            service.Update(eventObj, false);

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }
Пример #4
0
        /// <summary>
        /// 保存EventSend
        /// </summary>
        public string SaveEventSendData()
        {
            var    service      = new MarketEventBLL(CurrentUserInfo);
            var    obj          = new MarketEventEntity();
            string content      = string.Empty;
            string error        = "";
            var    responseData = new ResponseData();

            string key           = string.Empty;
            string MarketEventID = string.Empty;
            bool   chk           = true;
            bool   chkSMS        = true;
            bool   chkAPP        = true;

            if (Request("data") != null && Request("data") != string.Empty)
            {
                key = Request("data").ToString().Trim();
            }
            if (Request("MarketEventID") != null && Request("MarketEventID") != string.Empty)
            {
                MarketEventID = Request("MarketEventID").ToString().Trim();
            }

            if (Request("chk") != null && Request("chk") != string.Empty)
            {
                chk = Convert.ToBoolean(Request("chk").ToString().Trim());
            }
            if (Request("chkSMS") != null && Request("chkSMS") != string.Empty)
            {
                chkSMS = Convert.ToBoolean(Request("chkSMS").ToString().Trim());
            }
            if (Request("chkAPP") != null && Request("chkAPP") != string.Empty)
            {
                chkAPP = Convert.ToBoolean(Request("chkAPP").ToString().Trim());
            }

            obj = key.DeserializeJSONTo <MarketEventEntity>();

            var             eventObj        = service.GetByID(MarketEventID);
            string          msgUrl          = ConfigurationManager.AppSettings["push_weixin_msg_url"].Trim();
            MarketPersonBLL marketPersonBLL = new MarketPersonBLL(this.CurrentUserInfo);
            var             sendFlag        = marketPersonBLL.SetEventPush(MarketEventID, msgUrl, eventObj.SendTypeId, chk, chkSMS, chkAPP);

            // Update
            obj.MarketEventID = MarketEventID;
            service.Update(obj, false);

            responseData.success = sendFlag;
            responseData.msg     = error;
            responseData.data    = obj.MarketEventID;

            content = responseData.ToJSON();
            return(content);
        }
Пример #5
0
        public string GetMarketPersonCount()
        {
            string content      = string.Empty;
            var    responseData = new ResponseData();
            string EventID      = FormatParamValue(Request("eventId")); //活动标识

            if (EventID == null || EventID.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "活动标识不能为空";
                return(responseData.ToJSON());
            }
            MarketPersonBLL bll   = new MarketPersonBLL(this.CurrentUserInfo);
            int             count = bll.GetMarketPersonByEventID(EventID);


            responseData.success = true;
            responseData.msg     = count.ToString();

            content = responseData.ToJSON();
            return(content);
        }
Пример #6
0
        /// <summary>
        /// 测试发送
        /// </summary>
        /// <returns></returns>
        public string SetTestSendData()
        {
            var    responseData = new ResponseData();
            string content      = string.Empty;
            string EventID      = FormatParamValue(Request("eventId")); //活动标识

            if (EventID == null || EventID.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "活动标识不能为空";
                return(responseData.ToJSON());
            }

            MarketPersonBLL bll = new MarketPersonBLL(this.CurrentUserInfo);
            bool            b   = bll.SetEventPush(EventID, msgUrl, "1", true, true, true);

            responseData.success = true;
            responseData.msg     = "测试发送成功";

            content = responseData.ToJSON();
            return(content);
        }
Пример #7
0
        /// <summary>
        /// 通过ID获取UnitProperty信息
        /// </summary>
        public string GetUnitPropertyData()
        {
            var service               = new VwUnitPropertyBLL(CurrentUserInfo);
            var marketPersonBLL       = new MarketPersonBLL(CurrentUserInfo);
            VwUnitPropertyEntity data = new VwUnitPropertyEntity();
            string content            = string.Empty;

            string key = CurrentUserInfo.CurrentUserRole.UnitId;
            //if (Request("UnitId") != null && Request("UnitId") != string.Empty)
            //{
            //    key = Request("UnitId").ToString().Trim();
            //}
            var eventId = Request("MarketEventID").ToString().Trim();

            var list = service.QueryByEntity(new VwUnitPropertyEntity()
            {
                UnitId = key
            }, null);

            if (list != null && list.Length > 0)
            {
                data = list[0];
            }

            var count1 = marketPersonBLL.GetMarketPersonSendCount(eventId, 1);
            var count2 = marketPersonBLL.GetMarketPersonSendCount(eventId, 2);
            var count3 = marketPersonBLL.GetMarketPersonSendCount(eventId, 3);

            var jsonData = new JsonData();

            jsonData.totalCount = list.Length.ToString();
            jsonData.data       = data;
            jsonData.topics     = count1 + "," + count2 + "," + count3;

            content = jsonData.ToJSON();
            return(content);
        }