protected override ThemeListRD ProcessRequest(APIRequest <EmptyRequestParameter> pRequest) { var rd = new ThemeListRD(); var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; T_CTW_LEventThemeBLL bllTheme = new T_CTW_LEventThemeBLL(loggingSessionInfo); DataSet ds = bllTheme.GetInSeasonThemeList(); if (ds != null && ds.Tables.Count > 0) { rd.ThemeList = DataTableToObject.ConvertToList <T_CTW_LEventThemeEntity>(ds.Tables[0]).OrderBy(a => a.StartDate).ToList(); } return(rd); }
protected override ThemeListRD ProcessRequest(APIRequest <EmptyRequestParameter> pRequest) { var rd = new ThemeListRD(); var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; T_CTW_LEventThemeBLL bllTheme = new T_CTW_LEventThemeBLL(loggingSessionInfo); T_CTW_LEventThemeEntity[] listTheme = bllTheme.GetAll(); if (listTheme != null) { rd.ThemeList = listTheme.ToList().OrderBy(a => a.StartDate).ToList(); } return(rd); }
/// <summary> /// 保存更新主题 /// </summary> /// <param name="para"></param> /// <returns></returns> public void SaveAndUpdateTheme(SetCTWEventRP para, T_CTW_LEventThemeEntity entityTheme, out string strThemeId) { T_CTW_LEventThemeBLL bllCustomerTheme = new T_CTW_LEventThemeBLL(loggingSessionInfo); if (entityTheme == null || entityTheme.ThemeId == null) { ///风格表 if (para.EventThemeInfo != null) { if (!string.IsNullOrEmpty(para.CTWEventId)) { bllCustomerTheme.DeleteByCTWEventID(para.CTWEventId); } entityTheme = new T_CTW_LEventThemeEntity() { CTWEventId = new Guid(strCTWEventId), ThemeName = para.EventThemeInfo.ThemeName, H5Url = para.EventThemeInfo.H5Url, H5TemplateId = para.EventThemeInfo.H5TemplateId, OriginalThemeId = new Guid(para.OriginalThemeId), CustomerId = loggingSessionInfo.ClientID, WorksId = para.EventThemeInfo.WorksId }; bllCustomerTheme.Create(entityTheme); } } else { if (para.EventThemeInfo != null) { entityTheme = new T_CTW_LEventThemeEntity() { CTWEventId = new Guid(strCTWEventId), ThemeName = para.EventThemeInfo.ThemeName, H5Url = para.EventThemeInfo.H5Url, H5TemplateId = para.EventThemeInfo.H5TemplateId, OriginalThemeId = new Guid(para.OriginalThemeId), ThemeId = para.EventThemeInfo.ThemeId, WorksId = para.EventThemeInfo.WorksId }; bllCustomerTheme.Update(entityTheme); } } strThemeId = entityTheme.ThemeId.ToString(); }
protected override ApplyRD ProcessRequest(APIRequest <ApplyRP> pRequest) { var rd = new ApplyRD(); FromSetting fs = new FromSetting(); fs.SMTPServer = "smtp.exmail.qq.com"; fs.SendFrom = "*****@*****.**"; fs.UserName = "******"; fs.Password = "******"; string mailTo = "*****@*****.**"; string[] s = new string[1]; var para = pRequest.Parameters; var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; T_CTW_LEventThemeBLL bllTheme = new T_CTW_LEventThemeBLL(loggingSessionInfo); T_CTW_LEventThemeEntity entityTheme = bllTheme.GetByID(para.ThemeId); DataSet dsCustomer = bllTheme.GetCustomerInfo(); if (dsCustomer.Tables[0] == null) { rd.errCode = 1; rd.errMsg = "商户信息不存在!"; return(rd); } t_customerEntity entityCustomer = DataTableToObject.ConvertToObject <t_customerEntity>(dsCustomer.Tables[0].Rows[0]); if (entityTheme != null) { string strSubject = "活动申请"; string strBody = "商户名称:" + entityCustomer.customer_name + "<br/>联系人:" + entityCustomer.customer_contacter + "<br/>联系方式:" + entityCustomer.customer_tel + "<br/>活动名称:" + entityTheme.ThemeName + "<br/>申请时间:" + DateTime.Now; Mail.SendMail(fs, mailTo, strSubject, strBody, s); rd.errCode = 0; } return(rd); }
protected override SetCTWEventRD ProcessRequest(APIRequest <SetCTWEventRP> pRequest) { //图文信息 //微信 公共平台 var wapentity = new WApplicationInterfaceBLL(loggingSessionInfo).QueryByEntity(new WApplicationInterfaceEntity { CustomerId = loggingSessionInfo.ClientID, IsDelete = 0 }, null).FirstOrDefault();//取默认的第一个微信 if (wapentity == null) { throw new APIException("微信公众号未授权") { ErrorCode = 343 }; } var rd = new SetCTWEventRD(); var para = pRequest.Parameters; strCTWEventId = para.CTWEventId; string strThemeId = string.Empty; string strStartDate = string.Empty; string strEndDate = string.Empty; string strGameEventGuid = string.Empty; string strPageParamJson = string.Empty; T_CTW_LEventBLL bllCustomerEvent = new T_CTW_LEventBLL(loggingSessionInfo); T_CTW_LEventThemeBLL bllCustomerTheme = new T_CTW_LEventThemeBLL(loggingSessionInfo); T_CTW_LEventInteractionBLL bllCustomerInteraction = new T_CTW_LEventInteractionBLL(loggingSessionInfo); T_CTW_PanicbuyingEventKVBLL bllPanicbuyingEventKV = new T_CTW_PanicbuyingEventKVBLL(loggingSessionInfo); T_CTW_SpreadSettingBLL bllSpreadSetting = new T_CTW_SpreadSettingBLL(loggingSessionInfo); LPrizesBLL bllPrize = new LPrizesBLL(loggingSessionInfo); ObjectImagesBLL imageBll = new ObjectImagesBLL(loggingSessionInfo); entityCustomerEvent = bllCustomerEvent.GetByID(strCTWEventId); if (entityCustomerEvent != null) { ///风格 entityTheme = bllCustomerTheme.QueryByEntity(new T_CTW_LEventThemeEntity() { CTWEventId = new Guid(strCTWEventId), OriginalThemeId = new Guid(para.OriginalThemeId) }, null).FirstOrDefault(); //互动方式 entityInteraction = bllCustomerInteraction.QueryByEntity(new T_CTW_LEventInteractionEntity { CTWEventId = new Guid(strCTWEventId), OriginalLeventId = new Guid(para.OriginalLeventId) }, null).FirstOrDefault(); } //保存风格 SaveAndUpdateTheme(para, entityTheme, out strThemeId); //互动类型--游戏 if (para.InteractionType == 1 && para.GameEventInfo != null) { SaveGameEvent(para, bllPrize, bllCustomerInteraction, strThemeId, out strStartDate, out strEndDate, out strGameEventGuid); para.MaterialText.PageParamJson = "[{\"key\":\"eventId\",\"value\":\"" + strCTWEventId + "\"}]"; strPageParamJson = "[{\"key\":\"eventId\",\"value\":\"" + strCTWEventId + "\"}]"; } //互动类型--促销 if (para.InteractionType == 2 && para.PanicbuyingEventInfo != null) { SavePanicbuyingEvent(para, bllPanicbuyingEventKV, imageBll, bllCustomerInteraction, strThemeId, out strStartDate, out strEndDate); string strEventType = string.Empty; switch (para.DrawMethodCode) { case "TG": strEventType = "1"; break; case "QG": strEventType = "2"; break; case "RX": strEventType = "3"; break; default: strEventType = "99"; break; } para.MaterialText.PageParamJson = "[{\"key\":\"CTWEventId\",\"value\":\"" + strCTWEventId + "\"},{\"key\":\"eventTypeId\",\"value\":\"" + strEventType + "\"}]"; strPageParamJson = "[{\"key\":\"CTWEventId\",\"value\":\"" + strCTWEventId + "\"},{\"key\":\"eventTypeId\",\"value\":\"" + strEventType + "\"}]"; //SaveAndUpdatePanicbuyingEvent(para,bllPrize,bllPanicbuyingEventKV,imageBll,bllCustomerInteraction, strThemeId, out strStartDate, out strEndDate); } string strFocesQRCodeUrl = string.Empty; //分享,推广 if (para.SpreadSettingList.Count > 0) { SaveSpreadSetting(para, bllSpreadSetting, imageBll, wapentity, out strFocesQRCodeUrl); } ///推广关注的奖励设置入 触点活动数据表 if (para.ContactPrizeList != null && para.ContactPrizeList.Count > 0) { SaveContactPrize(para, bllPrize, strStartDate, strEndDate); } string strOnlineQRCodeId = string.Empty; string strOfflineQRCodeId = string.Empty; string strOnlineQRCodeUrl = string.Empty; string strOfflineQRCodeUrl = string.Empty; string strOnlineRedirectUrl = string.Empty; string strOfflineRedirectUrl = string.Empty; var WQRCodeManagerbll = new WQRCodeManagerBLL(loggingSessionInfo); if (!string.IsNullOrEmpty(para.OfflineQRCodeId)) { WQRCodeManagerbll.Delete(new WQRCodeManagerEntity() { QRCodeId = new Guid(para.OfflineQRCodeId) }); } if (!string.IsNullOrEmpty(para.OnlineQRCodeId)) { WQRCodeManagerbll.Delete(new WQRCodeManagerEntity() { QRCodeId = new Guid(para.OnlineQRCodeId) }); } CreateQRCode(para, wapentity, strPageParamJson, out strOfflineQRCodeId, out strOfflineQRCodeUrl, out strOfflineRedirectUrl); CreateH5QRCode(para, wapentity, out strOnlineQRCodeId, out strOnlineQRCodeUrl, out strOnlineRedirectUrl); rd.OfflineQRCodeUrl = strOfflineQRCodeUrl; rd.OnlineQRCodeUrl = strOnlineQRCodeUrl; rd.OfflineRedirectUrl = strOfflineRedirectUrl; rd.OnlineRedirectUrl = strOnlineRedirectUrl;//strFocesQRCodeUrl; if (entityCustomerEvent != null) { //活动主表 entityCustomerEvent.Name = para.TemplateName; entityCustomerEvent.Desc = para.TemplateDesc; entityCustomerEvent.InteractionType = para.InteractionType; entityCustomerEvent.ActivityGroupId = new Guid(para.ActivityGroupId); entityCustomerEvent.ImageURL = para.TemplateImageURL; entityCustomerEvent.StartDate = Convert.ToDateTime(strStartDate); entityCustomerEvent.EndDate = Convert.ToDateTime(strEndDate); entityCustomerEvent.OnlineQRCodeId = strOnlineQRCodeId; entityCustomerEvent.OfflineQRCodeId = strOfflineQRCodeId; entityCustomerEvent.OffLineRedirectUrl = strOfflineRedirectUrl; entityCustomerEvent.OnLineRedirectUrl = strOnlineRedirectUrl; bllCustomerEvent.Update(entityCustomerEvent); } else { entityCustomerEvent = new T_CTW_LEventEntity() { CTWEventId = new Guid(para.CTWEventId), TemplateId = new Guid(para.TemplateId), Name = para.TemplateName, Desc = para.TemplateDesc, ActivityGroupId = new Guid(para.ActivityGroupId), InteractionType = para.InteractionType, ImageURL = para.TemplateImageURL, Status = 10, CustomerId = loggingSessionInfo.ClientID, StartDate = Convert.ToDateTime(strStartDate), EndDate = Convert.ToDateTime(strEndDate), OfflineQRCodeId = strOfflineQRCodeId, OnlineQRCodeId = strOnlineQRCodeId, OffLineRedirectUrl = strOfflineRedirectUrl, OnLineRedirectUrl = strOnlineRedirectUrl }; bllCustomerEvent.Create(entityCustomerEvent); } return(rd); }