Ejemplo n.º 1
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (!vm.ProzorJeDemoMod)
            {
                for (int i = 0; i < vm.SviSmerovi.Count; ++i)
                {
                    if (vm.SviSmerovi[i].IsChecked == true)
                    {
                        vm.Predmet.Smerovi.Add(vm.Smerovi[i]);
                    }
                }

                for (int i = 0; i < vm.SviSoftveri.Count; ++i)
                {
                    if (vm.SviSoftveri[i].IsChecked == true)
                    {
                        vm.Predmet.NeophodanSoftver.Add(vm.Softveri[i]);
                    }
                }

                DataDAO.getDataDAO().Predmeti.Add(vm.Predmet);
                DataDAO.getDataDAO().writePredmetToFile <Predmet>(DataDAO.getDataDAO().Predmeti);
                MessageBox.Show("Predmet je uspesno kreiran.");
                this.Close();
            }
            else
            {
                MessageBoxResult messageBox = System.Windows.MessageBox.Show("Nalazite se u demo modu, uneseni podaci nece biti sacuvani. Da li ste sugurni da zelite izaci iz demo moda?", "Napusti demo mod", System.Windows.MessageBoxButton.YesNo);
                if (messageBox == MessageBoxResult.Yes)
                {
                    this.Close();
                }
            }
        }
Ejemplo n.º 2
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            vm.Ucionica.InstaliranSoftver.Clear();
            for (int i = 0; i < vm.SviSoftveri.Count; ++i)
            {
                if (vm.SviSoftveri[i].IsChecked == true)
                {
                    vm.Ucionica.InstaliranSoftver.Add(vm.Softveri[i]);
                }
            }

            List <Ucionica> ucionice = new List <Ucionica>();

            foreach (Ucionica ucionica in DataDAO.getDataDAO().Ucionice)
            {
                if (ucionica.Id == vm.stariIdUcinice)
                {
                    ucionice.Add(vm.Ucionica);
                }
                else
                {
                    ucionice.Add(ucionica);
                }
            }
            DataDAO.getDataDAO().Ucionice = ucionice;
            DataDAO.getDataDAO().writeUcionicaToFile <Ucionica>(ucionice);
            this.Close();
        }
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     DataDAO.getDataDAO().Softveri.Add(vm.Softver);
     DataDAO.getDataDAO().writeSoftverToFile <Softver>(DataDAO.getDataDAO().Softveri);
     System.Windows.MessageBox.Show("Softver je uspesno kreiran.");
     this.Close();
 }
Ejemplo n.º 4
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     DataDAO.getDataDAO().Smerovi.Add(vm.Smer);
     DataDAO.getDataDAO().writeSmerToFile <Smer>(DataDAO.getDataDAO().Smerovi);
     MessageBox.Show("Smer je uspesno kreiran.");
     this.Close();
 }
Ejemplo n.º 5
0
        public IzmeniUcionicuDialog(Ucionica ucionica)
        {
            InitializeComponent();

            vm = new ViewModel();

            vm.Ucionica       = ucionica;
            vm.stariIdUcinice = ucionica.Id;
            vm.Softveri       = DataDAO.getDataDAO().Softveri;
            vm.SviSoftveri    = new List <CheckBox>();
            this.DataContext  = vm;

            int brojacSo = 0;

            foreach (Softver softver in vm.Softveri)
            {
                if (brojacSo % 6 == 0)
                {
                    ListaInstaliranogSoftvera.RowDefinitions.Add(new RowDefinition());
                }

                // Define StackPanel to CheckBox
                StackPanel sp = new StackPanel();
                sp.MinHeight = 56;
                sp.MaxHeight = 56;
                sp.Margin    = new System.Windows.Thickness(5, 2, 5, 2);

                // Define tag which is CheckVox
                CheckBox cb = new CheckBox();
                cb.FontSize = 24;
                cb.Margin   = new System.Windows.Thickness(5, 5, 5, 5);
                cb.Content  = softver.Naziv;

                foreach (Softver softverOznacen in vm.Ucionica.InstaliranSoftver)
                {
                    if (softverOznacen.Id == softver.Id)
                    {
                        cb.IsChecked = true;
                        break;
                    }
                }


                vm.SviSoftveri.Add(cb);

                sp.Children.Add(cb);
                Grid.SetColumn(sp, brojacSo % 6);
                Grid.SetRow(sp, brojacSo / 6);
                ListaInstaliranogSoftvera.Children.Add(sp);
                ++brojacSo;
            }
        }
