/* * Dodaje wiersz do tabeli na podstawie zamówienia * @param {Order} order - zamówienie * @return void */ public void AddNewRowToOrderHistory(Order order) { var label = new Label(); historyTableLayout.RowCount++; historyTableLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 50)); var orderInfo = order.Email.Trim() + ", " + order.Comment.Trim() + ", " + order.Date; label.Text = orderInfo; label.TextAlign = ContentAlignment.MiddleLeft; label.AutoSize = true; historyTableLayout.Controls.Add(label); var orderMeals = ""; foreach (var dwa in order.DishWithAdditionses) { orderMeals += dwa.Name.Trim() + "( "; foreach (var add in dwa.GetAdditions()) { orderMeals += add.Name.Trim() + "; "; } orderMeals += " ) "; } historyTableLayout.Controls.Add(new Label { Text = orderMeals, AutoSize = true }); historyTableLayout.Controls.Add(new Label { Text = order.GetPrice().ToString().Trim() + "zł" }); }
/* * Dodaje danie do listy z zamówieniem * @param {int} id - identyfikator dania z zamówienia * @return void */ public void AddDishToOrderList(int id) { AddNewRowToOrder(id); sendOrder.Enabled = true; sendOrder.Text = "Zamów:" + Order.GetPrice() + "zł"; }