Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button1_Click(object sender, EventArgs e)
- {
- string ime = textBox1.Text;
- string prezime = textBox2.Text;
- DateTime datumrodjenja = dateTimePicker1.Value;
- string maticni = maskedTextBox1.Text;
- string username = textBox3.Text;
- string pass = textBox4.Text;
- int sifra = Convert.ToInt32(textBox5.Text);
- bool mjesecna = false, godisnja = false;
- if (radioButton3.Checked) { mjesecna = true; godisnja = false; }
- else if (radioButton4.Checked) { mjesecna = false; godisnja = true; }
- DateTime datumuclanjenja = dateTimePicker2.Value;
- try
- {
- if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || maskedTextBox1.Text == "")
- {
- throw new Exception();
- }
- if (radioButton5.Checked)
- {
- ObicniClan clan = new ObicniClan(ime, prezime, maticni, datumrodjenja, sifra, mjesecna, godisnja, "", datumuclanjenja, username, pass);
- biblioteka.RegistrujClana(clan, datumuclanjenja);
- toolStripStatusLabel1.Visible = true;
- toolStripStatusLabel1.Text = "Uspješno ste registrovali člana!";
- }
- else if (radioButton8.Checked)
- {
- groupBox5.Visible = true;
- label10.Visible = true;
- textBox6.Visible = true;
- label10.Text = "Šifra profesora: ";
- int sifraprof = Convert.ToInt32(textBox6.Text);
- Profesori clan = new Profesori(ime, prezime, maticni, datumrodjenja, sifra, mjesecna, godisnja, "", datumuclanjenja, sifraprof, username, pass);
- biblioteka.RegistrujClana(clan, datumuclanjenja);
- toolStripStatusLabel1.Visible = true;
- toolStripStatusLabel1.Text = "Uspješno ste registrovali člana!";
- }
- else if (radioButton6.Checked)
- {
- groupBox5.Visible = true;
- label10.Visible = true;
- textBox6.Visible = true;
- label10.Text = "Indeks studenta: ";
- int indeks = Convert.ToInt32(textBox6.Text);
- BoE clan = new BoE(ime, prezime, maticni, datumrodjenja, sifra, mjesecna, godisnja, "", datumuclanjenja, indeks, username, pass);
- biblioteka.RegistrujClana(clan, datumuclanjenja);
- toolStripStatusLabel1.Visible = true;
- toolStripStatusLabel1.Text = "Uspješno ste registrovali člana!";
- }
- else if (radioButton7.Checked)
- {
- int indeks = Convert.ToInt32(textBox6.Text);
- MoE clan = new MoE(ime, prezime, maticni, datumrodjenja, sifra, mjesecna, godisnja, "", datumuclanjenja, indeks, username, pass);
- biblioteka.RegistrujClana(clan, datumuclanjenja);
- toolStripStatusLabel1.Visible = true;
- toolStripStatusLabel1.Text = "Uspješno ste registrovali člana!";
- }
- }
- catch
- {
- toolStripStatusLabel1.Text = "Registracija nije uspjela!";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement