private List <EcmoUser> GetEcmoUserListByRow(SqlDataReader reader) { List <EcmoUser> list = new List <EcmoUser>(); EcmoUser ecmoUser = null; while (reader.Read()) { ecmoUser = new EcmoUser(); if (reader["user_id"] != DBNull.Value) { ecmoUser.user_id = Convert.ToInt32(reader["user_id"]); } if (reader["openid"] != DBNull.Value) { ecmoUser.openid = Convert.ToString(reader["openid"]); } if (reader["user_name"] != DBNull.Value) { ecmoUser.user_name = Convert.ToString(reader["user_name"]); } if (reader["user_hospital"] != DBNull.Value) { ecmoUser.user_hospital = Convert.ToString(reader["user_hospital"]); } if (reader["user_dept"] != DBNull.Value) { ecmoUser.user_dept = Convert.ToString(reader["user_dept"]); } if (reader["user_phone"] != DBNull.Value) { ecmoUser.user_phone = Convert.ToString(reader["user_phone"]); } if (reader["user_phone"] != DBNull.Value) { ecmoUser.user_phone = Convert.ToString(reader["user_phone"]); } if (reader["enroll_name"] != DBNull.Value) { ecmoUser.enroll_name = Convert.ToString(reader["enroll_name"]); } if (reader["user_date"] != DBNull.Value) { ecmoUser.user_date = Convert.ToDateTime(reader["user_date"]); } list.Add(ecmoUser); } return(list); }
private EcmoUser GetEcmoUserByRow(SqlDataReader reader) { EcmoUser ecmoUser = null; while (reader.Read()) { ecmoUser = new EcmoUser(); if (reader["user_id"] != DBNull.Value) { ecmoUser.user_id = Convert.ToInt32(reader["user_id"]); } if (reader["openid"] != DBNull.Value) { ecmoUser.openid = Convert.ToString(reader["openid"]); } if (reader["user_name"] != DBNull.Value) { ecmoUser.user_name = Convert.ToString(reader["user_name"]); } if (reader["user_hospital"] != DBNull.Value) { ecmoUser.user_hospital = Convert.ToString(reader["user_hospital"]); } if (reader["user_dept"] != DBNull.Value) { ecmoUser.user_dept = Convert.ToString(reader["user_dept"]); } if (reader["user_phone"] != DBNull.Value) { ecmoUser.user_phone = Convert.ToString(reader["user_phone"]); } if (reader["user_phone"] != DBNull.Value) { ecmoUser.user_phone = Convert.ToString(reader["user_phone"]); } if (reader["enroll_name"] != DBNull.Value) { ecmoUser.enroll_name = Convert.ToString(reader["enroll_name"]); } if (reader["user_date"] != DBNull.Value) { ecmoUser.user_date = Convert.ToDateTime(reader["user_date"]); } } return(ecmoUser); }