/// <summary> /// 通过ID获取Event信息 /// </summary> public string GetEventInfoByIdData() { var service = new MarketEventBLL(CurrentUserInfo); var marketTemplateBLL = new MarketTemplateBLL(CurrentUserInfo); MarketEventEntity data; string content = string.Empty; string key = string.Empty; if (Request("MarketEventID") != null && Request("MarketEventID") != string.Empty) { key = Request("MarketEventID").ToString().Trim(); } data = service.GetByID(key); //var templateObj = marketTemplateBLL.GetByID(data.TemplateID); //data.TemplateContent = templateObj != null ? templateObj.TemplateContent : string.Empty; var jsonData = new JsonData(); jsonData.totalCount = "1"; jsonData.data = data; content = jsonData.ToJSON(); return(content); }
/// <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); }