public Result?FillFromSource(INumbers randomNumbers, List <int> orderedList) { table.Clear(); for (int i = 0; i != orderedList.Count; i++) { Add(new Number(randomNumbers.FindById(orderedList[i]))); } throw new NotImplementedException(); }
/// <inheritdoc /> public void Clear() { lock (BaseTable) { BaseTable.Clear(); } }
public static void DeleteAll <T, K>(string TableName) where T : STSdbEntityBase <K> { ITable <K, T> table = DB.OpenXTable <K, T>(TableName); table.Clear(); DB.Commit(); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(t => t.TableNumber == tableNumber); decimal bill = table.GetBill() + table.Price; totalIncome += bill; table.Clear(); return($"Table: { tableNumber}\r\n" + $"Bill: {bill:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(t => t.TableNumber == tableNumber); decimal bill = table.GetBill(); table.Clear(); totalIncome += bill; return($"Table: {tableNumber}" + Environment.NewLine + $"Bill: {bill:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = resturantObjects["table"].FirstOrDefault(t => (t as ITable).TableNumber == tableNumber) as ITable; int people = table.NumberOfPeople; decimal totalSum = table.GetBill(); totalSumResturant += table.GetBill(); table.Clear(); return($"Table: {tableNumber}\nBill: {totalSum:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = GetTableByNumer(tableNumber); decimal bill = table.GetBill(); this.totalIncome += bill; table.Clear(); return(string.Format(Messages.LeaveTable, table.TableNumber, bill)); }
public string LeaveTable(int tableNumber) { ITable currentTable = this.tables.FirstOrDefault(x => x.TableNumber == tableNumber); decimal bill = currentTable.GetBill(); currentTable.Clear(); this.income += bill; return($"Table: {tableNumber}" + $"{Environment.NewLine}" + $"Bill: {bill:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = this.tables.FirstOrDefault(x => x.TableNumber == tableNumber); decimal bill = table.GetBill(); this.income += bill; table.Clear(); return($"Table: {tableNumber}\nBill: {bill:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(x => x.TableNumber == tableNumber); StringBuilder result = new StringBuilder(); result.AppendLine($"Table: {tableNumber}"); result.AppendLine($"Bill: {table.GetBill():f2}"); totalIncome += table.GetBill(); table.Clear(); return(result.ToString().Trim()); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(t => t.TableNumber == tableNumber); string result = $"Table: {tableNumber}{Environment.NewLine}Bill: {table.GetBill():f2}"; totalIncome += table.GetBill(); table.Clear(); return(result); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(x => x.TableNumber == tableNumber); var bill = table.GetBill() + table.Price; totalIncome += bill; table.Clear(); return($"Table: {tableNumber}" + Environment.NewLine + $"Bill: {bill:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = this.tables.Find(t => t.TableNumber == tableNumber); decimal bill = table.GetBill(); this.income += bill; table.Clear(); return($"Table: {tableNumber}{Environment.NewLine}Bill: {bill:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(x => x.TableNumber == tableNumber); decimal tableBill = table.GetBill(); StringBuilder sb = new StringBuilder(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {tableBill:f2}"); totalBill += tableBill; table.Clear(); return(sb.ToString().TrimEnd()); }
public string LeaveTable(int tableNumber) { StringBuilder sb = new StringBuilder(); ITable table = this.tables.FirstOrDefault(t => t.TableNumber == tableNumber); this.totalIncome += table.GetBill(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {table.GetBill():f2}"); table.Clear(); string bill = sb.ToString().TrimEnd(); return(bill); }
public string LeaveTable(int tableNumber) { ITable table = this.tables.FirstOrDefault(t => t.TableNumber == tableNumber); StringBuilder sb = new StringBuilder(); sb.AppendLine(string.Format(OutputMessages.TableInformation, tableNumber)); sb.AppendLine(string.Format(OutputMessages.BillInformation, table.GetBill())); this.income += table.GetBill(); table.Clear(); return(sb.ToString().TrimEnd()); }
public string LeaveTable(int tableNumber) { ITable foundTable = this.tables .FirstOrDefault(t => t.TableNumber == tableNumber); decimal tableBill = foundTable.GetBill(); foundTable.Clear(); this.totalIncome += tableBill; return($"Table: {foundTable.TableNumber}" + Environment.NewLine + $"Bill: {tableBill:F2}"); }
public string LeaveTable(int tableNumber) { StringBuilder sb = new StringBuilder(); ITable table = tables.FirstOrDefault(x => x.TableNumber == tableNumber); decimal bill = table.GetBill(); this.Income += bill; table.Clear(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {bill:f2}"); return(sb.ToString()); }
public string LeaveTable(int tableNumber) { ITable table = this.tables.FirstOrDefault(x => x.TableNumber == tableNumber); StringBuilder sb = new StringBuilder(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {table.GetBill()}"); this.Income += table.GetBill(); table.Clear(); return(sb.ToString().TrimEnd()); }
public string LeaveTable(int tableNumber) { ITable table = tables.First(t => t.TableNumber == tableNumber); StringBuilder sb = new StringBuilder(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {table.GetBill():f2}"); totalIncome += table.GetBill(); table.Clear(); return(sb.ToString().Trim()); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(x => x.TableNumber == tableNumber); if (table == null) { return(null); } decimal total = table.GetBill(); totalIncome += total; table.Clear(); return($"Table: {tableNumber}{Environment.NewLine}Bill: {total:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = this.Tables.FirstOrDefault(t => t.TableNumber == tableNumber); StringBuilder sb = new StringBuilder(); if (table != null) { decimal tableBill = table.GetBill(); this.totalIncome += tableBill; table.Clear(); sb.AppendLine($"Table: {tableNumber}") .AppendLine($"Bill: {tableBill:f2}"); } return(sb.ToString().TrimEnd()); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(x => x.TableNumber == tableNumber); if (table == null) { throw new ArgumentException(string.Format(OutputMessages.WrongTableNumber, tableNumber)); } decimal bill = table.GetBill(); totalIncome += bill; table.Clear(); return($"Table: {tableNumber}" + Environment.NewLine + $"Bill: {bill:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(t => t.TableNumber == tableNumber); decimal bill = table.GetBill(); totalIncome += bill; table.Clear(); StringBuilder sb = new StringBuilder(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {bill:f2}"); string result = sb.ToString().TrimEnd(); // tables.Remove(table); return(result); }
public string LeaveTable(int tableNumber) { ITable tableToLeave = this.tables.FirstOrDefault(t => t.TableNumber == tableNumber); if (tableToLeave == null) { return($"Could not find table with {tableNumber}"); } decimal bill = tableToLeave.GetBill(); this.totalIncome += bill; tableToLeave.Clear(); return($"Table: {tableToLeave.TableNumber}" + Environment.NewLine + $"Bill: {bill:f2}"); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(t => t.TableNumber == tableNumber); decimal bill = table.GetBill(); bill += table.Price; totalIncome += bill; table.Clear(); StringBuilder sb = new StringBuilder(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {bill:f2}"); return(sb.ToString().Trim()); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(t => t.TableNumber == tableNumber); var bill = table.GetBill() + table.Price; this.restaurantTotalIncome += bill; table.Clear(); //var sb = new StringBuilder(); //sb.AppendLine($"Table: {tableNumber}"); //sb.AppendLine($"Bill: {totalTableSum:f2}"); //return sb.ToString().TrimEnd(); return($"Table: {tableNumber}\r\n" + $"Bill: {bill:f2}"); }
// Finds the table with the same table number. Gets the bill for that table and clears it. Finally returns: // "Table: {tableNumber}" // "Bill: {table bill:f2}" public string LeaveTable(int tableNumber) { ITable table = this.tables.FirstOrDefault(x => x.TableNumber == tableNumber); // ERROR: NO TABLE WITH THIS NUMBER ??? if (table == null) { return(""); } decimal totalBill = table.GetBill() + table.Price; StringBuilder sb = new StringBuilder(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {totalBill:f2}"); this.totalIncomes += totalBill; table.Clear(); return(sb.ToString().Trim()); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(x => x.TableNumber == tableNumber); if (table is null) { return(string.Format(OutputMessages.WrongTableNumber, tableNumber)); } decimal bill = table.GetBill(); TotalIncome += bill; table.Clear(); StringBuilder result = new StringBuilder(); result.AppendLine($"Table: {tableNumber}"); result.AppendLine($"Bill: {bill:f2}"); return(result.ToString().TrimEnd()); }
public string LeaveTable(int tableNumber) { ITable table = tables.FirstOrDefault(t => t.TableNumber == tableNumber); if (table == null) { throw new ArgumentException(string.Format(OutputMessages.WrongTableNumber, tableNumber)); } var totalTableSum = table.GetBill(); this.TotalRestaurantIncome += totalTableSum; table.Clear(); var sb = new StringBuilder(); sb.AppendLine($"Table: {tableNumber}"); sb.AppendLine($"Bill: {totalTableSum:f2}"); return(sb.ToString().TrimEnd()); }