Beispiel #1
0
    private void setPieTitle()
    {
        //int RP_Code = int.Parse(Request.QueryString["MF_FL_FB_Code"].ToString());
        //int pr = 0;
        //try
        //{
        //    pr = int.Parse(Request.QueryString["PR"].ToString());
        //}
        //catch (Exception)
        //{
        //    pr = 0;
        //}
        //BL_HighCharts HC = new BL_HighCharts();
        //DataTable dt = HC.getPieTitle(RP_Code,pr);
        //if (dt != null || dt.Rows.Count != 0)
        //{
        //    PieTitle = dt.Rows[0]["FP_Title_EN"].ToString();
        //}
        int        PR = RequestClass.GetInt("PR", 0);
        CT_Reports Re = new BL_Reports().GetReplaceReport(Interna,
                                                          new CT_Param_Value()
        {
            RP_Code = RP_Code, PV_Type = PR, PV_CG_Code = -1, PV_UType = UserSession.User.UG_UType, PV_AD_OM_Code = UserSession.DealerEmpl.DE_AD_OM_Code
        });

        //string _title = HttpUtility.UrlDecode(RequestClass.GetString("Title"), Encoding.UTF8);
        if (!string.IsNullOrEmpty(Re.RP_Name_EN))
        {
            PieTitle = Re.RP_Name_EN;
        }
    }
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        if (!IsPostBack)
        {
            this.CrmTreetop.UserID = UserSession.User.AU_Code;
            AU_Code       = UserSession.User.AU_Code;
            AU_Type       = UserSession.User.UG_UType;
            AU_AD_OM_Code = UserSession.DealerEmpl.DE_AD_OM_Code;

            CurrentPage = new BL_TabLinkList().GetLevelLink(UserSession.User.AU_UG_Code, Request.RawUrl, Interna, out MI_Name);
        }

        if (Interna)
        {
            name_Table       = BL_Reports.GetValues("4103", "text_en");
            name_Table_value = BL_Reports.GetValues("4103", "value");
            name_Chart       = BL_Reports.GetValues("4104", "text_en");
            name_Chart_value = BL_Reports.GetValues("4104", "value");
        }
        else
        {
            name_Table       = BL_Reports.GetValues("4103", "text_cn");
            name_Table_value = BL_Reports.GetValues("4103", "value");
            name_Chart       = BL_Reports.GetValues("4104", "text_cn");
            name_Chart_value = BL_Reports.GetValues("4104", "value");
        }
    }
    private void GetFileContentByFileName(dynamic data)
    {
        string fileContent = string.Empty;

        //var exParams = new List<CRMTreeDatabase.EX_Param>();
        //var s_q = JsonConvert.SerializeObject(data.queryParams);
        //if (!string.IsNullOrWhiteSpace(s_q))
        //{
        //    exParams = JsonConvert.DeserializeObject<List<CRMTreeDatabase.EX_Param>>(s_q);
        //}
        var FileName = (string)data.FileName;
        var CG_Code  = (int)data.CG_Code;
        var AU_Code  = (int)data.AU_Code;

        fileContent = BL_Reports.GetFileContent(FileName, new
        {
            AU = AU_Code,
            CG = CG_Code,
            AD = null != UserSession.Dealer ? UserSession.Dealer.AD_Code : 0,
            DG = null != UserSession.Dealer ? UserSession.Dealer.AD_DG_Code : 0,
            OM = null != UserSession.OEM ? UserSession.OEM.OM_Code : 0,
            CT = 0,
            CI = 0,
            DE = null != UserSession.User ? UserSession.User.AU_Code : 0,
            AS = 0,
            PA = 0
        });
        Response.Write(fileContent);
    }
Beispiel #4
0
    public static string getFields_List_Code(int RP_Code)
    {
        BL_Reports RP  = new BL_Reports();
        string     err = RP.GetFields_List_Code(RP_Code);

        return(err);
    }
    private void Get_Dealer_Advisor_All()
    {
        var db  = DBCRMTree.GetInstance();
        var sql = BL_Reports.GetReportSql(131, null);
        var o   = db.Query <dynamic>(sql);

        Response.Write(JsonConvert.SerializeObject(o));
    }
