Esempio n. 1
0
        private async Task <List <ActivityThreadViewModel>[]> CreateArrayOfActivityThreads(Step[] tripSteps)
        {
            List <ActivityThreadViewModel>[] activities = new List <ActivityThreadViewModel> [tripSteps.Length];
            var stepcontroller = new StepController();

            for (int i = 0; i < tripSteps.Length; i++)
            {
                activities[i] = await stepcontroller.CreateActivityThread(tripSteps[i]);
            }
            return(activities);
        }
Esempio n. 2
0
        // GET: Review/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Step step = await db.Steps.Include(s => s.Review).FirstOrDefaultAsync(s => s.StepId == id);

            if (step == null)
            {
                return(View("CustomisedError", new HandleErrorInfo(
                                new UnauthorizedAccessException("Oops, the step you are trying to review doesn't seem to exist. Please try navigating to the main page again."),
                                "Trip", "Index")));
            }
            ViewBag.Rating     = step.Review.Rating;
            ViewBag.StepId     = id.Value;
            ViewBag.From       = step.From;
            ViewBag.To         = step.To;
            ViewBag.PhotoCount = StepController.GetReviewPicturesCount(step);
            ViewBag.Create     = false;
            return(View(step.Review));
        }