private void getMessages() { try { while (!shutDownThread) { if (this.MainWindow != null) { this.MainWindow.Dispatcher.Invoke(() => { this.importantMessages.Clear(); foreach (Autoteile a in TeileManager.GetKritischeTeile(WERKSTATT, MINBESTAND)) { Message m = new Message() { Short = "Lagerbestand von " + a.Bezeichnung + " kritisch!\nBestand: " + TeileManager.GetBestand(WERKSTATT, a.Bezeichnung), teil = a.Bezeichnung }; this.importantMessages.Add(m); this.TeilNotOk(a); this.timer.Start(); } }); } Thread.Sleep(TimeSpan.FromMinutes(threadSlepp)); } } catch (Exception ex) { ExceptionHelper.Handle(ex); } }
private string getBestandForTeil(Autoteile selected) { try { return(TeileManager.GetBestand(WERKSTATT, selected.Bezeichnung).ToString()); } catch (Exception) { throw; } }
/// <summary> /// fills the combobox /// </summary> private void FillComboBox() { try { this.cmbWerkstatt.ItemsSource = TeileManager.AllWerkstattNames(); cmbWerkstatt.SelectedItem = 1; } catch (Exception ex) { ExceptionHelper.Handle(ex); } }
static void Main(string[] args) { try { CongifManager.Initialize(); //List<Zentrallager> lager = SdoManager.GetZentrallager(); //CongifManager.UpdateSettings(new DatabaseSettings() { IpAddress = IpAddress.Extern }); //IEnumerable<Autoteile> ret = TeileManager.GetAutoteileWerkstatt("Villach"); //foreach ( var item in ret ) //{ // Console.WriteLine(item.Bezeichnung); //} //Console.WriteLine(TeileManager.GetBestand("Villach", "Blinker")); //HashSet<Column> columns = new HashSet<Column>(); //columns.Add(new Column() { Name = "Standort" , Type = NHibernateUtil.String }); //columns.Add(new Column() { Name = "Name" , Type = NHibernateUtil.String }); //columns.Add(new Column() { Name = "t.X" , Alias = "lon" , Type = NHibernateUtil.String }); //using ( IRepository rep = RepositoryFactory.Instance.CreateRepository<RepositoryForSpecialDataTypes>() ) //{ // Console.WriteLine("OK"); // IList lst = ( rep as RepositoryForSpecialDataTypes ).GetQuery("zentrallager, table(sdo_util.getvertices(koordinatenz)) t" , // "not koordinatenz is null" , columns); // foreach ( object[] item in lst ) // { // foreach ( var itm in item ) // { // Console.Write("ITEM: "); // Console.WriteLine(itm); // } // } //} //foreach ( var item in lager ) //{ // Console.WriteLine(item.Coordinates?.X); //} Console.WriteLine("Start"); TeileManager.Order("Tür", "Villach", "9500 Villach", 5); Console.WriteLine("Finished"); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); } }
private void fillView() { try { allTeile.Clear(); foreach (Autoteile a in TeileManager.GetAutoteile()) { this.allTeile.Add(a); } this.propertyChanged("allTeile"); } catch (Exception ex) { ExceptionHelper.Handle(ex); } }
private void create() { try { if (!string.IsNullOrEmpty(this.Preis) && !string.IsNullOrEmpty(this.Bezeichnung)) { double preis = double.Parse(this.Preis); MessageBox.Show("successfully created " + preis); TeileManager.CreateAutoteil(this.Bezeichnung, preis); this.close(); } } catch (Exception e) { ExceptionHelper.Handle(e); } }
private void order() { //menge und bezeichnung abfragen und mit controller orderen try { if (string.IsNullOrEmpty(this.Menge)) { throw (new Exception("no amount to order!\n " + this.PartToOrder + " " + this.Menge)); } TeileManager.Order(this.PartToOrder, this.Werkstatt, null, int.Parse(this.Menge)); MessageBox.Show("Successfully orderd " + this.Menge + " of " + this.PartToOrder + "!"); } catch (Exception ex) { ExceptionHelper.Handle(ex); } }