Example #1
0
        public ActionResult Roll(Guid id)
        {
            RollManagement rollManagement = new RollManagement();
            var            roll           = rollManagement.get(id);

            if (roll == null)
            {
                return(new HttpNotFoundResult());
            }
            return(View(roll));
        }
Example #2
0
        public ActionResult New(int low, int high)
        {
            Guid id   = Guid.NewGuid();
            Roll roll = new Roll();

            roll.Id = id;
            roll.RollRangeBoundaryBottom = low;
            roll.RollRangeBoundaryTop    = high;
            RollManagement rollManagement = new RollManagement();

            rollManagement.add(roll);
            return(Redirect("~/Home/Roll/" + id.ToString()));
        }
Example #3
0
        public ActionResult RollMore(Guid id)
        {
            RollManagement rollManagement = new RollManagement();
            var            roll           = rollManagement.get(id);

            if (roll == null)
            {
                return(new HttpNotFoundResult());
            }
            int newResult = new Random().Next(roll.RollRangeBoundaryBottom, roll.RollRangeBoundaryTop + 1);

            roll.Result.Add(newResult);
            return(Redirect("~/Home/Roll/" + id.ToString()));
        }