public List <H_NoticeInUser> GetNoticesInUsers() { var entities = new List <H_NoticeInUser>(); using (var rdr = SqlHelper.ExecuteReader(this._databaseConnectionString, CommandType.Text, SqlCommands_Sc.Sql_H_NoticeInUser_Repository_GetNoticesInUsers, null)) { while (rdr.Read()) { var entity = new H_NoticeInUser(); entity.NoticeId = SqlTypeConverter.DBNullGuidHandler(rdr["NoticeId"]); entity.UserId = SqlTypeConverter.DBNullStringHandler(rdr["UserId"]); entity.Readed = SqlTypeConverter.DBNullBooleanHandler(rdr["Readed"]); entity.ReadTime = SqlTypeConverter.DBNullDateTimeHandler(rdr["ReadTime"]); entities.Add(entity); } } return(entities); }
public List <H_NoticeInUser> GetNoticesInUser(string uid) { SqlParameter[] parms = { new SqlParameter("@UserId", SqlDbType.VarChar, 100) }; parms[0].Value = SqlTypeConverter.DBNullStringChecker(uid); var entities = new List <H_NoticeInUser>(); using (var rdr = SqlHelper.ExecuteReader(this._databaseConnectionString, CommandType.Text, SqlCommands_Sc.Sql_H_NoticeInUser_Repository_GetNoticesInUser, parms)) { while (rdr.Read()) { var entity = new H_NoticeInUser(); entity.NoticeId = SqlTypeConverter.DBNullGuidHandler(rdr["NoticeId"]); entity.UserId = SqlTypeConverter.DBNullStringHandler(rdr["UserId"]); entity.Readed = SqlTypeConverter.DBNullBooleanHandler(rdr["Readed"]); entity.ReadTime = SqlTypeConverter.DBNullDateTimeHandler(rdr["ReadTime"]); entities.Add(entity); } } return(entities); }