Exemple #1
0
    private void Get_Main_Search(dynamic data)
    {
        var q       = (string)data.q;
        var type    = (int)data.type;
        var rp_code = type == 1 ? 47 : 46;

        CRMTree.Function fun = new CRMTree.Function();
        var sql = fun.getReprotQuery(rp_code);

        var db    = DBCRMTree.GetInstance();
        var items = db.Query <dynamic>(sql, q);

        Response.Write(JsonConvert.SerializeObject(items));
    }
    /// <summary>
    /// 获得简要客户信息,供筛选用
    /// </summary>
    /// <param name="data"></param>
    private void Get_Customer(dynamic data)
    {
        var q = (string)data.q;

        if (string.IsNullOrWhiteSpace(q))
        {
            return;
        }
        CRMTree.Function fun = new CRMTree.Function();
        var sql   = fun.getReprotQuery(44);
        var db    = DBCRMTree.GetInstance();
        var items = db.Query <dynamic>(sql, q);

        Response.Write(JsonConvert.SerializeObject(items));
    }
Exemple #3
0
 private void GetLenDonData(dynamic data)
 {
     try
     {
         var sql_query        = string.Empty;
         CRMTree.Function fun = new CRMTree.Function();
         sql_query = fun.getReprotQuery((int)data.rp_code);
         var db = DBCRMTree.GetInstance();
         var o  = db.Query <dynamic>(sql_query, (int)data.up_code);
         Response.Write(JsonConvert.SerializeObject(o));
     }
     catch (Exception)
     {
         throw new Exception(Interna ? "Get the query exception!" : "获得查询语句异常!");
     }
 }
Exemple #4
0
    private IEnumerable <dynamic> GetSearch(int MF_FL_FB_Code)
    {
        var db      = DBCRMTree.GetInstance();
        var searchs = db.Fetch <CT_Frame_Sel_Row>(@"SELECT  FS_Code ,
        FS_FL_Code ,
        FS_Type ,
        FS_Param ,
        FS_Title_EN,
        FS_Title_CN,
        FS_RP_Code ,
        FS_Default ,
        FS_Order ,
        FS_Class ,
        FS_Option ,
        FS_Style ,
        FS_DataType FROM CT_Frame_Sel_Row
        where FS_FL_Code = @0 AND ISNULL(FS_ShowFlag,1) = 1
        order by FS_Order", MF_FL_FB_Code);

        if (searchs.Count() > 0)
        {
            var sql_query        = string.Empty;
            CRMTree.Function fun = new CRMTree.Function();

            foreach (CT_Frame_Sel_Row search in searchs)
            {
                try
                {
                    if (search.FS_RP_Code > 0)
                    {
                        sql_query      = fun.getReprotQuery((int)search.FS_RP_Code);
                        search.EX_Data = db.Query <dynamic>(sql_query);
                    }
                }
                catch (Exception)
                {
                    throw new Exception(Interna ? "Get the query exception!" : "获得查询语句异常!");
                }
            }
        }
        return(searchs);
    }