private void listaImprumut_KeyDown(object sender, KeyEventArgs e) { var imprumutMod = (Imprumut)listaImprumut.SelectedItems[0].Tag; Carte c = imprumutMod.carte; Cititor ci = imprumutMod.cititor; if (e.KeyCode == Keys.Enter) { using (var formularModificaContract = new FormContract(imprumutMod)) { if (formularModificaContract.ShowDialog(this) == DialogResult.OK) { using (var form = new FormCarte(c)) { if (form.ShowDialog() == DialogResult.OK) { using (var formc = new formCititor(ci)) { formc.ShowDialog(); } } } } } } }
private void adaugareToolStripMenuItem_Click(object sender, EventArgs e) { listaImprumut.BringToFront(); listaImprumut.Enabled = true; if (listaImprumut.Visible == false) { listaImprumut.Visible = true; } if (listaCarti.Visible == true) { listaCarti.Visible = true; } using (var formular = new FormContract(null)) { if (formular.ShowDialog() == DialogResult.OK) { using (var formCarte = new FormCarte()) { if (formCarte.ShowDialog() == DialogResult.OK) { using (var formCititor = new formCititor()) { if (formCititor.ShowDialog() == DialogResult.OK) { var nouImprumut = new Imprumut(int.Parse(formular.tbNumarContract.Text) , new DateTime(int.Parse(formular.tbAn.Text), int.Parse(formular.tbLuna.Text), int.Parse(formular.tbZi.Text)), new Carte(formCarte.tbTitlu.Text, formCarte.tbAutor.Text, formCarte.tbDomeniu.Text, int.Parse(formCarte.tbCota.Text), int.Parse(formCarte.tbRaft.Text)), new Cititor(formCititor.tbNume.Text, formCititor.tbAdresa.Text, formCititor.tbCnp.Text, int.Parse(formCititor.tbVarsta.Text))); imprumuturi.Add(nouImprumut); if (nouImprumut.data_imprumut.Year == 2015) { an2015++; } if (nouImprumut.data_imprumut.Year == 2016) { an2016++; } if (nouImprumut.data_imprumut.Year == 2017) { an2017++; } if (nouImprumut.data_imprumut.Year == 2018) { an2018++; } if (nouImprumut.data_imprumut.Year == 2019) { an2019++; } ; incarcareVector(vector); afisareImprumuturi(); } } } } } } }