public async Task <IActionResult> Comment(UserCommentsDto commentsDto)
        {
            var comment = new UsersComment
            {
                CommentDate  = DateTime.Now,
                CommentText  = commentsDto.CommentText,
                Rating       = commentsDto.Rating,
                UserEmail    = commentsDto.UserEmail,
                UserFullName = commentsDto.UserFullName,
            };
            await _repo.AddtComment(comment);

            await _repo.SaveChanges();

            return(RedirectToAction("thanks", "Home"));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Index(TrackDto trackDto)
        {
            if (ModelState.IsValid)
            {
                var service = new RequestService
                {
                    CityFromId  = trackDto.fromCity,
                    CityToId    = trackDto.toCity,
                    RequestDate = DateTime.Now,
                };
                await _repo.AddOrder(service);

                await _repo.SaveChanges();

                return(Redirect("Home/index"));
            }
            else
            {
                var cities = await _repo.GetKsacities();

                trackDto.Ksacities = cities;
                return(View(trackDto));
            }
        }