Example #1
0
        private static DBgl_WorkflowGroup GetItemGroupFromReader(IDataReader dataReader)
        {
            DBgl_WorkflowGroup objItem = new DBgl_WorkflowGroup();


            objItem.CreatedUser = SqlHelper.GetString(dataReader, "CreatedUser");

            objItem.Legs = SqlHelper.GetInt(dataReader, "Legs");


            return(objItem);
        }
Example #2
0
        public static DBgl_WorkflowGroupCollection GetItemGroupPagging(int page, int rec, string strSearch, out int TotalRecords)
        {
            TotalRecords = 0;
            DBgl_WorkflowGroupCollection ItemCollection = new DBgl_WorkflowGroupCollection();
            Database  db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
            DbCommand dbCommand = db.GetStoredProcCommand("gl_WorkflowGroup_Paging");

            db.AddInParameter(dbCommand, "Page", DbType.Int32, page);
            db.AddInParameter(dbCommand, "RecsPerPage", DbType.Int32, rec);
            db.AddInParameter(dbCommand, "SearchValue", DbType.String, strSearch);
            db.AddOutParameter(dbCommand, "TotalRecords", DbType.Int32, 0);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBgl_WorkflowGroup item = GetItemGroupFromReader(dataReader);
                    ItemCollection.Add(item);
                }
            }
            TotalRecords = Convert.ToInt32(db.GetParameterValue(dbCommand, "@TotalRecords"));
            return(ItemCollection);
        }