public string InsertOudeStage(OudeStage oudeStage) { Student student = null; Stageopdracht stageopdracht; Bedrijf bedrijf = null; if (_studentRepo.GetByName(oudeStage.VoornaamStudent, oudeStage.NaamStudent) == null) { student = ParseStudent(oudeStage.NaamStudent, oudeStage.VoornaamStudent, oudeStage.MailStudent, oudeStage.GsmStudent); } Bedrijf controle = _bedrijfRepo.GetByName(oudeStage.NaamBedijf); if (controle == null) { bedrijf = ParseBedrijf(oudeStage.NaamBedijf, oudeStage.StraatBedrijf, Convert.ToInt32(oudeStage.PostcodeBedrijf), oudeStage.GemeenteBedrijf, oudeStage.TelefoonContactPersoon, oudeStage.EmailContactPersoon, (bool)ConvertAanwezigheidHandShake(oudeStage.AanwezigHandshake)); _bedrijfRepo.Post(bedrijf); } //ParseStage(Convert.ToDateTime(oudeStage.BeginBP), Convert.ToDateTime(oudeStage.EindBP), ) return(null); }
public StageBuilder() { stage = new OudeStage(); random = new Random(); foreach (var p in stage.GetType().GetProperties().Where(p => p.GetGetMethod().GetParameters().Count() == 0)) { p.SetValue(stage, Guid.NewGuid().ToString()); } }
public static OudeStage ParseOudeStage(string[] elements) { try { OudeStage stage = new OudeStage(); int i = 0; foreach (var p in stage.GetType().GetProperties().Where(p => p.GetGetMethod().GetParameters().Count() == 0)) { p.SetValue(stage, elements[i]); i++; } return(stage); } catch (FormatException) { throw new FormatException("Waarschuwing => Een of meerdere rijen konden niet omgezet worden"); } }