private void ButtonKnjizi_Click(object sender, EventArgs e) { PlacaArhiva po = new PlacaArhiva(); foreach (DataGridViewRow row in dbDataGridView1.Rows) { if (row.Cells["Odabir"].Value.ToString() == "True") { //Sum all individual item for each selected wage string oib = row.Cells["Oib"].Value.ToString(); po.Doprinos_Zdravstvo += _placaArhivaLista.Where(p => p.Oib == oib) .FirstOrDefault().Doprinos_Zdravstvo; po.Mio_1 += _placaArhivaLista.Where(p => p.Oib == oib) .FirstOrDefault().Mio_1; po.Mio_2 += _placaArhivaLista.Where(p => p.Oib == oib) .FirstOrDefault().Mio_2; po.Neto += _placaArhivaLista.Where(p => p.Oib == oib) .FirstOrDefault().Neto; po.Porezna_Osnovica += _placaArhivaLista.Where(p => p.Oib == oib) .FirstOrDefault().Porezna_Osnovica; po.Prirez += _placaArhivaLista.Where(p => p.Oib == oib) .FirstOrDefault().Prirez; po.Porez_Ukupno += _placaArhivaLista.Where(p => p.Oib == oib) .FirstOrDefault().Porez_Ukupno; po.Ukupno_Porez_i_Prirez += _placaArhivaLista.Where(p => p.Oib == oib) .FirstOrDefault().Ukupno_Porez_i_Prirez; } } po.Datum_obracuna = dbDataGridView1.Rows[0].Cells["Datum_obracuna"].Value.ToString().Split(' ')[0]; TemeljnicaPripremaForm form = new TemeljnicaPripremaForm(po, _postavkeKnjizenja); form.ShowDialog(); }
private void LoadListPlacaArhiva() { _placaArhivaLista.Clear(); foreach (DataGridViewRow row in dbDataGridView1.Rows) { if (row.Cells["Odabir"].Value.ToString() == "True") { PlacaArhiva p = _placaArhiva.ConvertDataRow(row); p.Datum_Od = dateTimePickerDatumOd.Value.ToString("yyyy-MM-dd"); p.Datum_Do = dateTimePickerDatumDo.Value.ToString("yyyy-MM-dd"); p.Datum_obracuna = dateTimePickerDatumObracuna.Value.ToString("yyyy-MM-dd"); _placaArhivaLista.Add(p); } } }
private void ButtonBrisiOdabrane_Click(object sender, EventArgs e) { foreach (DataGridViewRow row in dbDataGridView1.Rows) { if (row.Cells["Odabir"].Value.ToString() == "True") { int id = int.Parse(row.Cells["Id"].Value.ToString()); _placaArhiva = new PlacaArhiva() { Id = id }; _placaArhiva.DeleteRow(); } } ButtonDohvatArhiva_Click(null, null); }