private void SaveApplicant(object sender, RoutedEventArgs e) { Profession prof = new Profession(); data.szuldatum = input1.Text; data.lakhely = input2.Text; data.neme = (cbx1.SelectedIndex != -1 ? ((cbx1 as ComboBox).SelectedItem as ModelNem).id : 9999); data.vegzettseg = (cbx2.SelectedIndex != -1 ? ((cbx2 as ComboBox).SelectedItem as ModelVegzettseg).id : 9999); data.nyelvtudas = (cbx3.SelectedIndex != -1 ? ((cbx3 as ComboBox).SelectedItem as ModelNyelv).id : 9999); data.ertesult = (cbx4.SelectedIndex != -1 ? ((cbx4 as ComboBox).SelectedItem as ModelErtesulesek).id : 9999); data.projekt_id = (cbx_projekt.SelectedIndex != -1 ? ((cbx_projekt as ComboBox).SelectedItem as ModelSmallProject).id : 9999); int new_id = prof.Fullify(data); if (!data.projekt_id.Equals(9999)) { new Applicant(new_id).AddToProject(data.projekt_id); } if (!new_id.Equals(0)) { new Email().Send(data.email, new EmailTemplate().Udvozlo_Email(data.name)); Utilities.NavigateTo(grid, new ProfessionPage(grid)); } }