public App(StockLoader stockLoader, StockRepository stockRepo, TransactionRepository transactionRepo, ILogger <App> logger) { _stockLoader = stockLoader; _stockRepo = stockRepo; _transactionRepo = transactionRepo; _logger = logger; }
public void Test_GetStockList() { var result = StockLoader.GetStockList(); Assert.NotNull(result); Assert.NotEmpty(result); Assert.Equal(14048, result.Length); }
public StockHistoryView() { InitializeComponent(); stockLoader = new StockLoader(); stockListUpdater = new StockListUpdater(); this.dgv = new DataGridView(); this.dlButton = new System.Windows.Forms.Button(); this.clearButton = new System.Windows.Forms.Button(); this.symbolLabel = new System.Windows.Forms.Label(); this.symbolTextBox = new System.Windows.Forms.TextBox(); this.nameLabel = new System.Windows.Forms.Label(); this.nameTextBox = new System.Windows.Forms.TextBox(); this.addRemoveStockButton = new System.Windows.Forms.Button(); this.progBar = new System.Windows.Forms.ProgressBar(); dgv.Location = new Point(24, 50); dgv.Size = new Size(1000, 200); dlButton.Location = new Point(24, 16); dlButton.Size = new System.Drawing.Size(120, 24); dlButton.Click += new System.EventHandler(dlButton_Click); dlButton.Text = "Download data"; clearButton.Location = new Point(150, 16); clearButton.Size = new System.Drawing.Size(120, 24); clearButton.Click += new System.EventHandler(clearButton_Click); clearButton.Text = "Clear"; symbolLabel.Location = new Point(300, 16); symbolLabel.Size = new System.Drawing.Size(50, 24); symbolLabel.Text = "Symbol"; symbolTextBox.Location = new Point(350, 16); symbolTextBox.Size = new System.Drawing.Size(120, 24); nameLabel.Location = new Point(500, 16); nameLabel.Size = new System.Drawing.Size(50, 24); nameLabel.Text = "Name"; nameTextBox.Location = new Point(550, 16); nameTextBox.Size = new System.Drawing.Size(120, 24); addRemoveStockButton.Location = new Point(700, 16); addRemoveStockButton.Size = new System.Drawing.Size(120, 24); addRemoveStockButton.Click += new System.EventHandler(addRemoveStockButton_Click); addRemoveStockButton.Text = "Add/Remove stock"; progBar.Location = new Point(850, 16); progBar.Visible = true; progBar.Minimum = 1; progBar.Value = 1; progBar.Step = 1; this.Controls.Add(dgv); this.Controls.Add(dlButton); this.Controls.Add(clearButton); this.Controls.Add(symbolLabel); this.Controls.Add(symbolTextBox); this.Controls.Add(nameLabel); this.Controls.Add(nameTextBox); this.Controls.Add(addRemoveStockButton); this.Controls.Add(progBar); }
static void Main(string[] args) { Options m_Options = new Options(); //DbController m_DbController = new DbController(); MainController m_MainController = new MainController(m_Options); m_MainController.LoadDonnes(); m_MainController.LoadStocks(); m_MainController.ResolveDonnes(); m_MainController.LoadExterne(); m_MainController.ResolveExterne(); return; DirectoryInfo d = new DirectoryInfo(Properties.Settings.Default.DataPath); FileInfo[] Files = d.GetFiles(m_Options.DepotopUkFile); string str = ""; foreach (FileInfo file in Files) { str = str + ", " + file.Name; } Console.WriteLine(str); Console.ReadKey(); return; var donnes = new CsvFile(m_Options.DonnesFile); donnes.Load(); StockLoader m_StockLoader = new StockLoader(); m_StockLoader.LoadFiles(); var delimiter = m_Options.GetDelimiter(Options.OptionsNames.DepotopUk); var depotopFr = m_Options.GetOptionsNames(Options.OptionsNames.DepotopDe); var inputs = m_Options.GetOptionsValues(Options.OptionsNames.Input); var optionsData = m_Options.GetOptionsData(Options.OptionsNames.DepotopDe); for (var i = 0; i < inputs.Count; i++) { var key = inputs[i]; Console.WriteLine(inputs[i] + " - " + optionsData[inputs[i]]); } Console.WriteLine(depotopFr); Console.ReadKey(); }
public CashRegisterView() { InitializeComponent(); this.totalLabel = new Label(); this.totalBox = new TextBox(); this.orderDetails = new DataGridView(); this.itemColumn = new DataGridViewColumn(); this.priceColumn = new DataGridViewColumn(); this.launchSyncButton = new Button(); this.frenchBaguetteButton = new Button(); this.softBreadButton = new Button(); this.appleSmoothyButton = new Button(); this.cokeButton = new Button(); this.hamSandwichButton = new Button(); this.paniniButton = new Button(); this.cookieButton = new Button(); this.cheeseCakeButton = new Button(); this.breakfastButton = new Button(); this.lunchButton = new Button(); this.afternoonTeaButton = new Button(); this.loadStocksButton = new Button(); this.newStocksButton = new Button(); this.validateButton = new Button(); this.stockloader = new StockLoader(); totalLabel.Location = new Point(24, 20); totalLabel.Size = new Size(80, 50); totalLabel.Text = "Total Price"; totalBox.Location = new Point(120, 20); totalBox.Size = new Size(80, 50); totalBox.ReadOnly = true; itemColumn.HeaderText = "item"; itemColumn.Name = "item"; itemColumn.CellTemplate = new DataGridViewTextBoxCell(); priceColumn.HeaderText = "price"; priceColumn.Name = "price"; priceColumn.CellTemplate = new DataGridViewTextBoxCell(); orderDetails.Location = new Point(300, 24); orderDetails.Size = new Size(240, 300); orderDetails.Columns.Add(itemColumn); orderDetails.Columns.Add(priceColumn); orderDetails.Click += new System.EventHandler(orderDetails_Click); launchSyncButton.Location = new Point(70, 70); launchSyncButton.Size = new Size(120, 24); launchSyncButton.Text = "Launch SyncF"; launchSyncButton.Click += new System.EventHandler(launchSync_Click); frenchBaguetteButton.Location = new Point(24, 100); frenchBaguetteButton.Size = new Size(120, 24); frenchBaguetteButton.Name = "French Baguette"; frenchBaguetteButton.Click += new System.EventHandler(food_Click); softBreadButton.Location = new Point(24, 130); softBreadButton.Size = new Size(120, 24); softBreadButton.Name = "Soft Bread"; softBreadButton.Click += new System.EventHandler(food_Click); appleSmoothyButton.Location = new Point(24, 160); appleSmoothyButton.Size = new Size(120, 24); appleSmoothyButton.Name = "Apple Smoothy"; appleSmoothyButton.Click += new System.EventHandler(food_Click); cokeButton.Location = new Point(24, 190); cokeButton.Size = new Size(120, 24); cokeButton.Name = "Coke"; cokeButton.Click += new System.EventHandler(food_Click); hamSandwichButton.Location = new Point(24, 220); hamSandwichButton.Size = new Size(120, 24); hamSandwichButton.Name = "Ham Sandwich"; hamSandwichButton.Click += new System.EventHandler(food_Click); paniniButton.Location = new Point(24, 250); paniniButton.Size = new Size(120, 24); paniniButton.Name = "Panini"; paniniButton.Click += new System.EventHandler(food_Click); cookieButton.Location = new Point(24, 280); cookieButton.Size = new Size(120, 24); cookieButton.Name = "Cookie"; cookieButton.Click += new System.EventHandler(food_Click); cheeseCakeButton.Location = new Point(24, 310); cheeseCakeButton.Size = new Size(120, 24); cheeseCakeButton.Name = "Cheese Cake"; cheeseCakeButton.Click += new System.EventHandler(food_Click); breakfastButton.Location = new Point(150, 100); breakfastButton.Size = new Size(120, 50); breakfastButton.Name = "Breakfast"; breakfastButton.Click += new System.EventHandler(menu_Click); lunchButton.Location = new Point(150, 190); lunchButton.Size = new Size(120, 50); lunchButton.Name = "Lunch"; lunchButton.Click += new System.EventHandler(menu_Click); afternoonTeaButton.Location = new Point(150, 280); afternoonTeaButton.Size = new Size(120, 50); afternoonTeaButton.Name = "Afternoon Tea"; afternoonTeaButton.Click += new System.EventHandler(menu_Click); loadStocksButton.Location = new Point(50, 340); loadStocksButton.Size = new Size(100, 30); loadStocksButton.Name = "Load Stocks"; loadStocksButton.Text = "Load Stocks"; loadStocksButton.Click += new System.EventHandler(loadStock_Click); newStocksButton.Location = new Point(200, 340); newStocksButton.Size = new Size(100, 30); newStocksButton.Name = "New Stocks"; newStocksButton.Text = "New Stocks"; newStocksButton.Click += new System.EventHandler(newStock_Click); validateButton.Location = new Point(380, 340); validateButton.Size = new Size(100, 30); validateButton.Name = "Validate"; validateButton.Text = "Validate"; validateButton.Click += new System.EventHandler(validate_Click); this.stock = new Stock(); loadButtonsText(); this.Controls.Add(totalLabel); this.Controls.Add(totalBox); this.Controls.Add(launchSyncButton); this.Controls.Add(frenchBaguetteButton); this.Controls.Add(softBreadButton); this.Controls.Add(appleSmoothyButton); this.Controls.Add(cokeButton); this.Controls.Add(hamSandwichButton); this.Controls.Add(paniniButton); this.Controls.Add(cookieButton); this.Controls.Add(cheeseCakeButton); this.Controls.Add(breakfastButton); this.Controls.Add(lunchButton); this.Controls.Add(afternoonTeaButton); this.Controls.Add(orderDetails); this.Controls.Add(loadStocksButton); this.Controls.Add(newStocksButton); this.Controls.Add(validateButton); }