Пример #1
0
        public IActionResult FindClient(string ownersurname)
        {
            var findedClietns = _context.Clients
                                .Where(n => n.Surname == ownersurname)
                                .ToList();

            var findedClientsByName = _context.Clients
                                      .Where(n => n.Name == ownersurname)
                                      .ToList();


            var findedClientsToDisplay = new BikeServiceViewModel()
            {
                ClientList = findedClietns
            };

            var findedClientsToDisplayByName = new BikeServiceViewModel()
            {
                ClientList = findedClientsByName
            };

            if (findedClietns.Count != 0)
            {
                return(View(findedClientsToDisplay));
            }
            else
            {
                return(View(findedClientsToDisplayByName));
            }
        }
Пример #2
0
      public IActionResult ServiceActionList()
      {
          var serviceActions = _context.ServiceActions
                               .ToList();
          var serviceAsctionToDisplay = new BikeServiceViewModel()
          {
              ServiceActionList = serviceActions
          };

          return(View(serviceAsctionToDisplay));
      }
        public IActionResult Index()
        {
            var clients = _context.Clients.ToList();

            var clientsToDisplay = new BikeServiceViewModel()
            {
                ClientList = clients
            };

            return(View(clientsToDisplay));
        }
Пример #4
0
        public IActionResult BikeServiceHistory(int id)
        {
            var bikeServiceHistory = _context.ServiceHistories
                                     .Where(n => n.ServiceOrderHistory.ServiceOrderId == id)
                                     .ToList();
            var bikeServiceHistoryToDisplay = new BikeServiceViewModel()
            {
                ServiceHistoryList = bikeServiceHistory
            };

            return(View(bikeServiceHistoryToDisplay));
        }
Пример #5
0
        public IActionResult Index()
        {
            var historyOrders = _context.ServiceHistories
                                .Include(n => n.ServiceOrderHistory.BikeToService)

                                .ToList();
            var historyOrdersToDisplay = new BikeServiceViewModel
            {
                ServiceHistoryList = historyOrders
            };

            return(View(historyOrdersToDisplay));
        }
Пример #6
0
        public IActionResult Index()
        {
            var bikes = _context.Bikes
                        .Include(n => n.Owner)
                        .ToList();

            var bikesToDislplay = new BikeServiceViewModel()
            {
                BikeList = bikes
            };

            return(View(bikesToDislplay));
        }
Пример #7
0
        public IActionResult Index()
        {
            var orders = _context.ServiceOrders
                         .Include(n => n.BikeToService)
                         .Include(n => n.BikeToServiceOwner)
                         .ToList();

            var ordersToDisplay = new BikeServiceViewModel()
            {
                ServiceOrderList = orders
            };

            return(View(ordersToDisplay));
        }
Пример #8
0
        public IActionResult FindBike(string ownersurname)
        {
            var BikesToDisplaybyOwner = _context.Bikes
                                        .Include(n => n.Owner)
                                        .Where(n => n.Owner.Surname == ownersurname)
                                        .ToList();

            var bikesToDislplay = new BikeServiceViewModel()
            {
                BikeList = BikesToDisplaybyOwner
            };

            return(View(bikesToDislplay));
        }