private void btPrihvacena_Click(object sender, EventArgs e) { gd = new Gdomacica(tbIme.Text, tbPrezime.Text, tbDevojackoPrezime.Text, dateTimePicker1.Value, tbJMBG.Text, tbBrojLicne.Text, tbAdresa.Text, tbTelefon.Text, tbMobilni.Text, tbEmail.Text, tbObrazovanje.Text, tbRadnoIskustvo.Text, tbHobi.Text, cbPusac.Checked, tbAlergije.Text, tbFizickaOgrc.Text, tbZdravstveniProblemi.Text, tbOdbijaDaRadi.Text); Globalne.brojGdomacica++; }
public void ispisiGD(Gdomacica gd) { tbIme.Text = gd.ime; tbPrezime.Text = gd.prezime; tbDevojackoPrezime.Text = gd.dprezime; dateTimePicker1.Value = gd.dtmrodjenja; tbJMBG.Text = gd.JMBG; tbBrojLicne.Text = gd.BrLK; tbAdresa.Text = gd.Adresa; tbTelefon.Text = gd.brTel; tbMobilni.Text = gd.brMobTel; tbEmail.Text = gd.email; tbObrazovanje.Text = gd.obrazovanje; if (gd.pusac == true) { cbPusac.Checked = true; } if (gd.alergije!="") { cbAlergije.Checked = true; tbAlergije.Text = gd.alergije; } if (gd.FOgranicenja != "") { cbFizickaOgrc.Checked = true; tbFizickaOgrc.Text = gd.FOgranicenja; } if (gd.ZdrProb != "") { cbZdravstveniProb.Checked = true; tbZdravstveniProblemi.Text = gd.ZdrProb; } tbHobi.Text = gd.hobi; }
private void btPrihvacena_Click(object sender, EventArgs e) { if (tbIme.Text != "" && tbPrezime.Text != "" && tbJMBG.Text.Length == 13) { gd = new Gdomacica(tbIme.Text, tbPrezime.Text, tbDevojackoPrezime.Text, dateTimePicker1.Value, tbJMBG.Text, tbBrojLicne.Text, tbAdresa.Text, tbTelefon.Text, tbMobilni.Text, tbEmail.Text, tbObrazovanje.Text, tbRadnoIskustvo.Text, tbHobi.Text, cbPusac.Checked, tbAlergije.Text, tbFizickaOgrc.Text, tbZdravstveniProblemi.Text, tbOdbijaDaRadi.Text); Globalne.brojGdomacica++; } else { if (tbIme.Text == "") MessageBox.Show("Polje Ime je obavezno!"); if (tbPrezime.Text == "") MessageBox.Show("Polje Prezime je obavezno!"); if (tbJMBG.Text.Length < 13) MessageBox.Show("Duzina JMBG nije odgovarajuca!"); } }
private void btPrihvacena_Click(object sender, EventArgs e) { if (tbIme.Text != "" && tbPrezime.Text != "" && tbJMBG.Text.Length == 13) { gd = new Gdomacica(tbIme.Text, tbPrezime.Text, tbDevojackoPrezime.Text,comboBox1.SelectedIndex, dateTimePicker1.Value, tbJMBG.Text, tbBrojLicne.Text, tbAdresa.Text, tbTelefon.Text, tbMobilni.Text, tbEmail.Text, tbObrazovanje.Text, tbRadnoIskustvo.Text, tbHobi.Text, cbPusac.Checked, tbAlergije.Text, tbFizickaOgrc.Text, tbZdravstveniProblemi.Text, tbOdbijaDaRadi.Text); Globalne.brojGdomacica++; } else { if (tbIme.Text == "") { MessageBox.Show("Polje Ime je obavezno!"); SystemSounds.Asterisk.Play(); } if (tbPrezime.Text == "") { MessageBox.Show("Polje Prezime je obavezno!"); SystemSounds.Asterisk.Play(); } if (tbJMBG.Text.Length < 13) {MessageBox.Show("Duzina JMBG nije odgovarajuca!"); SystemSounds.Asterisk.Play(); } } StreamWriter sw = new StreamWriter(Path.Combine(Globalne.pathfolder, "log"),true); sw.WriteLine("Domacica: "+tbIme.Text+" "+tbPrezime.Text+" "+tbJMBG.Text+" kreirana datuma "+DateTime.Now.ToString()+" sa accounta "+Environment.UserName); sw.Close(); }
public racun(Gdomacica gd) { InitializeComponent(); this.gd = gd; }
public radni_nalog(Korisnici k, Gdomacica gd) { InitializeComponent(); this.k = k; this.gd = gd; }
//private string CurrentPath="/"; void ucitaj() { try { if (!Directory.Exists(Globalne.pathfolder)) { Directory.CreateDirectory(Globalne.pathfolder); Directory.CreateDirectory(Globalne.pathgd); Directory.CreateDirectory(Globalne.pathkor); Directory.CreateDirectory(Globalne.pathodb); Directory.CreateDirectory(Globalne.patharhd); Directory.CreateDirectory(Globalne.patharhk); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Tehnicka Greska"); } try { Korisnici k; string[] fileEntries = Directory.GetFiles(Globalne.pathkor); bool ispravnost1 = false; Globalne.brojKorisnika = fileEntries.Length; for (int i = 0; i < Globalne.brojKorisnika; i++) { StreamReader srkor = new StreamReader(Path.Combine(Globalne.pathkor, fileEntries[i])); ispravnost1 = false; k = new Korisnici(srkor, ref ispravnost1, Globalne.dajkljuc(fileEntries[i])); srkor.Close(); if (ispravnost1) { Globalne.poBrKartona.Add(k.brKartona, k); lbKorisnici.Items.Add(k.punoime()); } } Gdomacica gd; bool ispravnost=false; fileEntries = Directory.GetDirectories(Globalne.pathgd); Globalne.brojGdomacica = fileEntries.Length; for (int i = 0; i < Globalne.brojGdomacica; i++) { StreamReader srgd = new StreamReader(Path.Combine(Globalne.pathgd,fileEntries[i],"domacica.data")); ispravnost = false; gd = new Gdomacica(srgd,ref ispravnost,Globalne.dajkljuc(fileEntries[i])); srgd.Close(); if (ispravnost) { Globalne.poJMBG.Add(gd.JMBG, gd); LBdomacice.Items.Add(gd.PunoIme()); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Tehnička greška"); } return; }
public PostojecaDomacica(Gdomacica trenutnadomacica) { InitializeComponent(); trenutnagd=trenutnadomacica; }
void ucitaj() { try { if (!File.Exists(Globalne.pathgd)) { Directory.CreateDirectory(Globalne.pathfolder); var myFile = File.Create(Globalne.pathgd); myFile.Close(); } if(!File.Exists(Globalne.pathsettings)) { var myFile = File.Create(Globalne.pathsettings); myFile.Close(); } if (!File.Exists(Globalne.pathkor)) { var myFile = File.Create(Globalne.pathkor); myFile.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Tehnicka Greska"); } StreamReader srgd = new StreamReader(Globalne.pathgd); StreamReader srst = new StreamReader(Globalne.pathsettings); StreamReader srkor = new StreamReader(Globalne.pathkor); Gdomacica gd; Globalne.brojGdomacica = Convert.ToInt32(srst.ReadLine()); Globalne.brojKorisnika = Convert.ToInt32(srst.ReadLine()); bool ispravnost=false; for (int i = 0; i < Globalne.brojGdomacica; i++) { ispravnost = false; gd = new Gdomacica(srgd,ref ispravnost); if (ispravnost) { Globalne.poJMBG.Add(gd.JMBG, gd); Globalne.poImenu.Add(gd.ime, gd); Globalne.poPrezimenu.Add(gd.prezime, gd); } } srgd.Close(); srst.Close(); srkor.Close(); return; }