Example #1
0
        private int CheckDuplicate(Dodatak dodatak)
        {
            DataTable table = new DbDataGet().GetTable(dodatak, $"Oib='{_zaposlenik.Oib}' AND Sifra={_sifra};");

            foreach (DataRow row in table.Rows)
            {
                if (row["Oib"].ToString() == dodatak.Oib && row["Sifra"].ToString() == dodatak.Sifra)
                {
                    return(int.Parse(row["Id"].ToString()));
                }
            }
            return(0);
        }
Example #2
0
        private void PopuniDodaci()
        {
            DataTable      dt   = new Dodatak().GetDodaciByOib(_zaposlenik.Oib);
            List <DataRow> rows = dt.AsEnumerable().ToList();

            _placa.AddDodaci((from DataRow row in rows
                              select new Dodatak()
            {
                Id = int.Parse(row["Id"].ToString()),
                Oib = row["Oib"].ToString(),
                Sifra = row["Sifra"].ToString(),
                Iznos = decimal.Parse(row["Iznos"].ToString())
            }).ToList());
            textBoxDodaci.Text = _placa.Dodaci_Ukupno.ToString();
        }