private void btnDodaj_Click(object sender, EventArgs e) { if (tbIme.Text == "" || tbPrezime.Text == "" || tbbrTelefona.Text == "" || tbAdresa.Text == "" || tbemail.Text == "" || tbJMBG.Text == "") { MessageBox.Show("Morate popuniti sva polja!"); } else { string res = ""; if (rbM.Checked) { res = "M"; } else { res = "Ž"; } try { var datumRodj = dtpdatumrodj.Value.ToString("dd/MM/yyyy"); var datumUpisa = dtpdatumup.Value.ToString("dd/MM/yyyy"); Bazaa.dodavanjeClanova(tbIme.Text, tbPrezime.Text, tbbrTelefona.Text, tbAdresa.Text, tbemail.Text, tbJMBG.Text, res, datumRodj, datumUpisa); MessageBox.Show("Uspešno"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void popuniTabelu() { var termini = Bazaa.popuniTabelutermin(); dtgwPrikazTermina.DataSource = null; dtgwPrikazTermina.DataSource = termini; }
private void popuniTabeluArhiva() { var termini = Bazaa.popuniTabeluarhiva(); dataGridView1.DataSource = null; dataGridView1.DataSource = termini; }
public rezultat() { InitializeComponent(); this.Dock = DockStyle.Fill; textBox1.Text = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"); listBox1.DataSource = Bazaa.popunitabeluRezultati(); popuniTabelu1(); }
public bool promenaLozinke(string novasifra) { if (Bazaa.resetLozinku(this, novasifra)) { return(true); } return(false); }
public bool proveraKorisnika() { if (Bazaa.ProveraKorisnika(this)) { return(true); } else { return(false); } }
private void btnAzuriraj_Click(object sender, EventArgs e) { try { Bazaa.azuriranjeClanova(tbbrTelefona.Text, tbAdresa.Text, tbemail.Text, tbJMBG.Text, dtpdatumup.Text); MessageBox.Show("Uspešno"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void popuniTabelu() { var radnici = Bazaa.vratiPodatkeRadnici(); List <string> zaPrikaz = new List <string>(); foreach (var r in radnici) { zaPrikaz.Add(r.ToString()); } radniciBox.DataSource = zaPrikaz; }
private void button2_Click(object sender, EventArgs e) { try { String vr_new = DateTime.Now.ToString("dd MMMM yyyy HH:mm"); Bazaa.dodavanjeRezultat(tbImeiPrezime.Text, tbvisina.Text, txtTezina.Text, tbruke.Text, tbnoge.Text, jmbg.Text, tbstruk.Text, vr_new, '0', '0', '0', '0', '0', "0"); MessageBox.Show("Uspešno!"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { try { String vr_new = DateTime.Now.ToString("dddd, dd MMMM yyyy HH:mm"); vr_old = vr_new; Bazaa.Promenicene(int.Parse(textBox1.Text), int.Parse(textBox2.Text), int.Parse(textBox3.Text), int.Parse(textBox4.Text), vr_new); MessageBox.Show("Uspesno"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/* private void zabranikarakter() * { * string karakeri = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; * if (!(txtLozinka.Text.ToString().Contains(karakeri))) * { * MessageBox.Show("Nisu dozvoljeni specijalni karakteri za lozinku!"); * } * * }*/ private void btnDodaj_Click(object sender, EventArgs e) { korisnik k = new korisnik(); k.KorisnickoIme = tbKorisnickoIme.Text; string allowedchar = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; k.sifra = txtLozinka.Text; if (tbIme.Text == "" || tbPrezime.Text == "" || tbbrTel.Text == "" || tbadresa.Text == "" || tbemail.Text == "" || tbJMBG.Text == "" || tbKorisnickoIme.Text == "" || txtLozinka.Text == "") { MessageBox.Show("Morate popuniti sva polja!"); } else if (k.proveraKorisnika()) { MessageBox.Show("Korisnicko ime vec postoji."); } else if (!txtLozinka.Text.All(allowedchar.Contains)) { MessageBox.Show("Proverite lozinku.Uneli ste zabranjene karaktere."); } else if (!tbKorisnickoIme.Text.All(allowedchar.Contains)) { MessageBox.Show("Proverite korisnicko ime.Uneli ste zabranjene karaktere."); } else { string res = ""; if (cbM.Checked) { res = "M"; } else { res = "Ž"; } try { Bazaa.dodavanjeRadnika(tbIme.Text, tbPrezime.Text, tbbrTel.Text, tbadresa.Text, tbemail.Text, tbJMBG.Text, res, txtLozinka.Text, tbKorisnickoIme.Text); MessageBox.Show("Uspešno"); } catch { MessageBox.Show("Radnik već postoji!"); } } }
private void cenovnikk_Load(object sender, EventArgs e) { DataTable dt = Bazaa.selectCene(); if (dt.Rows.Count > 0) { textBox1.Text = dt.Rows[0][0].ToString(); textBox2.Text = dt.Rows[1][0].ToString(); textBox3.Text = dt.Rows[2][0].ToString(); textBox4.Text = dt.Rows[3][0].ToString(); } else { MessageBox.Show("Proverite"); } }
private void button1_Click(object sender, EventArgs e) { dateTimePicker1.CustomFormat = "yyyy MM dd"; dateTimePicker1.Format = DateTimePickerFormat.Custom; cbVreme.Items.Add(cbVreme); cbTip.Items.Add(cbTip); try { Bazaa.zauzmiTermin(dateTimePicker1.Text, cbVreme.Text, cbTip.Text, comboBox1.Text); MessageBox.Show("Uspešno"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button3_Click_1(object sender, EventArgs e) { korisnik k = new korisnik(); k.KorisnickoIme = textBox1.Text; k.sifra = textBox2.Text; DataTable dt = Bazaa.UlogujRadnika(k); string allowedchar = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; try { if (textBox1.Text == "" || textBox2.Text == "") { MessageBox.Show("Morate popuniti sva polja"); } else if (!textBox2.Text.All(allowedchar.Contains)) { MessageBox.Show("Proverite lozinku"); } else { if (k.proveraKorisnika()) { if (dt.Rows.Count == 1) { this.Hide(); Radnik f = new Radnik(); f.Show(); } else { MessageBox.Show("Neispravno ste uneli lozinku."); } } else { MessageBox.Show("Ne postoji korisnik sa unesenim korisničkim imenom"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnObrisi_Click(object sender, EventArgs e) { DialogResult Izlaz; Izlaz = MessageBox.Show("Da li želite da izbrišete člana?", "Izlaz", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (Izlaz == DialogResult.Yes) { try { Bazaa.brisanjeRadnika(tbJMBG.Text, tbIme.Text, tbPrezime.Text); MessageBox.Show("Uspešno"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void radniciBox_Click(object sender, EventArgs e) { osoba o = new osoba(); DataTable dt = Bazaa.radniciBox(o); if (dt.Rows.Count > 0) { tbIme.Text = dt.Rows[0][0].ToString(); tbPrezime.Text = dt.Rows[0][1].ToString(); tbbrTel.Text = dt.Rows[0][2].ToString(); tbadresa.Text = dt.Rows[0][3].ToString(); tbemail.Text = dt.Rows[0][4].ToString(); tbJMBG.Text = dt.Rows[0][6].ToString(); } else { MessageBox.Show("Proverite JMBG"); } }
private void button4_Click(object sender, EventArgs e) { rezultati r = new rezultati(); DataTable dt = Bazaa.azuriranjeRezultata(jmbg.Text); if (dt.Rows.Count > 0) { visina_old = dt.Rows[0][0].ToString(); tezina_old = dt.Rows[0][1].ToString(); ruke_old = dt.Rows[0][2].ToString(); noge_old = dt.Rows[0][3].ToString(); struk_old = dt.Rows[0][4].ToString(); vremeUnosa_old_string = dt.Rows[0][11].ToString(); } else { MessageBox.Show("Proverite JMBG"); } try { Bazaa.azuriranjeRezultata1(visina_old, tezina_old, ruke_old, noge_old, struk_old, vremeUnosa_old_string, jmbg.Text); MessageBox.Show("Uspesno"); } catch (Exception ex) { MessageBox.Show(ex.Message); } try { string vr = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"); Bazaa.azuriranjeRezultata2(tbImeiPrezime.Text, vr, tbvisina.Text, txtTezina.Text, tbruke.Text, tbnoge.Text, tbstruk.Text, jmbg.Text); MessageBox.Show("Uspesno"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnAzuriranje_Click(object sender, EventArgs e) { if (tbbrTel.Text == "" || tbadresa.Text == "" || tbemail.Text == "" || tbJMBG.Text == "") { MessageBox.Show("Morate uneti broj telefona, adresu i email."); } else { try { Bazaa.azuriranjeRadnika(tbbrTel.Text, tbadresa.Text, tbemail.Text, tbJMBG.Text); MessageBox.Show("Uspešno"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void listBox1_Click(object sender, EventArgs e) { rezultati o = new rezultati(); DataTable dt = Bazaa.listBox1(o); if (dt.Rows.Count > 0) { tbImeiPrezime.Text = dt.Rows[0][0].ToString(); tbvisina.Text = dt.Rows[0][2].ToString(); txtTezina.Text = dt.Rows[0][3].ToString(); tbruke.Text = dt.Rows[0][4].ToString(); tbnoge.Text = dt.Rows[0][6].ToString(); tbstruk.Text = dt.Rows[0][7].ToString(); jmbg.Text = dt.Rows[0][8].ToString(); textBox1.Text = dt.Rows[0][9].ToString(); } else { MessageBox.Show("Proverite JMBG"); } }
public DataTable LBoxClanovi() { DataTable dt = Bazaa.LBoxClanovi(this); return(dt); }
public DataTable ulogujNadleznog() { DataTable dt = Bazaa.UlogujNadleznog(this); return(dt); }
public DataTable ulogujRadnika() { DataTable dt = Bazaa.UlogujRadnika(this); return(dt); }
public DataTable listBox1() { DataTable dt = Bazaa.listBox1(this); return(dt); }
private void popuniTabelu1() { var clanovi = new List <string>(); tbImeiPrezime.DataSource = Bazaa.popunitabeluNaplata(); }
private void popuniTabelu1() { var clanovi = new List <string>(); comboBox1.DataSource = Bazaa.popunitabeluNaplata(); }
private void pictureBox1_Click(object sender, EventArgs e) { DataTable dt = Bazaa.naplata(comboBox1.Text); string vremeDolaska = dt.Rows[0][2].ToString(); string tiptreninga = dt.Rows[0][3].ToString(); MessageBox.Show("Cena po terminu" + "\n" + tiptreninga); vremeDolaska = vremeDolaska.Substring(0, 2); int vrDolaska = int.Parse(vremeDolaska.ToString()); int razlika; DateTime vrOdlaska = DateTime.Now; string vremeOdlaska = vrOdlaska.ToString(); var o = vrOdlaska; var hmo = new DateTime(o.Year, o.Month, o.Day, o.Hour, o.Minute, 0); razlika = o.Hour - vrDolaska; if (razlika < 0) { razlika = razlika + 24; } MessageBox.Show("Vreme dolaska" + "\n" + razlika); switch (tiptreninga) { case "Individualni mesecni trening": id = 2; break; case "Grupni mesecni trening": id = 1; break; case "Grupni trening po terminu": id = 3; break; case "Individualni trening po terminu": id = 4; break; } DataTable df = Bazaa.naplata1(id); string cena = df.Rows[0][0].ToString(); int cenaInt = int.Parse(df.Rows[0][0].ToString()); string imeiprezime = comboBox1.Text; try { SqlConnection con = new SqlConnection("data source=AMINA;initial catalog=Gym;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework""); con.Open(); SqlCommand sdae = new SqlCommand("Update termin set arhivirano='1' from termin where ImeiPrezime = '" + comboBox1.Text + "' ", con); sdae.ExecuteNonQuery(); PrintDocument p = new PrintDocument(); p.PrintPage += delegate(object sender1, PrintPageEventArgs e1) { e1.Graphics.DrawString("Ime: " + imeiprezime + "\n" + "Tip treninga: " + tiptreninga + "\n" + " Cena: " + cena + "\n" + "Vreme dolaska:" + vrDolaska, new Font("Times New Roman", 12), new SolidBrush(Color.Black), new RectangleF(0, 0, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height)); }; try { p.Print(); } catch (Exception ex) { throw new Exception("Exception Occured While Printing", ex); } con.Close(); } catch (Exception ex) { throw new Exception("Exception Occured While Printing", ex); } }
public DataTable radniciBox() { DataTable dt = Bazaa.radniciBox(this); return(dt); }
private void popuniTabelu() { var clanovi = new List <string>(); LBoxPrikazi.DataSource = Bazaa.popunitabeluClanovi(); }