private void CreateProductButtons() { this.PrepareUIForCreateButtons(); List <ProductEntry> productEntries = InterplayStorage.GetProductEntries(); this.CreateProductButtons(productEntries); }
private void Article_Mouse_Down(object sender, MouseEventArgs e) { try { InterplayStorage.SetSelectedSimpleArticle(((InterplayPOSArticleButton)sender).simpleArticle); mouseUp = false; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); while (e.Button == MouseButtons.Left && e.Clicks == 1 && (mouseUp == false && stopWatch.ElapsedMilliseconds < holdButtonDuration)) { Application.DoEvents(); } if (stopWatch.ElapsedMilliseconds < holdButtonDuration) { Cart.CartInstance.UpdateItems(new Items { articleId = InterplayStorage.SelectedSimpleArticle.referenceArticleId, quantity = 1 }); } else { Quantity quantityForm = new Quantity(); quantityForm.ShowDialog(); } } catch (Exception ex) { this.HandleException(ex); } }
private void txtSearch_TextChanged(object sender, EventArgs e) { try { this.PrepareUIForCreateButtons(); this.CreateProductButtons(InterplayStorage.GetProductEntries(txtSearch.Text)); } catch (Exception ex) { this.HandleException(ex); } }
private void Product_Button_Click(object sender, EventArgs e) { try { InterplayStorage.SetSelectedProductEntry(((InterPlayPOSProductEntryButton)sender).productEntry); this.FormatSelectedItem((Button)sender); this.CreateArticlebuttons(); } catch (Exception ex) { this.HandleException(ex); } }
private void Catalogue_Button_Click(object sender, EventArgs e) { try { InterplayStorage.SetSelectedCatalog(((InterPlayPOSCatalogueButton)sender).Text); this.FormatSelectedItem((Button)sender); this.CreateProductButtons(); } catch (Exception ex) { this.HandleException(ex); } }
private void CreateArticlebuttons() { flowLayoutPanelArticle.Controls.Clear(); foreach (SimpleArticle article in InterplayStorage.GetSimpleArticles()) { InterplayPOSArticleButton button = new InterplayPOSArticleButton(); button.Text = article.name; button.simpleArticle = article; button.MouseDown += Article_Mouse_Down; button.MouseUp += Article_Mouse_Up; flowLayoutPanelArticle.Controls.Add(button); } }
private void SetDefaultCatalogue(Catalogue catalog) { InterplayStorage.SetSelectedCatalog(catalog.name); this.CreateProductButtons(); }