Ejemplo n.º 6
0
        public PrikaziSveUcioniceDialog()
        {
            InitializeComponent();
            IzabranaUcionica = null;

            this.DataContext = this;

            Ucionice    = new ObservableCollection <Ucionica>();
            SveUcionice = new List <Ucionica>();
            Softveri    = DataDAO.getDataDAO().Softveri;
            SviSoftveri = new List <CheckBox>();

            foreach (Ucionica u in DataDAO.getDataDAO().Ucionice)
            {
                Ucionice.Add(u);
                SveUcionice.Add(u);
            }

            int brojacSo = 0;

            foreach (Softver softver in Softveri)
            {
                if (brojacSo % 6 == 0)
                {
                    ListaInstaliranogSoftvera.RowDefinitions.Add(new RowDefinition());
                }

                // Define StackPanel to CheckBox
                StackPanel sp = new StackPanel();
                sp.MinHeight = 56;
                sp.MaxHeight = 56;
                sp.Margin    = new System.Windows.Thickness(5, 2, 5, 2);

                // Define tag which is CheckVox
                CheckBox cb = new CheckBox();
                cb.FontSize = 24;
                cb.Margin   = new System.Windows.Thickness(5, 5, 5, 5);
                cb.Content  = softver.Naziv;
                SviSoftveri.Add(cb);

                sp.Children.Add(cb);
                Grid.SetColumn(sp, brojacSo % 6);
                Grid.SetRow(sp, brojacSo / 6);
                ListaInstaliranogSoftvera.Children.Add(sp);
                ++brojacSo;
            }
        }
Ejemplo n.º 7
0
        public PrikaziSveSmeroveDialog()
        {
            InitializeComponent();

            IzabranSmer = null;

            this.DataContext = this;

            Smerovi    = new ObservableCollection <Smer>();
            SviSmerovi = new List <Smer>();
            foreach (Smer s in DataDAO.getDataDAO().Smerovi)
            {
                Smerovi.Add(s);
                SviSmerovi.Add(s);
            }

            SmerBeg = DateTime.Now;
            SmerEnd = DateTime.Now;
        }
Ejemplo n.º 8
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            List <Softver> softveri = new List <Softver>();

            foreach (Softver softver in DataDAO.getDataDAO().Softveri)
            {
                if (softver.Id == vm.StariIdSoftvera)
                {
                    softveri.Add(vm.Softver);
                }
                else
                {
                    softveri.Add(softver);
                }
            }
            DataDAO.getDataDAO().Softveri = softveri;
            DataDAO.getDataDAO().writeSoftverToFile <Softver>(softveri);
            this.Close();
        }
Ejemplo n.º 9
0
        private void ObrisiSmer_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult messageBox = System.Windows.MessageBox.Show(
                "Da li ste sigurni da zelite obrisati smer ("
                + IzabranSmer.Id + " " + IzabranSmer.Naziv + ")?",
                "Potvrda brisanja", System.Windows.MessageBoxButton.YesNo);

            if (messageBox == MessageBoxResult.Yes)
            {
                Smerovi.Remove(IzabranSmer);

                List <Smer> smerovi = new List <Smer>();
                foreach (Smer s in Smerovi)
                {
                    smerovi.Add(s);
                }
                DataDAO.getDataDAO().Smerovi = smerovi;
                DataDAO.getDataDAO().writeSmerToFile <Smer>(smerovi);
            }
        }
        public PrikaziSveSoftvereDialog()
        {
            InitializeComponent();

            IzabranSoftver = null;

            this.DataContext = this;

            Softveri    = new ObservableCollection <Softver>();
            SviSoftveri = new List <Softver>();

            foreach (Softver s in DataDAO.getDataDAO().Softveri)
            {
                Softveri.Add(s);
                SviSoftveri.Add(s);
            }

            GodinaIzdavanjaMin = 2000;
            GodinaIzdavanjaMax = 2000;
        }
