コード例 #1
0
    /// <summary>
    /// 获取省市区信息 wyh 2014.06.03 add 获取是省市区基本信息
    /// </summary>
    /// <returns>包含省市区信息的Dataset</returns>
    public DataSet dsSSQ()
    {
        DataSet   dsssq    = new DataSet();
        I_Dblink  I_DBL    = (new DBFactory()).DbLinkSqlMain("");
        DataSet   ds       = new DataSet();
        Hashtable htresult = new Hashtable();
        //获取省市区
        DataTable dt_sheng = new DataTable("省");

        htresult = I_DBL.RunProc("select p_number as 省编号,p_namestr as 省名,'0' as 省标记 from AAA_CityList_Promary", "省");
        dt_sheng = ((DataSet)htresult["return_ds"]).Tables["省"].Copy();


        DataTable dt_shi = new DataTable("市");

        htresult = I_DBL.RunProc("select AAA_CityList_City.c_number as 市编号,AAA_CityList_City.c_namestr as 市名,AAA_CityList_City.p_number as 所属省编号,(select AAA_CityList_Promary.p_namestr from AAA_CityList_Promary where AAA_CityList_Promary.p_number=AAA_CityList_City.p_number) as 所属省名 from AAA_CityList_City", "市");
        dt_shi   = ((DataSet)htresult["return_ds"]).Tables["市"].Copy();


        DataTable dt_qu = new DataTable("区");

        htresult = I_DBL.RunProc("select AAA_CityList_qu.q_number as 区编号,AAA_CityList_qu.q_namestr as 区名,AAA_CityList_qu.c_number as 所属市编号,(select AAA_CityList_City.c_namestr from AAA_CityList_City where AAA_CityList_qu.c_number=AAA_CityList_City.c_number) as 所属市名 from AAA_CityList_qu", "区");
        dt_qu    = ((DataSet)htresult["return_ds"]).Tables["区"].Copy();

        dsssq.Tables.Add(dt_sheng);
        dsssq.Tables.Add(dt_shi);
        dsssq.Tables.Add(dt_qu);
        return(dsssq);
    }
コード例 #2
0
    /// <summary>
    /// 获取动态参数
    /// </summary>
    /// <returns></returns>
    public DataSet GetDynamicParameters()
    {
        DataSet paras = new DataSet();

        I_Dblink  I_DBL    = (new DBFactory()).DbLinkSqlMain("");
        Hashtable htresult = new Hashtable();

        DataTable dt_paras = new DataTable("动态参数");

        htresult = I_DBL.RunProc("SELECT [XM] as 项目,[SZ] as 数值 FROM pDTCSB  WHERE [SFYX]='是'", "动态参数");
        dt_paras = ((DataSet)htresult["return_ds"]).Tables["动态参数"].Copy();

        paras.Tables.Add(dt_paras);
        return(paras);
    }
コード例 #3
0
    /// <summary>
    /// 获取商品分类为初始化
    /// </summary>
    /// <returns></returns>
    public DataSet GetInitFL()
    {
        DataSet paras = new DataSet();

        I_Dblink  I_DBL    = (new DBFactory()).DbLinkSqlMain("");
        Hashtable htresult = new Hashtable();

        DataTable dt_paras = new DataTable("商品分类");

        htresult = I_DBL.RunProc("SELECT *,dbo.fn_Sort_Tree(SortName,SortParentPath,',',(SELECT COUNT(0) FROM pSPLBB B WHERE B.SortParentID=A.SortParentID AND B.SortOrder>A.SortOrder)) AS SortNameTree,(SELECT COUNT(0) FROM pSPLBB B WHERE B.SortParentID=A.SortParentID AND B.SortOrder<A.SortOrder) AS SortMoveUp,(SELECT -COUNT(0) FROM pSPLBB B where B.SortParentID=A.SortParentID AND B.SortOrder>A.SortOrder) AS SortMoveDown FROM pSPLBB A  where m_show='不隐藏' order by SortOrder ASC", "商品分类");
        dt_paras = ((DataSet)htresult["return_ds"]).Tables["商品分类"].Copy();

        paras.Tables.Add(dt_paras);
        return(paras);
    }