Beispiel #6
0
    public int Expore_Ex(int Pl_Code, IList <CRMDB.EX_Param> _p_s, string fileName)
    {
        BL_Export   _b_ex = new BL_Export();
        NPOI_Common Excel = new NPOI_Common();

        //获取Title
        Excel.Ex_Titel     = _b_ex.getEx_Title(Pl_Code);
        Excel.Ex_FieldName = _b_ex.getFieldName(Pl_Code);
        Excel.Ex_Data      = _b_ex.getEx_Data(Pl_Code, _p_s);
        BL_Reports _bl_r   = new BL_Reports();
        DataTable  _type50 = _bl_r.GetExport_Type50(Pl_Code, 50);

        if (_type50 != null && _type50.Rows.Count > 0)
        {
            //FN_FieldName,FN_Desc_EN,FN_Desc_CN
            List <string> _Title_Field = new List <string>();
            List <string> _Title       = new List <string>();
            List <string> _Title_Data  = new List <string>();
            for (int i = 0; i < _type50.Rows.Count; i++)
            {
                _Title_Field.Add(_type50.Rows[i]["FN_FieldName"].ToString());
                if (Language.GetLang2() == EM_Language.en_us)
                {
                    _Title.Add(_type50.Rows[i]["FN_Desc_EN"].ToString());
                }
                else
                {
                    _Title.Add(_type50.Rows[i]["FN_Desc_CN"].ToString());
                }
            }
            for (int i = 0; i < Excel.Ex_Data.Columns.Count; i++)
            {
                _Title_Data.Add(Excel.Ex_Data.Columns[i].Caption);
            }
            foreach (string _t in _Title_Field)
            {
                Excel.Ex_FieldName.Remove(_t);
            }
            foreach (string _t in _Title)
            {
                Excel.Ex_Titel.Remove(_t);
            }
            foreach (string _t in _Title_Field)
            {
                foreach (string _t_t in _Title_Data)
                {
                    if (_t_t.StartsWith(_t))
                    {
                        Excel.Ex_Titel.Add(_t_t);
                        Excel.Ex_FieldName.Add(_t_t);
                    }
                }
            }
        }
        Excel.Create_Ex(fileName);
        Excel.Seave_Ex(fileName);
        return((int)_errCode.success);
    }
Beispiel #7
0
    public static Object getParamterslist(int RP_Code)
    {
        BL_Reports Report = new BL_Reports();

        return(Report.GetParamterslist(Intern, new CT_Param_Value()
        {
            RP_Code = RP_Code, PV_Type = 0, PV_CG_Code = -1, PV_UType = AU_Type, PV_AD_OM_Code = AU_AD_OM_Code
        }));
    }
Beispiel #8
0
    public static CT_Reports getReplaceReport(int CG_Code)
    {
        BL_Reports Report = new BL_Reports();

        return(Report.GetReplaceReport(Inter,
                                       new CT_Param_Value()
        {
            RP_Code = S_RP_Code, PV_Type = 2, PV_CG_Code = CG_Code, PV_UType = AU_Type, PV_AD_OM_Code = AU_AD_OM_Code
        }));
    }
Beispiel #9
0
    private void getReportData(dynamic data)
    {
        var    db          = DBCRMTree.GetInstance();
        var    RP_Code     = (int)data.RP_Code;
        object queryParams = data.queryParams;

        var sql = BL_Reports.GetReportSql(RP_Code, queryParams);

        var o = db.Query <dynamic>(sql);

        Response.Write(JsonConvert.SerializeObject(o));
    }
Beispiel #10
0
    /// <summary>
    /// 获取报表的详细信息,替换后的
    /// </summary>
    /// <returns></returns>
    private void Get_Report()
    {
        int        RP_Code = RequestClass.GetInt("RP_Code", 0);
        int        PR      = RequestClass.GetInt("PR", 0);
        CT_Reports Re      = new BL_Reports().GetReplaceReport(Interna,
                                                               new CT_Param_Value()
        {
            RP_Code = RP_Code, PV_Type = PR, PV_CG_Code = -1, PV_UType = UserSession.User.UG_UType, PV_AD_OM_Code = UserSession.DealerEmpl.DE_AD_OM_Code
        });


        Response.Write(JsonConvert.SerializeObject(Re));
    }
Beispiel #11
0
    public static CT_Reports getReplaceReports(string RP_Code, int CG_Code, string Paramterslist)
    {
        BL_Reports Report = new BL_Reports();

        return(Report.GetReplaceReport(
                   Inter,
                   new CT_Param_Value()
        {
            RP_Code = Convert.ToInt32(RP_Code), PV_Type = 2, PV_CG_Code = CG_Code, PV_UType = AU_Type, PV_AD_OM_Code = AU_AD_OM_Code
        },
                   EM_ParameterMode.Page,
                   Paramterslist));
    }
Beispiel #12
0
    /// <summary>
    ///  根据存储过程替换参数,并执行查询
    /// </summary>
    /// <param name="data">条件</param>
    private void DoProc(dynamic data)
    {
        var db = DBCRMTree.GetInstance();

        object queryParams   = data.queryParams;
        var    MF_FL_FB_Code = (int)data.MF_FL_FB_Code;

        var rp_code = BL_Reports.GetReportCode(MF_FL_FB_Code);
        var sql     = BL_Reports.GetReportSql(rp_code, queryParams);

        var items    = db.Query <dynamic>(sql);
        var pageInfo = JsonConvert.SerializeObject(new { total = 0, rows = items });

        Response.Write(pageInfo);
    }
