Exemple #1
0
        protected void OnButtonZakljuciClicked(object sender, EventArgs e)
        {
            NarudzbeNode n = (nodeviewNarudzbe.NodeSelection.SelectedNode as NarudzbeNode);

            if (n != null)
            {
                DialogBox.ShowNoneButtons(this, "Printanje...", 2000);
                n.Zakljuci();
                narudzbeNodeStore.RemoveNode(n);
                ClearForm();
            }
        }
Exemple #2
0
        protected void OnButtonSpremiClicked(object sender, EventArgs e)
        {
            NarudzbeNode n = (nodeviewNarudzbe.NodeSelection.SelectedNode as NarudzbeNode);

            if (n != null)
            {
                try {
                    n.Update(comboboxOznakaStola.Active);
                } catch (ArgumentException ae) {
                    DialogBox.ShowError(this, ae.Message);
                }
                hboxSpremljen.Show();
                GLib.Timeout.Add(2000, () => { hboxSpremljen.Hide(); return(false); });
            }
        }
Exemple #3
0
        protected void RefreshStatusNodeView()
        {
            if (prikazStatusSve)
            {
                switch (comboboxStatus.Active)
                {
                case 0: PrikaziStatus(StavkaNarudzbe.StatusStavke.Dostavljeno, true); break;

                case 1: PrikaziStatus(StavkaNarudzbe.StatusStavke.NaCekanju); break;

                case 2: PrikaziStatus(StavkaNarudzbe.StatusStavke.UObradi); break;

                case 3: PrikaziStatus(StavkaNarudzbe.StatusStavke.Gotovo); break;

                case 4: PrikaziStatus(StavkaNarudzbe.StatusStavke.Dostavljeno); break;

                case 5: PrikaziStatus(); break;
                }
                return;
            }

            NarudzbeNode n = (nodeviewNarudzbe.NodeSelection.SelectedNode as NarudzbeNode);

            if (!prikazStatusSve && n != null)
            {
                switch (comboboxStatus.Active)
                {
                case 0: PrikaziStatus(StavkaNarudzbe.StatusStavke.Dostavljeno, n.stavkeNarudzbeNodeStore, true); break;

                case 1: PrikaziStatus(StavkaNarudzbe.StatusStavke.NaCekanju); break;

                case 2: PrikaziStatus(StavkaNarudzbe.StatusStavke.UObradi); break;

                case 3: PrikaziStatus(StavkaNarudzbe.StatusStavke.Gotovo); break;

                case 4: PrikaziStatus(StavkaNarudzbe.StatusStavke.Dostavljeno); break;

                case 5: nodeviewNarudzbeStatus.NodeStore = n.stavkeNarudzbeNodeStore; break;
                }
            }
            else
            {
                nodeviewNarudzbeStatus.NodeStore = null;
            }
        }
Exemple #4
0
        protected void OnButtonDeleteNarudzbaClicked(object sender, EventArgs e)
        {
            NarudzbeNode n = (nodeviewNarudzbe.NodeSelection.SelectedNode as NarudzbeNode);

            if (n != null && n.HasStavke())
            {
                if (DialogBox.ShowDaNeQuestion(this, "Narudžba sadrži stavke koje će se obrisati brisanjem narudzbe, želite li nastaviti?"))
                {
                    narudzbeNodeStore.IzbrisiNarudzbu(n);
                    ClearForm();
                }
            }
            else if (n != null)
            {
                narudzbeNodeStore.IzbrisiNarudzbu(n);
                ClearForm();
            }
        }
Exemple #5
0
        protected void NodeSelectionChanged(object sender, EventArgs e)
        {
            if (!prikazStatusSve)
            {
                RefreshStatusNodeView();
            }

            NarudzbeNode n = (nodeviewNarudzbe.NodeSelection.SelectedNode as NarudzbeNode);

            if (n != null)
            {
                fixedrestoransheme.TableSelected -= FixedRestoranShemeTableSelected;
                fixedrestoransheme.SelectTable(n.OznakaStola);
                fixedrestoransheme.TableSelected += FixedRestoranShemeTableSelected;

                labelBroj.LabelProp        = n.Broj;
                labelDatum.LabelProp       = n.Datum;
                comboboxOznakaStola.Active = StoloviPresenter.stoloviList.FindIndex(s => s.Oznaka == n.OznakaStola);
                labelUkupno.LabelProp      = n.Ukupno;
            }
        }
Exemple #6
0
        protected void OnButtonStavkeClicked(object sender, EventArgs e)
        {
            NarudzbeNode n = (nodeviewNarudzbe.NodeSelection.SelectedNode as NarudzbeNode);

            if (n == null)
            {
                return;
            }
            switch (Open(1))
            {
            case 0:
                StavkeWindow sw = new StavkeWindow(n, narudzbeNodeStore, false);
                sw.Destroyed += (o, args) => { notebookMain.Page = 0; };

                boxStavke.Foreach(box => boxStavke.Remove(box));
                boxStavke.Add(sw.GetContent());
                break;

            case 1: StavkeWindow s = new StavkeWindow(n, narudzbeNodeStore, true); break;

            case 2: break;
            }
            nodeviewNarudzbe.NodeSelection.SelectedNode.Changed += (o, a) => { labelUkupno.LabelProp = (o as NarudzbeNode).Ukupno; };
        }
 public void IzbrisiNarudzbu(NarudzbeNode n)
 {
     this.RemoveNode(n);
     DBNarudzba.DeleteNarudzba(n.narudzba);
     MainWindow.stavkeChanged();
 }
