private void OutputDataInTables(int month) { var tableExpenses = new ConsoleTable($"Количество месяцев", "Аренда", "Зарплата", "Закупка", "Итого"); var tableRevenueFromSales = new ConsoleTable("№", "Цена продажи", "Наценка", "Количество", "Итого с продаж"); tableExpenses.AddRow(month.ToString(), (calculater.AnalyticsOfShop.TotalRentalSpace * month).ToString(), (calculater.AnalyticsOfShop.TotalSalary * month).ToString(), (calculater.AnalyticsOfShop.TotalPurchasePriceOfGood * month).ToString(), (calculater.AnalyticsOfShop.TotalExpenses * month).ToString()); foreach (var good in calculater.GetGoods()) { tableRevenueFromSales.AddRow(1.ToString(), (good.SalePrice * month).ToString(), (good.Margin * month).ToString(), (good.Count * month).ToString(), (good.TotalRevenueFromSales * month).ToString()); } Console.WriteLine("Затраты"); tableExpenses.Print(); Console.WriteLine(); Console.WriteLine("Доход от продажи товара"); tableRevenueFromSales.Print(); Console.WriteLine($"Доход {calculater.AnalyticsOfShop.Revenue * month} Расход {calculater.AnalyticsOfShop.TotalExpenses * month}"); Console.WriteLine($"Прибыль за {month} {Endings.GetNewWord("месяц", month)} составила:{calculater.Delta.DeltaFromShop}"); calculater.Clear(); Console.ReadLine(); }
public void ToFillUser(int month, decimal budget) { account.User.Employees = userService.GetEmployees(); account.User.Goods = userService.GetGoods(); account.User.RentalSpaces = userService.GetRentalSpaces(); account.User.TotalRevenue = userService.AnalyticsOfShop.Revenue * month; account.User.TotalExpenses = userService.AnalyticsOfShop.TotalExpenses * month; account.User.Delta = userService.Delta.DeltaFromShop; account.User.Budget = budget; account.User.Month = month; account.CreateRecord(); }
private Dictionary <string, Action> CreateDictionaryGoods() { dictionaryGoods = new Dictionary <string, Action>(); foreach (var item in calculater.GetGoods()) { dictionaryGoods.Add($"Цена закупки: {item.PurchasePrice}, \n" + $"\tЦена продажи: {item.SalePrice}, \n" + $"\tМаржа: {item.Margin},\n" + $"\tКоличество: {item.Count}", ToBackGoods); } dictionaryGoods.Add("Назад.", ToBackGoods); return(dictionaryGoods); }