Beispiel #13
0
        public static object getNextTime()
        {
            string QueryToGetReminderDate = "Select top 1 RT_Time from CT_Reminder_Timers where RT_AU_Code=" + AU_Code + " and RT_Status=1 order by RT_Time ASC";

            DataTable dt = BL_Reports.QueryExecution(QueryToGetReminderDate);

            if (dt != null && dt.Rows.Count > 0)
            {
                return(dt.Rows[0]["RT_Time"]);
            }
            else
            {
                return(null);
            }
        }
    private void GetFileContent(dynamic data)
    {
        string fileContent = string.Empty;

        var exParams = new List <CRMTreeDatabase.EX_Param>();
        var s_q      = JsonConvert.SerializeObject(data.queryParams);

        if (!string.IsNullOrWhiteSpace(s_q))
        {
            exParams = JsonConvert.DeserializeObject <List <CRMTreeDatabase.EX_Param> >(s_q);
        }
        var CG_Code = (int)data.CG_Code;

        fileContent = BL_Reports.GetFileContent(CG_Code, exParams);
        Response.Write(fileContent);
    }
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        if (!IsPostBack)
        {
            this.CrmTreetop.UserID = UserSession.User.AU_Code;
            AU_Code       = UserSession.User.AU_Code;
            AU_Type       = UserSession.User.UG_UType;
            AU_AD_OM_Code = UserSession.DealerEmpl.DE_AD_OM_Code;
        }

        name_Maintain_value    = BL_Reports.GetValues("4094", "value");
        name_Obtain_value      = BL_Reports.GetValues("4095", "value");
        name_Branding_value    = BL_Reports.GetValues("4096", "value");
        name_Events_value      = BL_Reports.GetValues("4097", "value");
        name_Surveys_value     = BL_Reports.GetValues("4098", "value");
        name_Reminders_value   = BL_Reports.GetValues("4099", "value");
        name_Newsletters_value = BL_Reports.GetValues("4100", "value");
        name_Tips_value        = BL_Reports.GetValues("4101", "value");

        if (Interna)
        {
            name_Maintain    = BL_Reports.GetValues("4094", "text_en");
            name_Obtain      = BL_Reports.GetValues("4095", "text_en");
            name_Branding    = BL_Reports.GetValues("4096", "text_en");
            name_Events      = BL_Reports.GetValues("4097", "text_en");
            name_Surveys     = BL_Reports.GetValues("4098", "text_en");
            name_Reminders   = BL_Reports.GetValues("4099", "text_en");
            name_Newsletters = BL_Reports.GetValues("4100", "text_en");
            name_Tips        = BL_Reports.GetValues("4101", "text_en");
        }
        else
        {
            name_Maintain    = BL_Reports.GetValues("4094", "text_cn");
            name_Obtain      = BL_Reports.GetValues("4095", "text_cn");
            name_Branding    = BL_Reports.GetValues("4096", "text_cn");
            name_Events      = BL_Reports.GetValues("4097", "text_cn");
            name_Surveys     = BL_Reports.GetValues("4098", "text_cn");
            name_Reminders   = BL_Reports.GetValues("4099", "text_cn");
            name_Newsletters = BL_Reports.GetValues("4100", "text_cn");
            name_Tips        = BL_Reports.GetValues("4101", "text_cn");
        }
        bindData();
    }
    private void Get_CustomerInfo(dynamic data)
    {
        dynamic o = new ExpandoObject();

        var hd_code = (int)data.HD_Code;

        var db = DBCRMTree.GetInstance();

        o.service = db.SingleOrDefault <dynamic>(@"SELECT hd.*
        ,ch.*
        ,ch.CH_CI_Code as CI_Code
        ,AU_Name
        ,PL_Number
        ,PL_Code
        ,CM_FileName
        ,CG_Type
        ,CG_Cat
        FROM CT_Handler hd 
        LEFT JOIN CT_Comm_History ch ON hd.HD_CH_Code = ch.CH_Code
        LEFT JOIN CT_All_Users au ON ch.CH_AU_Code = au.AU_Code
        LEFT JOIN CT_Phone_List pl ON ch.CH_ML_PL_Code = pl.PL_Code
        LEFT JOIN CT_Campaigns on ch.CH_CG_Code=CG_Code 
        LEFT JOIN CT_Camp_Methods on ch.CH_CG_Code=CM_CG_Code and ch_CG_M_Indx=CM_Contact_Index
        WHERE HD_Code = @0 ", hd_code);

        if (null != o.service)
        {
            o.fileContent = BL_Reports.GetFileContent(o.service.CH_CG_Code, o.service.CH_CG_M_Indx, new
            {
                AU = o.service.CH_AU_Code,
                CG = o.service.CH_CG_Code,
                AD = null != UserSession.Dealer ? UserSession.Dealer.AD_Code : 0,
                DG = null != UserSession.Dealer ? UserSession.Dealer.AD_DG_Code : 0,
                OM = null != UserSession.OEM ? UserSession.OEM.OM_Code : 0,
                CT = 0,
                CI = 0,
                DE = o.service.HD_AU_Code,
                AS = 0,
                PA = 0
            });
        }

        Response.Write(JsonConvert.SerializeObject(o));
    }
Beispiel #17
0
    /// <summary>
    /// 分页
    /// </summary>
    /// <param name="data">分页条件</param>
    private void DoPage(dynamic data)
    {
        Page <dynamic> pager = new Page <dynamic>();

        pager.Items = new List <dynamic>();

        var db = DBCRMTree.GetInstance();

        object queryParams   = data.queryParams;
        var    MF_FL_FB_Code = (int)data.MF_FL_FB_Code;

        var rp_code = BL_Reports.GetReportCode(MF_FL_FB_Code);
        var sql     = BL_Reports.GetReportSql(rp_code, queryParams);

        var dataInfo = string.Empty;

        if (sql.SQL.IndexOf(";Exec", StringComparison.OrdinalIgnoreCase) >= 0)
        {
            var qData = db.Query <dynamic>(sql);
            dataInfo = JsonConvert.SerializeObject(new { total = qData.Count(), rows = qData });
        }
        else
        {
            var pSql  = PetaPoco.Sql.Builder;
            var sort  = (string)data.sort;
            var order = (string)data.order;

            pSql.Append("select * from(" + sql.SQL, sql.Arguments);
            pSql.Append(") as dt");
            if (!string.IsNullOrWhiteSpace(sort))
            {
                pSql.Append(string.Format(" order by {0} {1}", sort, order));
            }

            pager = db.Page <dynamic>((long)data.pageNumber, (long)data.pageSize, pSql);
            //pager.Items[0].Results = "<div style=\"width:100%;height:100%\">100<span class=\"SType50\" />75<span class=\"SType50\" />45</div>";

            dataInfo = JsonConvert.SerializeObject(new { total = pager.TotalItems, rows = pager.Items });
        }


        Response.Write(dataInfo);
    }
    private void Get_run_file_list(dynamic data)
    {
        string _file_url = data.file_url;

        _file_url = Microsoft.JScript.GlobalObject.unescape(_file_url);
        string _fileCount = Files.FileContext(HttpContext.Current.Request.PhysicalApplicationPath + "\\" + _file_url).Replace("\"", "'");

        if (data.AU_Code != null && ((string)data.AU_Code) != "")
        {
            List <CRMTreeDatabase.EX_Param> exParams = new List <CRMTreeDatabase.EX_Param>();
            exParams.Add(new CRMTreeDatabase.EX_Param()
            {
                EX_DataType = "int", EX_Name = "AU", EX_Value = (string)data.AU_Code
            });
            _fileCount = BL_Reports.GetRunFileContent(_fileCount, exParams, 2);
        }

        _fileCount = Microsoft.JScript.GlobalObject.escape(_fileCount);
        string _d = JsonConvert.SerializeObject(_fileCount);

        Response.Write(_d);
    }
    private void Get_view_file(dynamic data)
    {
        int         _au_code = (int)data.AU_Code;
        int         _ap_code = (int)data.AP_Code;
        BL_Campaign _bl_cam  = new BL_Campaign();

        CRMTree.Model.CT_Campaigns _o = _bl_cam.GetTXCam(UserSession.DealerEmpl.DE_UType, UserSession.DealerEmpl.DE_AD_OM_Code);

        string _fileCount = string.Empty;

        if (data.AU_Code != null && ((string)data.AU_Code) != "" && !string.IsNullOrEmpty(_o.CM_Filename))
        {
            List <CRMTreeDatabase.EX_Param> exParams = new List <CRMTreeDatabase.EX_Param>();
            exParams.Add(new CRMTreeDatabase.EX_Param()
            {
                EX_DataType = "int", EX_Name = "AU", EX_Value = (string)data.AU_Code
            });
            exParams.Add(new CRMTreeDatabase.EX_Param()
            {
                EX_DataType = "int", EX_Name = "AD", EX_Value = UserSession.DealerEmpl.DE_AD_OM_Code.ToString()
            });
            exParams.Add(new CRMTreeDatabase.EX_Param()
            {
                EX_DataType = "int", EX_Name = "AP", EX_Value = (string)data.AP_Code
            });
            _fileCount = BL_Reports.GetFileContent(_o.CM_Filename, exParams, 2);
        }
        _fileCount = Microsoft.JScript.GlobalObject.escape(_fileCount);
        CRMTree.Model.CT_All_Users _oo = _bl_cam.GetTXCam_Number(_au_code, _ap_code);
        string _pl_number = "";

        if (_oo != null && !string.IsNullOrEmpty(_oo.PL_Number))
        {
            _pl_number = _oo.PL_Number;
        }
        Response.Write(JsonConvert.SerializeObject(new { _con = _fileCount, _pl = _pl_number }));
    }
    public void bindData()
    {
        Dictionary <string, string> dicTemp = new Dictionary <string, string>();

        foreach (DataRow dr in BL_Reports.GetRegardingTables(name_Maintain_value).AsEnumerable())
        {
            ls_name_Maintain.Add(dr["CG_Title"].ToString(), dr["CG_FileName"].ToString() + "_" + dr["CG_Code"].ToString());
        }
        foreach (DataRow dr in BL_Reports.GetRegardingTables(name_Obtain_value).AsEnumerable())
        {
            ls_name_Obtain.Add(dr["CG_Title"].ToString(), dr["CG_FileName"].ToString() + "_" + dr["CG_Code"].ToString());
        }
        foreach (DataRow dr in BL_Reports.GetRegardingTables(name_Branding_value).AsEnumerable())
        {
            ls_name_Branding.Add(dr["CG_Title"].ToString(), dr["CG_FileName"].ToString() + "_" + dr["CG_Code"].ToString());
        }
        foreach (DataRow dr in BL_Reports.GetRegardingTables(name_Events_value).AsEnumerable())
        {
            ls_name_Events.Add(dr["CG_Title"].ToString(), dr["CG_FileName"].ToString() + "_" + dr["CG_Code"].ToString());
        }
        foreach (DataRow dr in BL_Reports.GetRegardingTables(name_Surveys_value).AsEnumerable())
        {
            ls_name_Surveys.Add(dr["CG_Title"].ToString(), dr["CG_FileName"].ToString() + "_" + dr["CG_Code"].ToString());
        }
        foreach (DataRow dr in BL_Reports.GetRegardingTables(name_Reminders_value).AsEnumerable())
        {
            ls_name_Reminders.Add(dr["CG_Title"].ToString(), dr["CG_FileName"].ToString() + "_" + dr["CG_Code"].ToString());
        }
        foreach (DataRow dr in BL_Reports.GetRegardingTables(name_Newsletters_value).AsEnumerable())
        {
            ls_name_Newsletters.Add(dr["CG_Title"].ToString(), dr["CG_FileName"].ToString() + "_" + dr["CG_Code"].ToString());
        }
        foreach (DataRow dr in BL_Reports.GetRegardingTables(name_Tips_value).AsEnumerable())
        {
            ls_name_Tips.Add(dr["CG_Title"].ToString(), dr["CG_FileName"].ToString() + "_" + dr["CG_Code"].ToString());
        }
    }
Beispiel #21
0
        public string getReprotQuery(int RP_Code)
        {
            BL_Reports RE = new BL_Reports();

            return(RE.GetReplaceReport(RP_Code).RP_Query);
        }
Beispiel #22
0
    private void list_report()
    {
        //排序字段   string C1,string C2,
        string strSortField = RequestClass.GetString("sortfield").Trim().Replace("'", "");
        //排序规则
        string strSortRule = RequestClass.GetString("sortrule").Trim().Replace("'", "");

        string C1 = RequestClass.GetString("C1").Trim().Replace("'", "");
        string C2 = RequestClass.GetString("C2").Trim().Replace("'", "");
        string C  = RequestClass.GetString("C").Trim().Replace("'", "");

        string RP_Cat = "RP_Cat1=1 and RP_Cat2=1";

        if (C1.Length <= 0 && C2.Length > 0)
        {
            RP_Cat = "RP_Cat2 in (" + C2 + ") and (RP_Cat3 is null or RP_Cat3 <13)";
        }
        if (C2.Length <= 0 && C1.Length > 0)
        {
            RP_Cat = "RP_Cat1 in (" + C1 + ") and (RP_Cat3 is null or RP_Cat3 <13)";
        }
        if (C1.Length > 0 && C2.Length > 0)
        {
            RP_Cat = "RP_Cat1 in (" + C1 + ") and RP_Cat2 in (" + C2 + ") and (RP_Cat3 is null or RP_Cat3 <13)";
        }

        if (C == "1")
        {
            if (C1.Length <= 0 && C2.Length > 0)
            {
                RP_Cat = "RP_Cat2 in (" + C2 + ") and RP_Cat3 >= 13";
            }
            if (C2.Length <= 0 && C1.Length > 0)
            {
                RP_Cat = "RP_Cat1 in (" + C1 + ") and RP_Cat3 >= 13";
            }
            if (C1.Length > 0 && C2.Length > 0)
            {
                RP_Cat = "RP_Cat1 in (" + C1 + ") and RP_Cat2 in (" + C2 + ") and  RP_Cat3 >= 13";
            }
            //string[] CC1 = C1.Split(',');
            //C1 = "";
            //for (int i = 0; i <CC1.Length; i++)
            //{
            //    C1 = C1+"1" + CC1[i].Trim();
            //    if (i < CC1.Length-1) { C1 = C1 + ","; }
            //}
        }

        //排序字段的样式
        string orderClass = String.Empty;

        if (string.IsNullOrEmpty(strSortField))
        {
            strSortField = "RP_Update_dt";
            strSortRule  = "desc";
            orderClass   = "taxisDown";
        }
        else
        {
            if (strSortRule.Equals("asc"))
            {
                orderClass = "taxisUp";
            }
            else
            {
                orderClass = "taxisDown";
            }
        }
        string        Rp_Names    = Interna ? IN_Language.RP_Name(EM_Language.en_us) : IN_Language.RP_Name(EM_Language.zh_cn);
        string        Description = Interna ? IN_Language.RP_Description(EM_Language.en_us) : IN_Language.RP_Description(EM_Language.zh_cn);
        string        Update_dt   = Interna ? IN_Language.RP_UpdateDate(EM_Language.en_us) : IN_Language.RP_UpdateDate(EM_Language.zh_cn);
        string        Operate     = Interna ? IN_Language.CGL_Operate(EM_Language.en_us) : IN_Language.CGL_Operate(EM_Language.zh_cn);
        StringBuilder sbList      = new StringBuilder();

        sbList.Append("<table class=\"t-bd\" Style=\"width:100%\"><tr>");
        sbList.Append("<th style=\"cursor:pointer;width:270px;\" ");
        sbList.Append("class=\"w40\" onclick=\"changeOrder(this,'RP_Name_EN')\">" + Rp_Names + "<span class=\"taxis\" title=\"Sort by the column \"></span></th>");
        sbList.Append("<th>" + Description + "</th>");
        sbList.Append("<th style=\"cursor:pointer;width:120px\" ");
        if (strSortField.Equals("RP_Update_dt"))
        {
            sbList.Append("class=\"taxisCurrent\" onclick=\"changeOrder(this,'RP_Update_dt')\">" + Update_dt + "<span class=\"");
            sbList.Append(orderClass);
            sbList.Append("\" title=\"Sort by the column \"></span></th>");
        }
        else
        {
            sbList.Append(" onclick=\"changeOrder(this,'RP_Update_dt')\">" + Update_dt + "<span class=\"taxis\" title=\"Sort by the column \"></span></th>");
        }
        sbList.Append("<th class=\"w100\">" + Operate + "</th>");
        //初始化变量
        int        intRowsCount   = 0;                                    //总行数
        int        intPageCount   = 0;                                    //总页数
        int        intCurrentPage = RequestClass.GetInt("page", 1);       //当前页
        int        intPageSize    = RequestClass.GetInt("pagesize", 10);; //每页条数
        BL_Reports rp             = new BL_Reports();

        DataTable dtTemp = new DataTable();

        System.Collections.Generic.List <string> lsTemp = new System.Collections.Generic.List <string>();
        bool CharOrNot = false;

        if (C == "1")
        {
            string LimitQuery = string.Empty;
            if (C1.Length <= 0 && C2.Length > 0)
            {
                LimitQuery = "RP_Cat2 in (" + C2 + ") and RP_Cat3 > 12";
            }
            if (C2.Length <= 0 && C1.Length > 0)
            {
                LimitQuery = "RP_Cat1 in (" + C1 + ") and RP_Cat3 > 12";
            }
            if (C1.Length > 0 && C2.Length > 0)
            {
                LimitQuery = "RP_Cat1 in (" + C1 + ") and RP_Cat2 in (" + C2 + ") and RP_Cat3  > 12";
            }
            string Query = "select RP_Code,FB_Code,RP_Cat3 from (Select (Select CASE"
                           + " When RP_Cat3 = 13 then"
                           + " (Select top 1 FB_Code From CT_Reports Join CT_Fields_Bar on FB_RP_Code=RP_Code where RP_Code=RP.RP_Code)"
                           + " When RP_Cat3 in (16,17) then"
                           + " (Select top 1 FP_Code From CT_Reports Join CT_Fields_Pie on FP_RP_Code=RP_Code where RP_Code=RP.RP_Code)"
                           + " When RP_Cat3 = 18 then"
                           + " (Select top 1 FS_Code From CT_Reports Join CT_Fields_Sch on FS_RP_Code=RP_Code where RP_Code=RP.RP_Code)"
                           + " When RP_Cat3 = 19 then"
                           + " (Select top 1 FM_Code From CT_Reports Join CT_Fields_MultiChart on FM_RP_Code=RP_Code where RP_Code=RP.RP_Code)"
                           + " When RP_Cat3 = 20 then"
                           + " (Select top 1 FG_Code From CT_Reports Join CT_Fields_Gauge on FG_RP_Code=RP_Code where RP_Code=RP.RP_Code)"
                           + " END"
                           + ") AS FB_Code"
                           + ",RP_Code,RP_Cat1,RP_Cat2,RP_Cat3 from CT_Reports RP) as Temp where ISNULL(Temp.FB_Code,0)!=0 and " + LimitQuery;

            dtTemp = BL_Reports.GetFieldsByQuery(Query);

            if (dtTemp != null && dtTemp.Rows.Count != 0)
            {
                foreach (DataRow dr in dtTemp.AsEnumerable())
                {
                    lsTemp.Add(dr["RP_Code"].ToString());
                }
            }
            CharOrNot = true;
        }

        IList <CT_Reports> RList = rp.GetReportList(Interna, UserSession.User.UG_UType, UserSession.DealerEmpl.DE_AD_OM_Code, strSortField, strSortRule, intCurrentPage, intPageSize, RP_Cat, out intPageCount, out intRowsCount, CharOrNot);

        if (null != RList && RList.Count > 0)
        {
            //生成分页html
            var strPager = new StringBuilder();
            if (1 < intPageCount)
            {
                strPager = Pager.JavascriptPagination(true, intCurrentPage, intPageCount, intRowsCount);
            }

            List <string> lsT = new List <string>();

            for (int i = 0; i < RList.Count; i++)
            {
                var intID = RList[i].RP_Code;
                if (lsT != null && lsT.Contains(intID.ToString()))
                {
                    continue;
                }
                else
                {
                    lsT.Add(intID.ToString());
                }

                if (dtTemp != null && dtTemp.Rows.Count > 0)
                {
                    if (lsTemp.Contains(intID.ToString()))
                    {
                        System.Collections.Generic.List <Int16> ls = new System.Collections.Generic.List <Int16>();
                        ls = (from ss in dtTemp.AsEnumerable()
                              where ss.Field <int>("RP_Code") == Convert.ToInt32(intID)
                              select ss.Field <Int16>("FB_Code")).ToList();
                        foreach (int fbcode in ls)
                        {
                            var intRows = i + 1;
                            sbList.Append("<tr><td style=\"text-align:left\" title='" + RList[i].RP_Name_EN + "'>");
                            if (RList[i].RP_Name_EN != null)
                            {
                                sbList.Append(RList[i].RP_Name_EN.Length > 60 ? RList[i].RP_Name_EN.Substring(0, 60) : RList[i].RP_Name_EN);
                            }
                            else
                            {
                                sbList.Append(RList[i].RP_Desc_EN);
                            }
                            sbList.Append("</td><td style=\"text-align:left\" title='" + RList[i].RP_Desc_EN + "'>");
                            if (RList[i].RP_Desc_EN != null)
                            {
                                sbList.Append(RList[i].RP_Desc_EN.Length > 60 ? RList[i].RP_Desc_EN.Substring(0, 60) : RList[i].RP_Desc_EN);
                            }
                            else
                            {
                                sbList.Append(RList[i].RP_Desc_EN);
                            }
                            sbList.Append("</td><td>");
                            var RP_Update_dt = RList[i].RP_Update_dt.ToString("MM/dd/yyyy HH:mm:ss");
                            RP_Update_dt = RP_Update_dt == "01/01/0001 00:00:00" ? "" : RP_Update_dt;

                            sbList.Append(RP_Update_dt);
                            sbList.Append("</td><td>");
                            var dis = RList[i].PL_Code.ToString() == "0" ? "disable" : "";
                            if (string.IsNullOrEmpty(dis))
                            {
                                sbList.Append("<a href=\"javascript:;\"><i class=\"btnModify " + dis + "\" title=\"edit\" onclick=\"EditTags(");
                                sbList.Append(intID);
                                sbList.Append(")\"></i></a>");
                            }
                            else
                            {
                                sbList.Append("<a href=\"javascript:;\"><i class=\"btnModify " + dis + "\" title=\"edit\" ></i></a>");
                            }
                            sbList.Append("<a href=\"javascript:;\"><i class=\"btnRun\" title=\"Run\" _hidUrl=\"" + GetRunUrl(fbcode, dtTemp, RList[i].RP_Name_EN) + "\" onclick=\"Runs(");
                            sbList.Append(fbcode.ToString());
                            sbList.Append(",'");
                            sbList.Append(RList[i].RP_Name_EN);
                            sbList.Append("','");
                            sbList.Append(RList[i].RP_Name_CN);
                            sbList.Append("','");
                            sbList.Append(GetRunUrl(fbcode, dtTemp, RList[i].RP_Name_EN));
                            sbList.Append("')\"></i></a>");
                            sbList.Append("</td></tr>");
                        }
                    }
                }
                else
                {
                    var intRows = i + 1;
                    sbList.Append("<tr><td style=\"text-align:left\" title='" + RList[i].RP_Name_EN + "'>");
                    if (RList[i].RP_Name_EN != null)
                    {
                        sbList.Append(RList[i].RP_Name_EN.Length > 60 ? RList[i].RP_Name_EN.Substring(0, 60) : RList[i].RP_Name_EN);
                    }
                    else
                    {
                        sbList.Append(RList[i].RP_Desc_EN);
                    }
                    sbList.Append("</td><td style=\"text-align:left\" title='" + RList[i].RP_Desc_EN + "'>");
                    if (RList[i].RP_Desc_EN != null)
                    {
                        sbList.Append(RList[i].RP_Desc_EN.Length > 60 ? RList[i].RP_Desc_EN.Substring(0, 60) : RList[i].RP_Desc_EN);
                    }
                    else
                    {
                        sbList.Append(RList[i].RP_Desc_EN);
                    }
                    sbList.Append("</td><td>");
                    var RP_Update_dt = RList[i].RP_Update_dt.ToString("MM/dd/yyyy HH:mm:ss");
                    RP_Update_dt = RP_Update_dt == "01/01/0001 00:00:00" ? "" : RP_Update_dt;
                    sbList.Append(RP_Update_dt);
                    sbList.Append("</td><td>");
                    var dis = RList[i].PL_Code.ToString() == "0" ? "disable" : "";
                    if (string.IsNullOrEmpty(dis))
                    {
                        sbList.Append("<a href=\"javascript:;\"><i class=\"btnModify " + dis + "\" title=\"edit\" onclick=\"EditTags(");
                        sbList.Append(intID);
                        sbList.Append(")\"></i></a>");
                    }
                    else
                    {
                        sbList.Append("<a href=\"javascript:;\"><i class=\"btnModify " + dis + "\" title=\"edit\" ></i></a>");
                    }
                    sbList.Append("<a href=\"javascript:;\"><i class=\"btnRun\" _hidUrl=\"" + intID + "\" title=\"Run\" onclick=\"Runs(");
                    sbList.Append(intID);
                    sbList.Append(",'");
                    sbList.Append(RList[i].RP_Name_EN);
                    sbList.Append("','");
                    sbList.Append(RList[i].RP_Name_CN);
                    sbList.Append("')\"></i></a>");
                    sbList.Append("</td></tr>");
                }
            }
            sbList.Append("</table>");
            sbList.Append(strPager);
        }
        else
        {
            sbList.Append("<tr ><td colspan=\"10\"><div class=\"noData\">No matching data!</div></td></tr>");
            sbList.Append("</tbody>");
            sbList.Append("</table>");
        }
        Response.Write(sbList);
    }
Beispiel #23
0
        public ActionResult LoadCashFlowTable(JQueryDataTableParamModel Param)
        {
            MYJSONTblCustom MYJSON = BL_Reports.LoadCashFlowTable(Param, Request);

            return(Json(MYJSON, JsonRequestBehavior.AllowGet));
        }
Beispiel #24
0
        private void SendWechatInfo_01(dynamic data)
        {
            string OpenId    = _http.Session["OpenId"].ToString();
            string send_info = "尊敬的车主,您好!\n"
                               + (string.IsNullOrEmpty((string)data.AP_Code) ? "你的预约信息成功处理\n如下是你的预约信息:\n" : "你的预约信息成功修改\n如下是你更改后的预约信息:\n")
                               + "我的汽车:" + data.CAR_CN + "\n"
                               + "经 销 商:" + data.AD_Name_CN + "\n"
                               + "选择顾问:" + data.AU_Name + "\n"
                               + "预约类型:" + data.SER_CN + "\n"
                               + "交通方式:" + data.AP_Tran_Name + "\n"
                               + "预约时间:" + Convert.ToDateTime(data.AP_Time) + "\n";

            wechatHandle.SendCustom_text(OpenId, send_info);
            CT_Campaigns _com;

            try
            {
                _com = _b_camp.GetCampaign(Convert.ToInt32(data.AD_Code), true);
            }
            catch
            {
                _com = _b_camp.GetCampaign(3, true);
            }
            if (_com != null)
            {
                List <CRMTreeDatabase.EX_Param> exParams = new List <CRMTreeDatabase.EX_Param>();
                exParams.Add(new CRMTreeDatabase.EX_Param()
                {
                    EX_DataType = "int",
                    EX_Name     = "AU",
                    EX_Value    = data.AU_Code
                });
                exParams.Add(new CRMTreeDatabase.EX_Param()
                {
                    EX_DataType = "int",
                    EX_Name     = "CI",
                    EX_Value    = data.CI_Code
                });
                exParams.Add(new CRMTreeDatabase.EX_Param()
                {
                    EX_DataType = "int",
                    EX_Name     = "AP",
                    EX_Value    = data.AP_Code
                });
                exParams.Add(new CRMTreeDatabase.EX_Param()
                {
                    EX_DataType = "int",
                    EX_Name     = "AD",
                    EX_Value    = data.AD_Code
                });
                exParams.Add(new CRMTreeDatabase.EX_Param()
                {
                    EX_DataType = "int",
                    EX_Name     = "DE",
                    EX_Value    = data.SA_Selected
                });
                exParams.Add(new CRMTreeDatabase.EX_Param()
                {
                    EX_DataType = "int",
                    EX_Name     = "ST",
                    EX_Value    = data.ST_Code
                });
                exParams.Add(new CRMTreeDatabase.EX_Param()
                {
                    EX_DataType = "int",
                    EX_Name     = "SC",
                    EX_Value    = data.SC_Code
                });
                exParams.Add(new CRMTreeDatabase.EX_Param()
                {
                    EX_DataType = "int",
                    EX_Name     = "MP",
                    EX_Value    = data.MP_Code
                });
                wechatHandle.SendCustom_text(OpenId, BL_Reports.GetFileContent(_com.CG_Filename,
                                                                               exParams, 2));
                _b_camp.Modify_Comm_History(1, OpenId, _com.CG_Code);
            }
        }