public static UserADM getUserAdmByID(int userAdmID) { UserADMTableAdapter adapter = new UserADMTableAdapter(); UserADM_DS.UserADMDataTable table = adapter.GetUserADMByID(userAdmID); if (table.Rows.Count == 0) { return(null); } UserADM_DS.UserADMRow row = table[0]; UserADM obj = new UserADM() { UserId = row.UserId, Nombre = row.nombre, Apellido = row.apellido, Email = row.email, Password = row.password, CI = row.CI, Telefono = row.telefono, Direccion = row.direccion }; return(obj); }
public static List <UserADM> GetAdmins() { UserADMTableAdapter adapter = new UserADMTableAdapter(); UserADM_DS.UserADMDataTable table = adapter.GetUserADM(); List <UserADM> resultado = new List <UserADM>(); foreach (var row in table) { UserADM obj = new UserADM(); obj.UserId = row.UserId; obj.CI = row.CI; obj.Nombre = row.nombre; obj.Apellido = row.apellido; obj.Email = row.email; obj.Password = row.password; obj.Telefono = row.telefono; obj.Direccion = row.direccion; resultado.Add(obj); } return(resultado); }