Example #1
0
        public ActionResult Submit(SocialRequestModel request)
        {
            var userId   = _userProcessor.GetUserIdByName(User.Identity.Name);
            var streetId = _streetRepository.GetIdByName(request.Street);

            var domain = new SocialRequest
            {
                ProblemId = request.ProblemId,
                Flat      = request.Flat,
                House     = request.House,
                UserId    = userId,
                StreetId  = streetId
            };

            _socialRequestRepository.Add(domain);

            return(RedirectToAction("Index", "Statistics"));
        }
Example #2
0
        //
        // GET: /Request/

        public ActionResult Index()
        {
            var model = new SocialRequestModel();

            var newList = new List <SelectListItem>();
            var list    = _problemRepository.GetAll();

            foreach (var currentProblem in list)
            {
                newList.Add(new SelectListItem
                {
                    Value = Convert.ToString(currentProblem.Id),
                    Text  = currentProblem.Name
                });
            }

            model.ProblemList = newList;
            return(View("Index", model));
        }