public NarudzbeNodeStore(bool loadFromDB) : base(typeof(NarudzbeNode)) { if (loadFromDB) { this.AddList(DBNarudzba.GetNarudzbe()); } }
public void DodajNarudzbu(string oznakaStola) { Narudzba n = new Narudzba("0", DateTime.Now, Narudzba.OznakaPotvrde.Nepotvrdeno, StoloviPresenter.stoloviList.Find(s => s.Oznaka == oznakaStola)); DBNarudzba.SaveNarudzba(ref n); this.Add(n); }
public void Zakljuci() { narudzba.Oznaka = Narudzba.OznakaPotvrde.Potvrdeno; DBNarudzba.UpdateNarudzba(narudzba); stavkeNarudzbeNodeStore.Clear(); MainWindow.stavkeChanged(); }
public void Update(int stol) { narudzba.StolNarudzbe = StoloviPresenter.stoloviList[stol]; OznakaStola = narudzba.StolNarudzbe.Oznaka; foreach (StavkaNarudzbeNode ns in stavkeNarudzbeNodeStore) { ns.OznakaStola = narudzba.StolNarudzbe.Oznaka; } DBNarudzba.UpdateNarudzba(narudzba); }
public void Refresh() { Clear(); AddList(DBNarudzba.GetNarudzbe()); }
public void IzbrisiNarudzbu(NarudzbeNode n) { this.RemoveNode(n); DBNarudzba.DeleteNarudzba(n.narudzba); MainWindow.stavkeChanged(); }