示例#1
0
        public int DajSifru(IDomenskiObjekat ido)
        {
            string     upit    = @"select MAX(" + ido.ImeKljuca() + ") from " + ido.NazivTabele() + "";
            SqlCommand komanda = new SqlCommand(upit, konekcija, transakcija);

            try
            {
                try
                {
                    int sifra = Convert.ToInt32(komanda.ExecuteScalar());
                    return(sifra + 1);
                }
                catch (Exception)
                {
                    return(1);
                }
            }
            catch (Exception)
            {
                throw new Exception("Greška!");
            }
        }