private void RekrutacjaButton_Click(object sender, EventArgs e) { KierunekModel wydostan = (KierunekModel)KierunkiCombobox.SelectedItem; WybranyKieunekLabel.Text = wydostan.Nazwa; WszyscyKandydaci = GlobalConfig.Connections.ZaladujKandydatowNaKierunek(wydostan.Nazwa); Kandydat_SortedList = WszyscyKandydaci.OrderByDescending(o => o.WynikRekrutacyjny).ToList(); if (Kandydat_SortedList.Count < wydostan.ilosc_miejsc) { Kandydaci_przyjęci = Kandydat_SortedList; } else { for (int i = 0; i < wydostan.ilosc_miejsc; i++) { Kandydaci_przyjęci.Add(Kandydat_SortedList[i]); } for (int i = wydostan.ilosc_miejsc; i < Kandydat_SortedList.Count; i++) { Kandydaci_odrzuceni.Add(Kandydat_SortedList[i]); } } GlobalConfig.Connections.Zarekrutuj(Kandydaci_przyjęci); WireUpLists(); }
private void ZarejestrujButton_Click(object sender, EventArgs e) { if (ValidateForm()) { KandydatModel user = new KandydatModel(); KierunekModel _wydostan_nazwe = new KierunekModel(); user.Imie = ImieTextbox.Text; user.Nazwisko = NazwiskoTextbox.Text; user.EmailAddress = EmailTextbox.Text; user.UserType = 0; user.PESEL = PeselTextbox.Text; user.Haslo = HasloTextbox.Text; user.WynikRekrutacyjny = zmien_string_na_int(PunktyRekrTextbox.Text); _wydostan_nazwe = (KierunekModel)KierunkiCombobox.SelectedItem; user.KierunekDocelowy = _wydostan_nazwe.Nazwa; //GlobalConfig.Connections.StworzUzytkownik(user); //GlobalConfig.Connections.Wstaw_haslo(haslo, GlobalConfig.Connections.Uzyskaj_Id_Wstawianego_Usera(user.PESEL)); //MessageBox.Show($"imie{user.Imie} nazwisko{user.Nazwisko} email{user.EmailAddress} usertyp{user.UserType} pesel{user.PESEL} hasl{user.Haslo} wynik{user.WynikRekrutacyjny}"); GlobalConfig.Connections.DodajKandydata(user); ImieTextbox.Text = ""; NazwiskoTextbox.Text = ""; EmailTextbox.Text = ""; PeselTextbox.Text = ""; HasloTextbox.Text = ""; PunktyRekrTextbox.Text = ""; } else { MessageBox.Show("Dane niepoprawne"); } //ImieTextbox.Text = ""; }
public void DodajKierunek(KierunekModel kierunek) { using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString("Projekt_PO"))) { var p = new DynamicParameters(); p.Add("@Nazwa_kierunku", kierunek.Nazwa); p.Add("@Rok_rozpoczecia", kierunek.rok_rozpoczecia); connection.Execute("dbo.spDodajKierunek", p, commandType: CommandType.StoredProcedure); } }
private void StworzKierButton_Click(object sender, EventArgs e) { if (ValidateForm()) { KierunekModel kierunek = new KierunekModel(); kierunek.Nazwa = NazwaKierTextbox.Text; kierunek.rok_rozpoczecia = RokRozpTextbox.Text; GlobalConfig.Connections.DodajKierunek(kierunek); } else { MessageBox.Show("Dane niepoprawne"); } NazwaKierTextbox.Text = ""; RokRozpTextbox.Text = ""; }
public DodajStudentaDoKierunku(KierunekModel _Kierunek) { InitializeComponent(); Kierunek_przypisz = _Kierunek; }
private void DodajStudButton_Click(object sender, EventArgs e) { KierunekModel _Kierunek = (KierunekModel)KierListbox.SelectedItem; (new DodajStudentaDoKierunku(_Kierunek)).Show(); }