Exemple #8
0
        public StavkeWindow(NarudzbeNode n, NarudzbeNodeStore ns, bool prikazi) : base(Gtk.WindowType.Toplevel)
        {
            this.Build();
            if (prikazi)
            {
                this.Show();
            }

            narudzba                 = n;
            narudzbaStore            = ns;
            nodeviewStavke.NodeStore = n.stavkeNarudzbeNodeStore;

            CellRendererText   statusText   = new CellRendererText();
            CellRendererPixbuf statusPixbuf = new CellRendererPixbuf();

            TreeViewColumn statusColumn = new TreeViewColumn();

            statusColumn.Title    = "Status";
            statusColumn.MinWidth = 50;
            statusColumn.PackStart(statusPixbuf, false);
            statusColumn.PackStart(statusText, true);
            statusColumn.AddAttribute(statusPixbuf, "pixbuf", 5);
            statusColumn.AddAttribute(statusText, "text", 6);

            nodeviewStavke.AppendColumn("Šifra", new CellRendererText(), "text", 0).MinWidth    = 150;
            nodeviewStavke.AppendColumn("Naziv", new CellRendererText(), "text", 1).MinWidth    = 200;
            nodeviewStavke.AppendColumn("Cijena", new CellRendererText(), "text", 2).MinWidth   = 100;
            nodeviewStavke.AppendColumn("Količina", new CellRendererText(), "text", 3).MinWidth = 80;
            nodeviewStavke.AppendColumn("Ukupno", new CellRendererText(), "text", 4).MinWidth   = 100;
            nodeviewStavke.AppendColumn(statusColumn);

            dropdownStatusListStore.AppendValues(Pixbuf.LoadFromResource("NewRestoran.images.NaCekanju.png").ScaleSimple(20, 20, InterpType.Bilinear), "Na čekanju");
            dropdownStatusListStore.AppendValues(Pixbuf.LoadFromResource("NewRestoran.images.UObradi.png").ScaleSimple(20, 20, InterpType.Bilinear), "U obradi");
            dropdownStatusListStore.AppendValues(Pixbuf.LoadFromResource("NewRestoran.images.Gotovo.png").ScaleSimple(20, 20, InterpType.Bilinear), "Gotovo");
            dropdownStatusListStore.AppendValues(Pixbuf.LoadFromResource("NewRestoran.images.Dostavljeno.png").ScaleSimple(20, 20, InterpType.Bilinear), "Dostavljeno");

            comboboxStatus.Model = dropdownStatusListStore;
            comboboxStatus.PackStart(statusPixbuf, false);
            comboboxStatus.PackStart(statusText, true);
            comboboxStatus.AddAttribute(statusPixbuf, "pixbuf", 0);
            comboboxStatus.AddAttribute(statusText, "text", 1);

            nodeviewStavke.NodeSelection.Changed += NodeSelectionChanged;
            comboboxSifraArtikla.Model            = ArtikliPresenter.ArtikliListStore;

            vboxFormView.Hide();

            this.Resize(500, 500);
            GtkScrolledWindowStavke.HeightRequest = Gdk.Screen.Default.Height / 2;
            scrolledwindowArtikli.HeightRequest   = (Gdk.Screen.Default.Height / 2) - 17;

            labelBrojNarudzbe.LabelProp = narudzba.Broj;
            labelUkupno.LabelProp       = narudzba.Ukupno;
            buttonNajcesce.Click();

            spinbuttonKolicina.Changed  += (sender, e) => spinbuttonKolicina1.Value = spinbuttonKolicina.Value;
            spinbuttonKolicina1.Changed += (sender, e) => spinbuttonKolicina.Value = spinbuttonKolicina1.Value;

            Color c = new Color();

            Color.Parse("#00bd00", ref c);
            labelSpremljeno.ModifyFg(StateType.Normal, c);
            labelSpremljeno.ModifyFont(Pango.FontDescription.FromString("bold 16"));
            labelSpremljeno1.ModifyFg(StateType.Normal, c);
            labelSpremljeno1.ModifyFont(Pango.FontDescription.FromString("bold 16"));

            ForAll <Label>(l => l.ModifyFont(Pango.FontDescription.FromString("bold 10")), new Container[] { hbox2, hbox4, hbox5, hbox6, hbox7, hbox8, hbox9, hbox15 });
            spinbuttonKolicina1.ModifyFont(Pango.FontDescription.FromString("bold 10"));

            nodeviewStavke.Selection.SelectPath(new TreePath("0"));
            nodeviewStavke.GrabFocus();
        }