Ejemplo n.º 1
0
        public void Call()
        {
            var rents = _rentRepository.GetAll();

            PrintHelpers.PrintRents(rents);
            Console.WriteLine("Type rent id or exit");
            var isRead = ReadHelpers.TryReadNumber(out var rentId);

            if (!isRead)
            {
                return;
            }

            var result = _rentRepository.Delete(rentId);

            if (result == ResponseResultType.NotFound)
            {
                Console.WriteLine("Rent not found");
            }

            if (result == ResponseResultType.Success)
            {
                Console.WriteLine("Rent successfully deleted");
            }

            Console.ReadLine();
            Console.Clear();
        }
Ejemplo n.º 2
0
        public void Call()
        {
            var rents = _rentRepository.GetAll();

            PrintHelpers.PrintRents(rents);
            Console.WriteLine("Enter id for rent");
            var isRead = ReadHelpers.TryReadNumber(out var rentId);

            if (!isRead)
            {
                return;
            }

            var rentCost = _rentRepository.GetRentCost(rentId);

            Console.WriteLine($"Id: {rentCost.Id} \n " +
                              $"Start of rent: {rentCost.StartOfRent} \n " +
                              $"End of rent: {rentCost.EndOfRent} \n " +
                              $"Cost: {rentCost.Cost}kn \n " +
                              $"Vehicle: {rentCost.Vehicle} \n" +
                              $"{rentCost.Rate}");

            Console.ReadLine();
            Console.Clear();
        }
        public ActionResult MyRents()
        {
            int customerId = customerManager.GetAll().FirstOrDefault(x => x.email == User.Identity.Name).customerId;

            ViewBag.firstName = customerManager.GetAll().FirstOrDefault(x => x.email == User.Identity.Name).firstName;
            ViewBag.lastName  = customerManager.GetAll().FirstOrDefault(x => x.email == User.Identity.Name).lastName;
            ViewBag.phone     = customerManager.GetAll().FirstOrDefault(x => x.email == User.Identity.Name).phone;
            ViewBag.loginTime = customerManager.GetAll().FirstOrDefault(x => x.email == User.Identity.Name).loginTime;
            @ViewBag.email    = customerManager.GetAll().FirstOrDefault(x => x.email == User.Identity.Name).email;
            var model = rentManager.GetAll().Where(x => x.custId == customerId).ToList();

            return(View(model));
        }
 public ActionResult rentCars()
 {
     return(View(rentManager.GetAll()));
 }
Ejemplo n.º 5
0
 // GET: Home
 public ActionResult Index()
 {
     return(View(rentRepo.GetAll()));
 }