/// <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 ButtonSpremiJoppdPostavke_Click(object sender, EventArgs e) { ZaposlenikJoppd provjera = new ZaposlenikJoppd().GetZaposlenikByOib(_zaposlenik.Oib); SetZaposlenikJoppd(); if (provjera.Id == 0) { if (new DbDataInsert().InsertData(_zaposlenikJoppd)) { MessageBox.Show("Podaci za JOPPD ažurirani.", "Izračun", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { _zaposlenikJoppd.Id = provjera.Id; if (new DbDataUpdate().UpdateData(_zaposlenikJoppd)) { MessageBox.Show("Podaci za JOPPD ažurirani.", "Izračun", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }