private void bt_vratit_Click(object sender, EventArgs e) { //open dialog pujcka Pujcka v = new Pujcka(); v.Text = "Vrácení"; v.odemc(); v.B = data; v.RefreshB(); if (DialogResult.OK == v.ShowDialog()) { var res = v.A.Union(v.B).ToList(); if (!v.A.Any()) { MessageBox.Show("Nic jste nevrátili.", Properties.Resources.INFO_TITTLE, MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show(string.Concat("Uspěšně jste vratili filmy. ", "\nVýše penále: ", v.Penale), Properties.Resources.INFO_TITTLE, MessageBoxButtons.OK, MessageBoxIcon.Information); } mazani(); data.Clear(); data = res; refresh(); } }
private void bt_pujcit_Click(object sender, EventArgs e) { Pujcka p = new Pujcka(); p.Text = "Půjčení"; p.zamceni(); p.A = data; p.RefreshA(); DateTime doba = DateTime.Now.AddDays(30); p.Datum = doba; if (DialogResult.OK == p.ShowDialog()) { var res = p.A.Union(p.B).ToList(); if (!p.B.Any()) { MessageBox.Show("Nic jste si nevypujcili.", Properties.Resources.INFO_TITTLE, MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show(String.Concat("Vaše vybrané filmy vraťte do: ", doba.ToString("dd.MM.yyyy"), "\nCelková cena půjčky: ", p.Pujcovne), Properties.Resources.INFO_TITTLE, MessageBoxButtons.OK, MessageBoxIcon.Information); } mazani(); data.Clear(); data = res; refresh(); } }