Exemplo n.º 1
0
        public string[] GetRunAu_Code(int CG_Code, int UType, int AD_Code)
        {
            CT_Campaigns   _c = GetCampaign(CG_Code);
            CT_Param_Value _p = new CT_Param_Value()
            {
                RP_Code       = _c.CG_RP_Code,
                PV_Type       = 1,
                PV_CG_Code    = CG_Code,
                PV_UType      = UType,
                PV_AD_OM_Code = AD_Code
            };
            BL_Reports _bl_report = new BL_Reports();
            CT_Reports _Report    = _bl_report.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);
            _Report.RP_Query = BL_Reports.GetReportSql(_Report.RP_Code, eps).SQL;
            string[] _au_code = _bl_report.GetUserCode(_Report.RP_Query, "AU_Code").Distinct().ToArray();
            return(_au_code);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public DataTable getfile_Rep_value(int CG_Code, int AU_Type, int AU_AD_OM_Code)
        {
            CT_Campaigns   _o = GetCampaign(CG_Code);
            CT_Param_Value _p = new CT_Param_Value()
            {
                RP_Code       = _o.CG_RP_Code,
                PV_Type       = 1,
                PV_CG_Code    = _o.CG_Code,
                PV_UType      = AU_Type,
                PV_AD_OM_Code = AU_AD_OM_Code
            };
            BL_Reports R        = new BL_Reports();
            CT_Reports _r       = R.GetReplaceReport(_p);
            DataTable  dt_Query = BL_Reports.QueryExecution(_r.RP_Query);

            return(dt_Query);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取报表,以及报表相关的参数值=》名称、描述、query等;
        /// </summary>
        /// <param name="Param_value"></param>
        /// <returns></returns>
        public MD_ReportList GetReportValue(CT_Param_Value Param_value)
        {
            #region 参数
            SqlParameter[] _p = { new SqlParameter("@RP_Code",    SqlDbType.Int, 4),
                                  new SqlParameter("@PV_Type",    SqlDbType.Int, 4),
                                  new SqlParameter("@PV_CG_Code", SqlDbType.Int, 4),
                                  new SqlParameter("@PV_UType",   SqlDbType.Int, 4),
                                  new SqlParameter("@AD_Code",    SqlDbType.Int, 4),
                                  new SqlParameter("@DG_Code",    SqlDbType.Int, 4),
                                  new SqlParameter("@OM_Code",    SqlDbType.Int, 4), };
            _p[0].Value = Param_value.RP_Code;
            _p[1].Value = Param_value.PV_Type;
            _p[2].Value = Param_value.PV_CG_Code;
            _p[3].Value = Param_value.PV_UType;
            if (Param_value.PV_UType == 1)
            {
                _p[4].Value = Param_value.PV_AD_OM_Code;
                _p[5].Value = null;
                _p[6].Value = null;
            }
            else if (Param_value.PV_UType == 2)
            {
                _p[4].Value = null;
                _p[5].Value = Param_value.PV_AD_OM_Code;
                _p[6].Value = null;
            }
            else if (Param_value.PV_UType == 3)
            {
                _p[4].Value = null;
                _p[5].Value = null;
                _p[6].Value = Param_value.PV_AD_OM_Code;
            }
            #endregion
            DataSet ds = SqlHelper.ExecuteDataset(CommandType.StoredProcedure, "RP_GetReportValue", _p);

            MD_ReportList o = new MD_ReportList();
            o.CT_Reports_List = DataHelper.ConvertToList <CT_Reports>(ds);
            return(o);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 根据单一的Code获取报表对应的参数列表,和参数名称
        /// 供更改参数列表的窗体调用
        /// </summary>
        /// <param name="Intern"></param>
        /// <param name="Param_value"></param>
        /// <returns></returns>
        public MD_Paramterslist GetParamterslist(bool Intern, CT_Param_Value Param_value)
        {
            MD_ReportList MD_List = GetReportValue(Param_value);

            if (!Intern)
            {
                MD_List = ReportReplace.NameReplace(MD_List);
            }
            MD_Paramterslist Param = new MD_Paramterslist();

            Param.CT_Paramters_list = new List <CT_Paramters_list>();
            foreach (CT_Reports RE in MD_List.CT_Reports_List)
            {
                CT_Paramters_list p_List = new CT_Paramters_list();
                p_List.PL_Code      = RE.PL_Code;
                p_List.PL_Prompt_En = RE.PL_Prompt_En;
                p_List.PL_Type      = RE.PL_Type;
                p_List.PL_Default   = RE.PL_Default;
                Param.CT_Paramters_list.Add(p_List);
            }
            return(Param);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取替换成功后的Report,
        /// Name Desc 都做了替换 可以单独使用,也可供其他方式调用
        /// </summary>
        /// <param name="Intern"></param>
        /// <param name="Param_value"></param>
        /// <param name="Mode"></param>
        /// <param name="Paramterslist"></param>
        /// <returns></returns>
        public CT_Reports GetReplaceReport(bool Intern, CT_Param_Value Param_value, EM_ParameterMode Mode, string Paramterslist)
        {
            MD_ReportList MD_List = GetReportValue(Param_value);

            if (MD_List == null || MD_List.CT_Reports_List == null)
            {
                return(null);
            }
            if (!Intern)
            {
                MD_List = ReportReplace.NameReplace(MD_List);
            }
            MD_List = BL_ReportReplace.ReportParamReplace(MD_List, Mode, Paramterslist, Intern);
            CT_Reports Report = null;

            if (MD_List != null || MD_List.CT_Reports_List[0] != null)
            {
                Report          = MD_List.CT_Reports_List[0];
                Report.RP_Query = ReportReplace.ReportParamReplace(Report.RP_Query);
            }
            return(Report);
        }
Exemplo n.º 7
0
 /// <summary>
 /// 获取报表的相关的值,根据传递的Code
 /// 如果Pv_val 不为空,就将值赋值与PL_Default
 /// new CT_Param_Value() {
 /// RP_Code = RP_Code,
 /// PV_Type = 1/2,
 /// PV_CG_Code = CG_Code/EV_Code,
 /// PV_UType = UG_UType,
 /// PV_AD_OM_Code =DE_AD_OM_Code }
 /// </summary>
 /// <param name="Param_value"></param>
 /// <returns></returns>
 private MD_ReportList GetReportValue(CT_Param_Value Param_value)
 {
     return(_D_re.GetReportValue(Param_value));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 获取替换成功后的Report,
 /// Name Desc 都做了替换 可以单独使用,也可供其他方式调用
 /// </summary>
 /// <param name="Intern"></param>
 /// <param name="Param_value"></param>
 /// <returns></returns>
 public CT_Reports GetReplaceReport(bool Intern, CT_Param_Value Param_value)
 {
     return(GetReplaceReport(Intern, Param_value, EM_ParameterMode.Background, null));
 }
Exemplo n.º 9
0
 /// <summary>
 /// 获取替换成功后的Report,
 /// Name Desc 都做了替换 可以单独使用,也可供其他方式调用
 /// </summary>
 /// <param name="Param_value"></param>
 /// <returns></returns>
 public CT_Reports GetReplaceReport(CT_Param_Value Param_value)
 {
     return(GetReplaceReport(true, Param_value));
 }