Example #1
0
        ///// <summary>
        /////
        ///// </summary>
        ///// <param name="Instance"></param>
        ///// <param name="strParas"></param>
        ///// <param name="cl">PowerDataGrid控件所属页面</param>
        ///// <param name="gridId">PowerDataGrid控件ID</param>
        ///// <param name="pageIndex">当前页索引</param>
        ///// <param name="pageSize">每页记录数</param>
        ///// <returns></returns>
        //public void SearchInfo(string Instance, Control cl, string gridId, int pageIndex, int pageSize)
        //{
        //    //初始化数据操作对象
        //    dh = new DataHandle(DataBaseName.WJSJZX);
        //    //初始化SQL处理对象
        //    ihs = (IHandleSQL)Assembly.Load(strIntegrativeShow2).CreateInstance(strIntegrativeShow2 + '.' + Instance);
        //    //SQL以及参数初始化
        //    ihs.HandleSQL(dh, cl);

        //    Page p = cl as Page;
        //    PowerDataGrid g = p.FindControl(gridId) as PowerDataGrid;

        //    int allRecordCount = 0;
        //    string tableName = "dt";
        //    DataTable dt = dh.DB.ExeSqlForDataTable(dh.strSQL, dh.spc, tableName, dh.orderBy, pageSize, pageIndex, out allRecordCount);
        //    g.RecordCount = allRecordCount;
        //    g.PageIndex = pageIndex;
        //    g.DataSource = dt;
        //    g.DataBind();

        //}

        /// <summary>
        ///
        /// </summary>
        /// <param name="Instance"></param>
        /// <param name="strParas"></param>
        /// <param name="cl">PowerDataGrid控件所属页面</param>
        /// <param name="gridId">PowerDataGrid控件ID</param>
        /// <param name="pageIndex">当前页索引</param>
        /// <param name="pageSize">每页记录数</param>
        /// <returns></returns>
        public void SearchInfo(string Instance, string[] strParas, Control cl, string gridId, int pageIndex, int pageSize)
        {
            //初始化数据操作对象
            dh = new DataHandle(DataBaseName.WJSJZX);
            //初始化SQL处理对象
            ihs = (IHandleSQL)Assembly.Load(strIntegrativeShow2).CreateInstance(strIntegrativeShow2 + '.' + Instance);
            //SQL以及参数初始化
            if (strParas == null || strParas.Length == 0)
            {
                ihs.HandleSQL(dh, cl);
            }
            else
            {
                ihs.HandleSQL(dh, strParas, cl);
            }

            Page          p = cl as Page;
            PowerDataGrid g = p.FindControl(gridId) as PowerDataGrid;

            int       allRecordCount = 0;
            string    tableName      = "dt";
            DataTable dt             = dh.DB.ExeSqlForDataTable(dh.strSQL, dh.spc, tableName, dh.orderBy, pageSize, pageIndex, out allRecordCount);

            g.RecordCount = allRecordCount;
            g.PageIndex   = pageIndex;
            g.DataSource  = dt;
            g.DataBind();
        }
Example #2
0
 public DataTable SearchInfo(string Instance, Control cl)
 {
     //初始化数据操作对象
     dh = new DataHandle(DataBaseName.WJSJZX);
     //初始化SQL处理对象
     ihs = (IHandleSQL)Assembly.Load(strIntegrativeShow2).CreateInstance(strIntegrativeShow2 + '.' + Instance);
     //SQL以及参数初始化
     ihs.HandleSQL(dh, cl);
     //返回执行结果
     return(dh.Read());
 }
Example #3
0
 public bool AlterInfo(string Instance, DataTable dt, string[] strKeys)
 {
     //初始化数据操作对象
     dh = new DataHandle(DataBaseName.WJSJZX);
     //初始化SQL处理对象
     ihs = (IHandleSQL)Assembly.Load(strIntegrativeShow2).CreateInstance(strIntegrativeShow2 + '.' + Instance);
     //SQL以及参数初始化
     ihs.HandleSQL(dh, strKeys);
     //返回执行结果
     return(dh.Update(dt));
 }
Example #4
0
 public bool InsertInfo(string Instance, DataTable dt)
 {
     //初始化数据操作对象
     dh = new DataHandle(DataBaseName.WJSJZX);
     //初始化SQL处理对象
     ihs = (IHandleSQL)Assembly.Load(strIntegrativeShow2).CreateInstance(strIntegrativeShow2 + '.' + Instance);
     //SQL以及参数初始化(因为不需要参数,所以传空参数)
     ihs.HandleSQL(dh);
     //返回执行结果
     return(dh.Update(dt));
 }