private string UploadMaterial_news(int CG_Code, string fileName) { CT_Campaigns _cam = _b_cam.GetCampaign(CG_Code); if (_cam == null) { return(null); } string _Id_thumb = GetMaterialId_thumb(CG_Code, fileName); if (string.IsNullOrEmpty(_Id_thumb)) { return(null); } string _content = GetHandleContent(fileName); if (string.IsNullOrEmpty(_content)) { return(null); } High_news _new = new High_news() { thumb_media_id = _Id_thumb, title = _cam.CG_Desc, content = _content.Replace('"', '\''), }; IList <High_news> _Ihigh = new List <High_news>(); _Ihigh.Add(_new); string _news = wechatHandle.High_news(_Ihigh); if (string.IsNullOrEmpty(_news)) { return(null); } UploadFileInfo _u = wechatHandle.UploadImageText(_news); if (_u == null) { return(null); } int i = _d_wechat.AddMultimedium(new CT_Wechat_Multimedium { WM_CG_EV_Code = CG_Code, WM_CG_EV_Type = 1, WM_Tpe = 5, WM_Media = _content.Replace('\'', '"'), WM_Media_Id = _u.MediaId, WM_Create_Dt = _u.UploadDate, WM_Invalidation = _u.Invalidation, WM_fileName = fileName }); return(_u.MediaId); }
public int ReportRun(ReportRunParam rParam) { //-1 代表请求参数为空; if (rParam == null) { return(-1); } CT_Reports _r; if (rParam.pType == 1) { BL_Campaign c = new BL_Campaign(); CT_Campaigns _c = c.GetCampaign(rParam.CG_EV_Code); CT_Param_Value _p = new CT_Param_Value() { RP_Code = _c.CG_RP_Code, PV_Type = 1, PV_CG_Code = _c.CG_Code, PV_UType = rParam.UType, PV_AD_OM_Code = rParam.AU_AD_OM_Code }; _r = GetReplaceReport(_p); List <CRMTreeDatabase.EX_Param> eps = new List <CRMTreeDatabase.EX_Param>(); CRMTreeDatabase.EX_Param ep = new CRMTreeDatabase.EX_Param(); ep.EX_Name = "PR"; ep.EX_Value = "0"; ep.EX_DataType = "int"; eps.Add(ep); //var oeps = JsonConvert.SerializeObject(eps); _r.RP_Query = GetReportSql(_r.RP_Code, eps).SQL; return(_D_re.ReportRun <CT_Campaigns>(_r, _c, rParam.UType, rParam.AU_AD_OM_Code)); } else if (rParam.pType == 2) { DL_Event e = new DL_Event(); CT_Events _e = e.getEvents(rParam.CG_EV_Code); CT_Param_Value _p = new CT_Param_Value() { RP_Code = _e.EV_RP_Code, PV_Type = 2, PV_CG_Code = _e.EV_Code, PV_UType = rParam.UType, PV_AD_OM_Code = rParam.AU_AD_OM_Code }; _r = GetReplaceReport(_p); _r.RP_Query = GetReportSql(_r.RP_Code, null).SQL; return(_D_re.ReportRun <CT_Events>(_r, _e, rParam.UType, rParam.AU_AD_OM_Code)); } return(-1); }
private void Init_Page() { int intCG_Code = RequestClass.GetInt("id", 0); if (intCG_Code <= 0) { Campaign.CG_Start_Dt = DateTime.Now; Campaign.CG_End_Dt = DateTime.Now.AddDays(5); } else { CRMTree.BLL.BL_Campaign Cam = new CRMTree.BLL.BL_Campaign(); Campaign = Cam.GetCampaign(intCG_Code); if (Campaign == null || string.IsNullOrEmpty(Campaign.CG_Title)) { string str = "<script language=javascript>history.go(-1);</script>"; //Page.RegisterClientScriptBlock("key", str); } } }