public static SystemRoleCollection GetAllSystemRoles() { SystemRoleCollection result = new User.SystemRoleCollection(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = "select * from tblSystemRole Order by RoleName;"; cmd.CommandType = System.Data.CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { SystemRole role = new SystemRole(); YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter sqlDataReaderPropertyWriter = new Persistence.SqlDataReaderPropertyWriter(role, dr); sqlDataReaderPropertyWriter.WriteProperties(); result.Add(role); } } } return(result); }
public SystemRoleView(SystemRole role) { this.m_SystemRole = role; }