コード例 #1
0
        /// <summary>
        /// 子窗体显示供应商
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public Dictionary <string, object> PuSupplier(string index, string size, string name)
        {
            string LikeSql = "";

            if (name.Trim() != "")
            {
                LikeSql += " and SCompanyName like '%" + name + "%' ";
            }
            string PageSql  = @"select * from (select Superid ,SCompanyName,SupplierNumber,ROW_NUMBER() OVER(ORDER BY Superid)AS RANK FROM Supplier WHERE SDelete= 0) as t where t.rank between (((" + index + "-1)*" + size + ")+1) and (" + index + "*" + size + ") order by Superid";
            string CountSql = @"select count(*) from Supplier where SDelete=0 " + LikeSql + "";

            Common.CommonClass          com       = new Common.CommonClass();
            string                      DataSql   = Common.CommonClass.DataTableToJson(com.Selcets(PageSql));
            string                      DataCount = Common.CommonClass.DataTableToJson(com.Selcets(CountSql));
            Dictionary <string, object> dic       = new Dictionary <string, object>();

            dic.Add("DataSql", DataSql);
            dic.Add("DataCount", DataCount);
            return(dic);
        }
コード例 #2
0
        /// <summary>
        /// 显示子窗口仓库列表
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public Dictionary <string, object> DpotPage(string index, string size, string name)
        {
            string LikeSql = "";

            if (name.Trim() != "")
            {
                LikeSql += " and WareHouseName like '%" + name + "%' ";
            }
            string PageSql  = @"select top " + size + " n.Wid, Depotid,WareHousDate,DepotName,DepotStatus ,WareHouseAddress from WareHouse  w inner join WareName n on w.wid=n.Wid inner join Depot d on d.WHid=w.WHid where WDelete=0  " + LikeSql + " and (Depotid not in (select top (" + size + "*(" + index + "-1))Depotid  from WareHouse order by Depotid)) order by Depotid";
            string CountSql = @"select count(*) from WareHouse w inner join WareName n on w.wid=n.Wid inner join Depot d on d.WHid=w.WHid where WDelete=0 " + LikeSql + "";

            Common.CommonClass          com       = new Common.CommonClass();
            string                      DataSql   = Common.CommonClass.DataTableToJson(com.Selcets(PageSql));
            string                      DataCount = Common.CommonClass.DataTableToJson(com.Selcets(CountSql));
            Dictionary <string, object> dic       = new Dictionary <string, object>();

            dic.Add("DataSql", DataSql);
            dic.Add("DataCount", DataCount);
            return(dic);
        }