Example #1
0
        public static void Main(string[] args)
        {
            Artikal artikal = new Artikal("Mleveno meso", 12, 2);
            Kupac   kupac   = new Kupac(12);

            kupac.DodajArtikal(artikal);

            Univer univer = new Univer(2, 1);

            univer.IzaberiIDodajKupcaNaKasu(kupac);

            univer.UsluziKupcaNaKasi(0);
            Console.WriteLine(univer);
            univer.GenerisiIzvestaj();
        }
        private async void dodajArtikal_Click(object sender, RoutedEventArgs e)
        {
            Artikal noviArtikal = new Artikal();

            noviArtikal.NazivArtikla  = nazivArtikla.Text;
            noviArtikal.CijenaArtikla = Double.Parse(cijenaArtikla.Text);
            var byteArray = new byte[1];

            try
            {
                using (var inputStream = await storeFile.OpenSequentialReadAsync())
                {
                    var readStream = inputStream.AsStreamForRead();

                    byteArray = new byte[readStream.Length];
                    await readStream.ReadAsync(byteArray, 0, byteArray.Length);
                }
                noviArtikal.Slika = byteArray;
            }
            catch (Exception)
            {
            }
            DataSource.DataSource.Data.Inventar.dodajArtikal(noviArtikal, Int32.Parse(brojArtikala.Text));
        }
Example #3
0
 public void DodajArtikal(Artikal a)
 {
     artikli.Add(a);
 }