Beispiel #1
0
        /// <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));
        }
Beispiel #2
0
        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();
            }
        }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
        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();
        }