private Status PopulateReader(IDataReader dr)
        {
            Status status = new Status();

            if (dr["Id"] != null)
                status.Id = Convert.ToInt32(dr["Id"]);
            status.Name = dr["Name"].ToString();

            return status;
        }
        public Status GetStatusById(int id)
        {
            Status status = new Status();
            using (StatusDataAdapter adapter = new StatusDataAdapter())
            {
                IDataReader dr = adapter.GetStatusById(id);
                if (dr.Read())
                {
                    status = PopulateReader(dr);
                    dr.Dispose();
                }

                adapter.Dispose();
                return status;
            }
        }