private Authorization PopulateReader(IDataReader dr) { Authorization authorization = new Authorization(); if (dr["Id"] != DBNull.Value) authorization.Id = Convert.ToInt32(dr["Id"]); authorization.Level = dr["Level"].ToString(); return authorization; }
public Authorization GetAuthorization(int id) { Authorization authorization = new Authorization(); IDataReader dr = new AuthorizationDataAdapter().GetAuthorizationById(id); if (dr.Read()) { authorization = PopulateReader(dr); } return authorization; }