Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. if (tbxSifra.Text != string.Empty)
  2. {
  3. MessageBox.Show("Da bi ste uneli novog morate da obrisete sifru");
  4. }
  5. Klijent x = new Klijent();
  6. if (tbxIme.Text!=string.Empty) x.Ime = tbxIme.Text;
  7. if (tbxPrezime.Text != string.Empty) x.Prezime = tbxPrezime.Text;
  8. if (tbxAdresa.Text != string.Empty) x.Adresa = tbxAdresa.Text;
  9. if (tbxTelefon.Text != string.Empty) x.Telefon = tbxTelefon.Text;
  10. if (tbxMail.Text != string.Empty) x.Email = tbxMail.Text;
  11. if (rbtnDa.Checked) x.Aktivan = true;
  12. else x.Aktivan = false;
  13. //citanje iz combobox-a
  14. if (cbxGrad.SelectedIndex > -1)
  15. {
  16. x.GradId = (int)cbxGrad.SelectedValue;
  17. }
  18. try
  19. {
  20. if (x.Upisi())
  21. {
  22. tbxSifra.Text = x.KlijentID.ToString();
  23. MessageBox.Show("Klijent upisan");
  24. }
  25. else throw new Exception(x.ErrorMessage);
  26. }
  27. catch (Exception ex)
  28. {
  29. MessageBox.Show(ex.Message);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement