private void PoBroju(string rijec) { /*else if (toolStripTextBox1.Text.Contains("A")) * { * return; * }*/ int broj; if (int.TryParse(rijec, out broj)) { flowLayoutPanel1.Controls.Clear(); foreach (Putnik k in putnici) { if (k.BrojPutovanja == broj) { PutnikKontrola m = new PutnikKontrola(k); flowLayoutPanel1.Controls.Add(m); m.ContextMenuStrip = contextMenuStrip1; } } } else { flowLayoutPanel1.Controls.Clear(); foreach (Putnik p in putnici) { PutnikKontrola m = new PutnikKontrola(p); flowLayoutPanel1.Controls.Add(m); m.ContextMenuStrip = contextMenuStrip1; } toolStripStatusLabel1.Text = "Ne mozete pretrazivati po broju, a unositi slova!"; toolStripStatusLabel1.ForeColor = System.Drawing.Color.Red; return; } }
private void toolStripButton2_Click(object sender, EventArgs e) { if (del == null) { return; } if (putnici.Count() == 0) { return; } if (toolStripTextBox1.Text == "Search...") { if (putnici.Count() != 0) { flowLayoutPanel1.Controls.Clear(); foreach (Putnik p in putnici) { PutnikKontrola m = new PutnikKontrola(p); flowLayoutPanel1.Controls.Add(m); m.ContextMenuStrip = contextMenuStrip1; } } else { return; } } toolStripStatusLabel1.Text = "Hvala vam na vasem povjerenju!"; toolStripStatusLabel1.ForeColor = SystemColors.ControlText; del(toolStripTextBox1.Text); }
private void editToolStripMenuItem1_Click(object sender, EventArgs e) { ToolStripMenuItem t = sender as ToolStripMenuItem; ContextMenuStrip c = t.Owner as ContextMenuStrip; PutnikKontrola k = c.SourceControl as PutnikKontrola; Uredi ured = new Uredi(k); ured.Show(); }
private void PoImenu(string rijec) { flowLayoutPanel1.Controls.Clear(); foreach (Putnik k in putnici) { if (k.Ime.Contains(rijec)) { PutnikKontrola m = new PutnikKontrola(k); flowLayoutPanel1.Controls.Add(m); m.ContextMenuStrip = contextMenuStrip1; } } }
private void brisiToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem t = sender as ToolStripMenuItem; ContextMenuStrip c = t.Owner as ContextMenuStrip; PutnikKontrola k = c.SourceControl as PutnikKontrola; flowLayoutPanel1.Controls.Remove(k); foreach (Putnik p in putnici) { if ((p.Ime == k.dajIme()) && (p.Prezime == k.dajPrezime()) && (p.BrojPutovanja == k.dajBroj())) { putnici.Remove(p); break; } } }
private void button1_Click(object sender, EventArgs e) { if ((putnik.BrojPutovanja >= 5) || (putnik.Popust = true)) { cijena = cijena - (cijena * 0.1); } Datum dat = new Datum(tmpDatum, tmpMjesto, cijena, tmpBrojSjedista); putnik.Putovanja.Add(dat); putnici.Add(putnik); PutnikKontrola temp = new PutnikKontrola(putnik); temp.ContextMenuStrip = contextMenuStrip1; flowLayoutPanel1.Controls.Add(temp); this.Close(); }
public Uredi(PutnikKontrola k) { InitializeComponent(); this.k = k; }