Пример #1
0
        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);
        }
Пример #2
0
 public CT_Events getEvents(int EV_Code)
 {
     return(Event.getEvents(EV_Code));
 }