コード例 #1
0
 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;
 }
コード例 #2
0
        public Authorization GetAuthorization(int id)
        {
            Authorization authorization = new Authorization();

            IDataReader dr = new AuthorizationDataAdapter().GetAuthorizationById(id);
            if (dr.Read())
            {
                authorization = PopulateReader(dr);
            }
            return authorization;
        }