예제 #1
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public List <T> FindListPage <T>(string WhereSql, string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>();

            builder.Append(WhereSql);
            return(SqlServerHelper.GetPageList <T>(builder.ToString(), orderField, orderType, pageIndex, pageSize, ref recordCount));
        }
예제 #2
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public T FindEntityByWhere <T>(string WhereSql) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>(1);

            builder.Append(WhereSql);
            return(DatabaseReader.ReaderToModel <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString())));
        }
예제 #3
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public List <T> FindList <T>(string WhereSql, DbParameter[] parameters) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>();

            builder.Append(WhereSql);
            return(DatabaseReader.ReaderToList <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), parameters)));
        }
예제 #4
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public List <T> FindListPage <T>(string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount, out string querySql) where T : new()
        {
            string strSql = DatabaseCommon.SelectSql <T>().ToString();

            querySql = string.IsNullOrEmpty(orderField) == true ? strSql : strSql + " order by " + orderField + " " + orderType;
            return(SqlServerHelper.GetPageList <T>(strSql, orderField, orderType, pageIndex, pageSize, ref recordCount));
        }
예제 #5
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public DataTable FindTable <T>(string WhereSql) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>();

            builder.Append(WhereSql);
            return(DatabaseReader.ReaderToDataTable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString())));
        }
예제 #6
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public Hashtable FindHashtable(string tableName, StringBuilder WhereSql, DbParameter[] parameters)
        {
            StringBuilder builder = DatabaseCommon.SelectSql(tableName, 1);

            builder.Append(WhereSql);
            return(DatabaseReader.ReaderToHashtable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), parameters)));
        }
예제 #7
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public DataTable FindTablePage <T>(string WhereSql, DbParameter[] parameters, string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>();

            builder.Append(WhereSql);
            return(SqlServerHelper.GetPageTable(builder.ToString(), parameters, orderField, orderType, pageIndex, pageSize, ref recordCount));
        }
예제 #8
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public List <T> FindListTop <T>(int Top, string WhereSql) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>(Top);

            builder.Append(WhereSql);
            return(DatabaseReader.ReaderToList <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString())));
        }
예제 #9
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public DataTable FindTableTop <T>(int Top, string WhereSql, DbParameter[] parameters) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>(Top);

            builder.Append(WhereSql);
            return(DatabaseReader.ReaderToDataTable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), parameters)));
        }
예제 #10
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public List <T> FindListPage <T>(string WhereSql, DbParameter[] parameters, string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount, out string querySql) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>();

            builder.Append(WhereSql);
            string strSql = builder.ToString();

            querySql = string.IsNullOrEmpty(orderField) == true ? strSql : strSql + " order by " + orderField + " " + orderType;
            return(SqlServerHelper.GetPageList <T>(strSql, parameters, orderField, orderType, pageIndex, pageSize, ref recordCount));
        }
예제 #11
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public Hashtable FindHashtable(string tableName, string propertyName, object propertyValue)
        {
            StringBuilder builder = DatabaseCommon.SelectSql(tableName, 1);

            builder.Append(" AND ").Append(propertyName).Append("=").Append(DbHelper.DbParmChar + propertyName);
            IList <DbParameter> source = new List <DbParameter> {
                DbFactory.CreateDbParameter(DbHelper.DbParmChar + propertyName, propertyValue)
            };

            return(DatabaseReader.ReaderToHashtable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), source.ToArray <DbParameter>())));
        }
예제 #12
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public List <T> FindListTop <T>(int Top, string propertyName, string propertyValue) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>(Top);

            builder.Append(" AND " + propertyName + " = " + DbHelper.DbParmChar + propertyName);
            IList <DbParameter> source = new List <DbParameter> {
                DbFactory.CreateDbParameter(DbHelper.DbParmChar + propertyName, propertyValue)
            };

            return(DatabaseReader.ReaderToList <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), source.ToArray <DbParameter>())));
        }
예제 #13
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public T FindEntity <T>(string propertyName, object propertyValue) where T : new()
        {
            string        str     = propertyName;
            StringBuilder builder = DatabaseCommon.SelectSql <T>();

            builder.Append(" AND ").Append(str).Append("=").Append(DbHelper.DbParmChar + str);
            IList <DbParameter> source = new List <DbParameter> {
                DbFactory.CreateDbParameter(DbHelper.DbParmChar + str, propertyValue)
            };

            return(DatabaseReader.ReaderToModel <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString(), source.ToArray <DbParameter>())));
        }
예제 #14
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public DataTable FindTableTop <T>(int Top) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>(Top);

            return(DatabaseReader.ReaderToDataTable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString())));
        }
예제 #15
0
파일: Database.cs 프로젝트: ranchg/PIMS
 public DataTable FindTablePage <T>(string orderField, string orderType, int pageIndex, int pageSize, ref int recordCount) where T : new()
 {
     return(SqlServerHelper.GetPageTable(DatabaseCommon.SelectSql <T>().ToString(), orderField, orderType, pageIndex, pageSize, ref recordCount));
 }
예제 #16
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public DataTable FindTable <T>(List <string> queryField) where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>(queryField);

            return(DatabaseReader.ReaderToDataTable(DbHelper.ExecuteReader(CommandType.Text, builder.ToString())));
        }
예제 #17
0
파일: Database.cs 프로젝트: ranchg/PIMS
        public List <T> FindList <T>() where T : new()
        {
            StringBuilder builder = DatabaseCommon.SelectSql <T>();

            return(DatabaseReader.ReaderToList <T>(DbHelper.ExecuteReader(CommandType.Text, builder.ToString())));
        }