コード例 #4
0
    /// <summary>
    /// 判断商品是否有效
    /// </summary>
    /// <param name="pridID"></param>
    /// <returns></returns>
    public bool ValPrd(string pridID)
    {
        I_Dblink  I_DBL    = (new DBFactory()).DbLinkSqlMain("");
        Hashtable htresult = new Hashtable();

        DataTable dt_prds = new DataTable("商品列表");

        htresult = I_DBL.RunProc("select SPZT from pSPXXB where PrdID='" + pridID + "'", "商品列表");
        dt_prds  = ((DataSet)htresult["return_ds"]).Tables["商品列表"].Copy();

        if (dt_prds.Rows.Count > 0 && dt_prds.Rows[0]["SPZT"].ToString().Trim() == "T")
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
コード例 #5
0
    /// <summary>
    /// 获取所有商品名称
    /// </summary>
    /// <returns></returns>
    public DataSet GetAllSPBH()
    {
        DataSet paras = new DataSet();

        I_Dblink  I_DBL    = (new DBFactory()).DbLinkSqlMain("");
        Hashtable htresult = new Hashtable();

        DataTable dt_paras = new DataTable("商品拼音列表");

        htresult = I_DBL.RunProc("SELECT PrdID as 商品编号, PrdName as 商品名称, GGXH as 型号规格 FROM pSPXXB  WHERE SPZT='T' ", "商品拼音列表");
        dt_paras = ((DataSet)htresult["return_ds"]).Tables["商品拼音列表"].Copy();
        //加载拼音
        dt_paras.Columns.Add("简拼");
        dt_paras.Columns.Add("全拼");
        for (int p = 0; p < dt_paras.Rows.Count; p++)
        {
            dt_paras.Rows[p]["全拼"] = PTHelper.Convert(dt_paras.Rows[p]["商品名称"].ToString()).ToLower();
            dt_paras.Rows[p]["简拼"] = PTHelper.GetHeadLetters(dt_paras.Rows[p]["商品名称"].ToString()).ToLower();
        }
        paras.Tables.Add(dt_paras);
        return(paras);
    }
コード例 #6
0
    /// <summary>
    /// 获取动态参数
    /// </summary>
    /// <param name="I_DBL">数据连接</param>
    /// <returns></returns>
    public DataSet GetDynamicParameters(I_Dblink I_DBL)
    {
        DataSet paras = new DataSet();

        Hashtable htresult = new Hashtable();

        DataTable dt_paras = new DataTable("动态参数");

        htresult = I_DBL.RunProc("SELECT [XM] as 项目,[SZ] as 数值 FROM pDTCSB  WHERE [SFYX]='是'", "动态参数");

        if ((bool)(htresult["return_float"]))
        {
            DataSet ds = (DataSet)htresult["return_ds"];
            if (ds != null && ds.Tables["dtResult"] != null && ds.Tables["dtResult"].Rows.Count == 1)
            {
                dt_paras = ds.Tables["动态参数"].Copy();
            }
        }
        dt_paras = ((DataSet)htresult["return_ds"]).Tables["动态参数"].Copy();
        paras.Tables.Add(dt_paras);
        return(paras);
    }
コード例 #7
0
    protected void bd(string db)
    {
        string    sql       = "select * from ViewAllTableLook ORDER BY 表名, 列顺序";
        I_Dblink  I_DBL     = (new DBFactory()).DbLinkSqlMain(db);
        Hashtable return_ht = new Hashtable();

        return_ht = I_DBL.RunProc(sql, "数据记录");
        DataTable redb = ((DataSet)return_ht["return_ds"]).Tables["数据记录"].Copy();

        GridView1.DataSource = redb.DefaultView;
        GridView1.DataBind();

        string    sql2       = "select * from ViewAll_view_fun_exec ORDER BY 类型, 名称";
        I_Dblink  I_DBL2     = (new DBFactory()).DbLinkSqlMain(db);
        Hashtable return_ht2 = new Hashtable();

        return_ht2 = I_DBL2.RunProc(sql2, "数据记录");
        DataTable redb2 = ((DataSet)return_ht2["return_ds"]).Tables["数据记录"].Copy();

        GridView2.DataSource = redb2;
        GridView2.DataBind();
    }