/// <summary> /// Deletes selected employee from database and wage settings related to him, excep archive data /// </summary> /// <returns>bool</returns> public bool DeleteZaposlenik() { DbDataDelete del = new DbDataDelete(); Placa p = new Placa(); p.GetPlacaByOib(Oib); del.DeleteItem(p); ZaposlenikJoppd z = new ZaposlenikJoppd(); z = z.GetZaposlenikByOib(Oib); del.DeleteItem(z); Dodatak d = new Dodatak(); foreach (DataRow row in d.GetDodaciByOib(Oib).Rows) { del.DeleteItem( new Dodatak() { Id = int.Parse(row.ItemArray[0].ToString()) }); } return(del.DeleteItem(this)); }
private void DeaktivirajClick(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Jeste li sigurni?", "Provjera", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { Dodatak dodatak = new Dodatak(); dodatak.Id = int.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString()); dodatak.Deaktiviraj(); UcitajPodatke(); } }
private void DeaktivirajSveClick(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Jeste li sigurni da želite obrisati SVE?", "Provjera", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { Dodatak dodatak = new Dodatak(); foreach (DataGridViewRow row in dataGridView1.Rows) { dodatak.Id = int.Parse(row.Cells[0].Value.ToString()); dodatak.Deaktiviraj(); } UcitajPodatke(); } }
public void UcitajPodatke() { dataGridView1.Rows.Clear(); Dodatak dodatak = new Dodatak(); foreach (var item in dodatak.DajListu()) { dataGridView1.Rows.Add( item.Id, item.Naziv, item.BrojDana, item.GodinaPrava ); } HasRows(); }