public List <CarViewModel> GetOrderCars(OrderViewModel order) { var cars = new List <CarViewModel>(); foreach (var car in order.OrderCars) { cars.Add(carLogic.Read(new CarBindingModel { Id = car.CarId }).FirstOrDefault()); } return(cars); }
public IActionResult Order(ReportModel model) { var carList = new List <CarViewModel>(); var orders = _orderLogic.Read(new OrderBindingModel { ClientId = Program.Client.Id, DateFrom = model.From, DateTo = model.To }); var cars = _carLogic.Read(null); foreach (var order in orders) { foreach (var car in cars) { carList.Add(car); } } ViewBag.Cars = carList; ViewBag.Orders = orders; string fileName = "pdfreport.pdf"; if (model.SendMail) { _reportLogic.SaveCarsSparesToPdfFile(fileName, Program.Client.Id, Program.Client.Mail); } return(View()); }
private void FormStatistic_Load(object sender, EventArgs e) { var list = logic.Read(null); foreach (var car in list) { int countDetail = 0; var details = car.CarSpares.Values; foreach (var detail in details) { countDetail += detail.Item3; } this.chart1.Series["Цена деталей"].Points.AddXY(car.CarName, countDetail); } }
private void LoadData() { try { var list = logic.Read(null); if (list != null) { dataGridView.DataSource = list; dataGridView.Columns[0].Visible = false; dataGridView.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridView.Columns[2].Visible = false; dataGridView.Columns[5].Visible = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public IActionResult Car() { ViewBag.Cars = _car.Read(null); return(View()); }