Exemplo n.º 1
0
        public Core.Business.SystemSort Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSystemSort");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.SystemSort systemSort = new Core.Business.SystemSort();

                if (!reader.IsDBNull(0)) systemSort.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) systemSort.SystemSortName = reader.GetString(1);

                reader.Close();
                return systemSort;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Exemplo n.º 2
0
        public IList<Core.Business.SystemSort> GetAllSystemSort()
        {
            IList<Core.Business.SystemSort> systemSortlist = new List<Core.Business.SystemSort>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSystemSortsAll");

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.SystemSort systemSort = new Core.Business.SystemSort();

                    if (!reader.IsDBNull(0)) systemSort.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) systemSort.SystemSortName = reader.GetString(1);

                    systemSort.MarkOld();
                    systemSortlist.Add(systemSort);
                }
                reader.Close();
            }
            return systemSortlist;
        }