public static List <patient_class_datav3> patientClassv2ToClassv3(CsvReader reader) { List <patient_class_datav3> patientsList = new List <patient_class_datav3>(); //lista vacia List <patient_class_datav2> usersListOldClass = reader.GetRecords <patient_class_datav2>().ToList(); //lista de la clase vieja //Convertidor de Lista de clase nueva for (int indiceLista = 0; indiceLista < usersListOldClass.Count; indiceLista++) { patient_class_datav3 one_users_NewClass = new patient_class_datav3(); one_users_NewClass.user_id = usersListOldClass[indiceLista].user_id; one_users_NewClass.user_name = usersListOldClass[indiceLista].user_name; one_users_NewClass.user_institution = usersListOldClass[indiceLista].user_institution; one_users_NewClass.user_age = usersListOldClass[indiceLista].user_age; //age one_users_NewClass.user_country = usersListOldClass[indiceLista].user_country; //country one_users_NewClass.user_email = usersListOldClass[indiceLista].user_email; //email one_users_NewClass.user_gender = usersListOldClass[indiceLista].user_gender; //gender one_users_NewClass.user_diagnosedConditions.strabismusExotropia = usersListOldClass[indiceLista].user_diagnosedConditions.strabismusExotropia; one_users_NewClass.user_diagnosedConditions.strabismusEsotropia = usersListOldClass[indiceLista].user_diagnosedConditions.strabismusEsotropia; one_users_NewClass.user_diagnosedConditions.astigmatism = usersListOldClass[indiceLista].user_diagnosedConditions.astigmatism; one_users_NewClass.user_diagnosedConditions.nystagmus = usersListOldClass[indiceLista].user_diagnosedConditions.nystagmus; one_users_NewClass.user_diagnosedConditions.amblyopia = usersListOldClass[indiceLista].user_diagnosedConditions.amblyopia; one_users_NewClass.user_diagnosedConditions.hypermetropia = usersListOldClass[indiceLista].user_diagnosedConditions.hypermetropia; one_users_NewClass.user_diagnosedConditions.myopia = usersListOldClass[indiceLista].user_diagnosedConditions.myopia; one_users_NewClass.user_diagnosedConditions.cranialNervePalsy = usersListOldClass[indiceLista].user_diagnosedConditions.cranialNervePalsy; one_users_NewClass.user_diagnosedConditions.ADHD = usersListOldClass[indiceLista].user_diagnosedConditions.ADHD; one_users_NewClass.user_diagnosedConditions.dislexia = usersListOldClass[indiceLista].user_diagnosedConditions.dislexia; one_users_NewClass.user_diagnosedConditions.other = usersListOldClass[indiceLista].user_diagnosedConditions.other; //one_users_NewClass.user_diagnosedConditions.convergenceInsufficiency = usersListOldClass[indiceLista].user_diagnosedConditions;//nuevo patientsList.Add(one_users_NewClass); } return(patientsList); }
public static List <patient_class_datav3> patientClassv1ToClassv3(CsvReader reader) { List <patient_class_datav3> patientsList = new List <patient_class_datav3>(); //lista vacia List <patient_class_datav1> usersListOldClass = reader.GetRecords <patient_class_datav1>().ToList(); //lista de la clase vieja //Convertidor de Lista de clase nueva for (int indiceLista = 0; indiceLista < usersListOldClass.Count; indiceLista++) { patient_class_datav3 one_users_NewClass = new patient_class_datav3(); one_users_NewClass.user_id = usersListOldClass[indiceLista].user_id; one_users_NewClass.user_name = usersListOldClass[indiceLista].user_name; one_users_NewClass.user_institution = usersListOldClass[indiceLista].user_institution; patientsList.Add(one_users_NewClass); } return(patientsList); }