public IList<Core.Business.Location> GetAllLocation()
        {
            IList<Core.Business.Location> locationlist = new List<Core.Business.Location>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllLocation);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Location location = new Core.Business.Location();

                    if (!reader.IsDBNull(0)) location.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) location.Name = reader.GetString(1);
                    if (!reader.IsDBNull(2)) location.Description = reader.GetString(2);

                    location.MarkOld();
                    locationlist.Add(location);
                }
                reader.Close();
            }
            return locationlist;
        }
        public ICollection<Location> Search(string s)
        {
            IList<Core.Business.Location> locationlist = new List<Core.Business.Location>();

            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@name", SqlDbType.NVarChar, s);

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetLocation);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Location location = new Core.Business.Location();

                    if (!reader.IsDBNull(0)) location.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) location.Name = reader.GetString(1);
                    if (!reader.IsDBNull(2)) location.Description = reader.GetString(2);

                    location.MarkOld();
                    locationlist.Add(location);
                }
                reader.Close();
            }
            return locationlist;
        }
        public Core.Business.Location Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectLocation);

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

                if (!reader.IsDBNull(0)) location.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) location.Name = reader.GetString(1);
                if (!reader.IsDBNull(2)) location.Description = reader.GetString(2);

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

                return null;
            }
        }