Exemplo n.º 1
0
        public DataTable getEx_Data(int Pl_Code, IList <CRMTreeDatabase.EX_Param> eps)
        {
            try
            {
                CT_Reports   Report = RP.GetReprot_Chat(ChartType.List, Pl_Code);
                var          db     = CRMTreeDatabase.DBCRMTree.GetInstance();
                PetaPoco.Sql _s     = BL_Reports.GetReportSql(Report.RP_Code, eps);
                var          qData  = new object();
                if (_s.SQL.IndexOf(";Exec", StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    qData = db.Query <dynamic>(_s);
                }
                else
                {
                    var pSql = PetaPoco.Sql.Builder;
                    pSql.Append("select * from(" + _s.SQL, _s.Arguments);
                    pSql.Append(") as dt");
                    qData = db.Query <dynamic>(pSql);
                }

                //Report.RP_Query = _s.SQL;
                //DataTable dt = BL_Reports.GetReportSqlWithTemplate(Report.RP_Query);
                //return dt;
                string    _j_d = JsonConvert.SerializeObject(qData);
                DataTable _d   = ToDataTable(_j_d);
                return(_d);
            }
            catch
            {
                return(null);
            }
        }
Exemplo n.º 2
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.º 3
0
        /// <summary>
        /// 获取下载的数据
        /// </summary>
        /// <param name="Pl_Code"></param>
        /// <param name="PR"></param>
        /// <returns></returns>
        private DataTable getEx_Data(int Pl_Code, int PR)
        {
            CT_Reports Report = RP.GetReprot_Chat(ChartType.List, Pl_Code);
            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    = PR.ToString();
            ep.EX_DataType = "int";
            eps.Add(ep);

            Report.RP_Query = BL_Reports.GetReportSql(Report.RP_Code, eps).SQL;
            DataTable dt = BL_Reports.GetReportSqlWithTemplate(Report.RP_Query);

            return(dt);
        }