private void DodatneUslugePrelaz(object sender, RoutedEventArgs e)
        {
            cbSortiranje.Items.Clear();

            podaci = Podaci.DodatneUsluge;
            dgNamestaj.ItemsSource = DodatnaUsluga.GetAll();
            dgNamestaj.IsSynchronizedWithCurrentItem = true;
            view = CollectionViewSource.GetDefaultView(DodatnaUsluga.GetAll());
        }
Пример #2
0
 private void GetAllDB()
 {
     TipNamestaja.GetAll();
     Namestaj.GetAll();
     Akcija.GetAll();
     Korisnik.GetAll();
     Racun.GetAll();
     DodatnaUsluga.GetAll();
 }
Пример #3
0
        public ObservableCollection <StavkaNamestaja> stavka;            //stavka


        private Projekat()
        {
            tipnamestaja  = TipNamestaja.GetAll();
            namestaj      = Namestaj.GetAll();
            dodatnausluga = DodatnaUsluga.GetAll();
            korisnik      = Korisnik.GetAll();
            akcija        = Akcija.GetAll();
            salon         = Salon.GetAll();

            prodajanamestaja = ProdajaNamestaja.GetAll();
        }
        public ProdajaNamestajaWindow(Racun racun, Operacija operacija)
        {
            InitializeComponent();

            this.racun     = racun;
            this.operacija = operacija;
            foreach (var spNamestaj in Projekat.Instance.SPNamestaj)
            {
                if (racun.Id == spNamestaj.RacunId)
                {
                    korpaNamestaj.Add(spNamestaj);
                }
            }
            foreach (var spDodatnaUsluga in Projekat.Instance.SPDodatneUsluge)
            {
                if (racun.Id == spDodatnaUsluga.RacunId)
                {
                    korpaDodatneUsluge.Add(spDodatnaUsluga);
                }
            }

            tbKupac.DataContext      = racun;
            tbBrojRacuna.DataContext = racun;
            tbUkupnaCena.DataContext = racun;

            switch (operacija)
            {
            case Operacija.DODAVANJE:

                viewNamestaj      = CollectionViewSource.GetDefaultView(korpaNamestaj);
                viewDodatneUsluge = CollectionViewSource.GetDefaultView(korpaDodatneUsluge);
                // viewNamestaj.Filter = namestajFilter;
                dgNamestajKorpa.ItemsSource = viewNamestaj;
                dgNamestajKorpa.IsSynchronizedWithCurrentItem = true;
                dgNamestajKorpa.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);

                dgNamestajSalon.ItemsSource = Model.Namestaj.GetAll();
                dgNamestajSalon.IsSynchronizedWithCurrentItem = true;
                dgNamestajSalon.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);


                dgUslugeSalon.ItemsSource = DodatnaUsluga.GetAll();
                dgUslugeSalon.IsSynchronizedWithCurrentItem = true;
                dgUslugeSalon.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);

                dgIzabraneUsluge.ItemsSource = viewDodatneUsluge;
                dgIzabraneUsluge.IsSynchronizedWithCurrentItem = true;
                dgIzabraneUsluge.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);
                break;

            case Operacija.IZMENA:

                viewNamestaj      = CollectionViewSource.GetDefaultView(korpaNamestaj);
                viewDodatneUsluge = CollectionViewSource.GetDefaultView(korpaDodatneUsluge);

                // viewNamestaj.Filter = namestajFilter;
                dgNamestajKorpa.ItemsSource = viewNamestaj;
                dgNamestajKorpa.IsSynchronizedWithCurrentItem = true;
                dgNamestajKorpa.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);

                dgNamestajSalon.ItemsSource = Model.Namestaj.GetAll();
                dgNamestajSalon.IsSynchronizedWithCurrentItem = true;
                dgNamestajSalon.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);


                dgUslugeSalon.ItemsSource = DodatnaUsluga.GetAll();
                dgUslugeSalon.IsSynchronizedWithCurrentItem = true;
                dgUslugeSalon.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);

                dgIzabraneUsluge.ItemsSource = viewDodatneUsluge;
                dgIzabraneUsluge.IsSynchronizedWithCurrentItem = true;
                dgIzabraneUsluge.ColumnWidth = new DataGridLength(1, DataGridLengthUnitType.Star);
                break;
            }
        }