Ejemplo n.º 11
0
        private void ObrisiUcionicu_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult messageBox = System.Windows.MessageBox.Show(
                "Da li ste sigurni da zelite obrisati smer ("
                + IzabranaUcionica.Id + " " + ")?",
                "Potvrda brisanja", System.Windows.MessageBoxButton.YesNo);

            if (messageBox == MessageBoxResult.Yes)
            {
                Ucionice.Remove(IzabranaUcionica);

                List <Ucionica> ucionice = new List <Ucionica>();
                foreach (Ucionica p in Ucionice)
                {
                    ucionice.Add(p);
                }
                DataDAO.getDataDAO().Ucionice = ucionice;
                DataDAO.getDataDAO().writeUcionicaToFile <Ucionica>(ucionice);
            }
        }
        private void ObrisiPredmet_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult messageBox = System.Windows.MessageBox.Show(
                "Da li ste sigurni da zelite obrisati smer ("
                + IzabranPredmet.Id + " " + IzabranPredmet.Naziv + ")?",
                "Potvrda brisanja", System.Windows.MessageBoxButton.YesNo);

            if (messageBox == MessageBoxResult.Yes)
            {
                Predmeti.Remove(IzabranPredmet);

                List <Predmet> predmeti = new List <Predmet>();
                foreach (Predmet p in Predmeti)
                {
                    predmeti.Add(p);
                }
                DataDAO.getDataDAO().Predmeti = predmeti;
                DataDAO.getDataDAO().writePredmetToFile <Predmet>(predmeti);
            }
        }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < vm.SviSoftveri.Count; ++i)
            {
                if (vm.SviSoftveri[i].IsChecked == true)
                {
                    vm.Ucionica.InstaliranSoftver.Add(vm.Softveri[i]);
                }
            }

            DataDAO.getDataDAO().Ucionice.Add(vm.Ucionica);
            DataDAO.getDataDAO().writeUcionicaToFile <Ucionica>(DataDAO.getDataDAO().Ucionice);

            if (Check != null)
            {
                Check(vm.Ucionica);
            }

            MessageBox.Show("Ucionica je uspesno kreirana.");
            this.Close();
        }
Ejemplo n.º 14
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            vm.Predmet.Smerovi.Clear();
            for (int i = 0; i < vm.SviSmerovi.Count; ++i)
            {
                if (vm.SviSmerovi[i].IsChecked == true)
                {
                    vm.Predmet.Smerovi.Add(vm.Smerovi[i]);
                }
            }

            vm.Predmet.NeophodanSoftver.Clear();
            for (int i = 0; i < vm.SviSoftveri.Count; ++i)
            {
                if (vm.SviSoftveri[i].IsChecked == true)
                {
                    vm.Predmet.NeophodanSoftver.Add(vm.Softveri[i]);
                }
            }

            List <Predmet> predmeti = new List <Predmet>();

            foreach (Predmet predmet in DataDAO.getDataDAO().Predmeti)
            {
                if (predmet.Id == vm.StariIdPredmeta)
                {
                    predmeti.Add(vm.Predmet);
                }
                else
                {
                    predmeti.Add(predmet);
                }
            }
            DataDAO.getDataDAO().Predmeti = predmeti;
            DataDAO.getDataDAO().writePredmetToFile <Predmet>(predmeti);
            this.Close();
        }
Ejemplo n.º 15
0
        public IzmeniPredmetDialog(Predmet predmet)
        {
            InitializeComponent();

            vm = new ViewModel();

            vm.Predmet                        = predmet;
            vm.Predmet.Naziv                  = predmet.Naziv;
            vm.Predmet.Opis                   = predmet.Opis;
            vm.Predmet.OperativniSistemP      = predmet.OperativniSistemP;
            vm.Predmet.PotrebanProjektor      = predmet.PotrebanProjektor;
            vm.Predmet.PotrebnaPametnaTabla   = predmet.PotrebnaPametnaTabla;
            vm.Predmet.PotrebnaTabla          = predmet.PotrebnaTabla;
            vm.Predmet.VelicinaGrupe          = predmet.VelicinaGrupe;
            vm.Predmet.MinimalnaDuzinaTermina = predmet.MinimalnaDuzinaTermina;
            vm.Predmet.BrojTerminaPredmeta    = predmet.BrojTerminaPredmeta;

            vm.Smerovi         = DataDAO.getDataDAO().Smerovi;
            vm.Softveri        = DataDAO.getDataDAO().Softveri;
            vm.SviSmerovi      = new List <CheckBox>();
            vm.SviSoftveri     = new List <CheckBox>();
            vm.StariIdPredmeta = predmet.Id;
            this.DataContext   = vm;

            int brojacS = 0;

            foreach (Smer smer in vm.Smerovi)
            {
                if (brojacS % 6 == 0)
                {
                    ListaSmerova.RowDefinitions.Add(new RowDefinition());
                }

                // Define StackPanel to CheckBox
                StackPanel sp = new StackPanel();
                sp.MinHeight = 56;
                sp.MaxHeight = 56;
                sp.Margin    = new System.Windows.Thickness(5, 2, 5, 2);

                // Define tag which is CheckVox
                CheckBox cb = new CheckBox();
                cb.Margin   = new System.Windows.Thickness(5, 5, 5, 5);
                cb.Content  = smer.Naziv;
                cb.FontSize = 24;

                foreach (Smer smerOznacen in vm.Predmet.Smerovi)
                {
                    if (smerOznacen.Id == smer.Id)
                    {
                        cb.IsChecked = true;
                        break;
                    }
                }

                vm.SviSmerovi.Add(cb);

                sp.Children.Add(cb);
                Grid.SetColumn(sp, brojacS % 6);
                Grid.SetRow(sp, brojacS / 6);
                ListaSmerova.Children.Add(sp);
                ++brojacS;
            }

            int brojacSo = 0;

            foreach (Softver softver in vm.Softveri)
            {
                if (brojacSo % 6 == 0)
                {
                    ListaSoftvera.RowDefinitions.Add(new RowDefinition());
                }

                // Define StackPanel to CheckBox
                StackPanel sp = new StackPanel();
                sp.MinHeight = 56;
                sp.MaxHeight = 56;
                sp.Margin    = new System.Windows.Thickness(5, 2, 5, 2);

                // Define tag which is CheckVox
                CheckBox cb = new CheckBox();
                cb.Margin   = new System.Windows.Thickness(5, 5, 5, 5);
                cb.Content  = softver.Naziv;
                cb.FontSize = 24;
                foreach (Softver softverOznacen in vm.Predmet.NeophodanSoftver)
                {
                    if (softverOznacen.Id == softver.Id)
                    {
                        cb.IsChecked = true;
                        break;
                    }
                }

                vm.SviSoftveri.Add(cb);

                sp.Children.Add(cb);
                Grid.SetColumn(sp, brojacSo % 6);
                Grid.SetRow(sp, brojacSo / 6);
                ListaSoftvera.Children.Add(sp);
                ++brojacSo;
            }
        }
        public PrikaziSvePredmeteDialog()
        {
            InitializeComponent();

            IzabranPredmet = null;

            this.DataContext = this;

            Predmeti    = new ObservableCollection <Predmet>();
            SviPredmeti = new List <Predmet>();
            Softveri    = DataDAO.getDataDAO().Softveri;
            SviSoftveri = new List <CheckBox>();
            Smerovi     = DataDAO.getDataDAO().Smerovi;
            SviSmerovi  = new List <CheckBox>();

            foreach (Predmet p in DataDAO.getDataDAO().Predmeti)
            {
                Predmeti.Add(p);
                SviPredmeti.Add(p);
            }

            int brojacSo = 0;

            foreach (Softver softver in Softveri)
            {
                if (brojacSo % 6 == 0)
                {
                    ListaSoftvera.RowDefinitions.Add(new RowDefinition());
                }

                // Define StackPanel to CheckBox
                StackPanel sp = new StackPanel();
                sp.MinHeight = 56;
                sp.MaxHeight = 56;
                sp.Margin    = new System.Windows.Thickness(5, 2, 5, 2);

                // Define tag which is CheckVox
                CheckBox cb = new CheckBox();
                cb.FontSize = 24;
                cb.Margin   = new System.Windows.Thickness(5, 5, 5, 5);
                cb.Content  = softver.Naziv;
                SviSoftveri.Add(cb);

                sp.Children.Add(cb);
                Grid.SetColumn(sp, brojacSo % 6);
                Grid.SetRow(sp, brojacSo / 6);
                ListaSoftvera.Children.Add(sp);
                ++brojacSo;
            }

            int brojacS = 0;

            foreach (Smer smer in Smerovi)
            {
                if (brojacS % 6 == 0)
                {
                    ListaSmerova.RowDefinitions.Add(new RowDefinition());
                }

                // Define StackPanel to CheckBox
                StackPanel sp = new StackPanel();
                sp.MinHeight = 56;
                sp.MaxHeight = 56;
                sp.Margin    = new System.Windows.Thickness(5, 2, 5, 2);

                // Define tag which is CheckVox
                CheckBox cb = new CheckBox();
                cb.FontSize = 24;
                cb.Margin   = new System.Windows.Thickness(5, 5, 5, 5);
                cb.Content  = smer.Naziv;
                SviSmerovi.Add(cb);

                sp.Children.Add(cb);
                Grid.SetColumn(sp, brojacS % 6);
                Grid.SetRow(sp, brojacS / 6);
                ListaSmerova.Children.Add(sp);
                ++brojacS;
            }
        }
Ejemplo n.º 17
0
        public DodajPredmetDialog()
        {
            InitializeComponent();

            vm = new ViewModel();

            vm.Predmet       = new Predmet();
            vm.Smerovi       = DataDAO.getDataDAO().Smerovi;
            vm.Softveri      = DataDAO.getDataDAO().Softveri;
            vm.SviSmerovi    = new List <CheckBox>();
            vm.SviSoftveri   = new List <CheckBox>();
            this.DataContext = vm;

            int brojacS = 0;

            foreach (Smer smer in vm.Smerovi)
            {
                if (brojacS % 6 == 0)
                {
                    ListaSmerova.RowDefinitions.Add(new RowDefinition());
                }

                // Define StackPanel to CheckBox
                StackPanel sp = new StackPanel();
                sp.MinHeight = 56;
                sp.MaxHeight = 56;
                sp.Margin    = new System.Windows.Thickness(5, 2, 5, 2);

                // Define tag which is CheckVox
                CheckBox cb = new CheckBox();
                cb.FontSize = 24;
                cb.Margin   = new System.Windows.Thickness(5, 5, 5, 5);
                cb.Content  = smer.Naziv;
                vm.SviSmerovi.Add(cb);

                sp.Children.Add(cb);
                Grid.SetColumn(sp, brojacS % 6);
                Grid.SetRow(sp, brojacS / 6);
                ListaSmerova.Children.Add(sp);
                ++brojacS;
            }

            int brojacSo = 0;

            foreach (Softver softver in vm.Softveri)
            {
                if (brojacSo % 6 == 0)
                {
                    ListaSoftvera.RowDefinitions.Add(new RowDefinition());
                }

                // Define StackPanel to CheckBox
                StackPanel sp = new StackPanel();
                sp.MinHeight = 56;
                sp.MaxHeight = 56;
                sp.Margin    = new System.Windows.Thickness(5, 2, 5, 2);

                // Define tag which is CheckVox
                CheckBox cb = new CheckBox();
                cb.FontSize = 24;
                cb.Margin   = new System.Windows.Thickness(5, 5, 5, 5);
                cb.Content  = softver.Naziv;
                vm.SviSoftveri.Add(cb);

                sp.Children.Add(cb);
                Grid.SetColumn(sp, brojacSo % 6);
                Grid.SetRow(sp, brojacSo / 6);
                ListaSoftvera.Children.Add(sp);
                ++brojacSo;
            }

            DemoPokrenut = 1;
        }