Пример #1
0
        public ActionResult EditExpertInfo(GroupEditExpertInfoViewModel model)
        {
            if (!Request.IsAuthenticated)
                throw new AuthenticationException();

            var group = GroupService.GetGroupByLabelOrId(model.GroupUrl);

            if (!string.IsNullOrEmpty(model.ReturnUrl))
                return Redirect(model.ReturnUrl);

            DelegationService.EditExpertInfo(UserContext.Current.Id, model.GroupUrl, model.Info);

            return RedirectToAction("index", new { id = model.GroupUrl });
        }
Пример #2
0
        public ActionResult EditExpertInfo(string id)
        {
            if (!Request.IsAuthenticated)
                throw new AuthenticationException();

            var group = GroupService.GetGroupByLabelOrId(id);

            var redirect = HideInvisibleGroup(group);
            if (redirect != null)
                return redirect;

            if (group.Tags.Count == 0)
                throw new BusinessLogicException("В группе не обозначены темы (тэги)");

            GroupService.UserInGroup(UserContext.Current.Id, group.Id, true);

            var model = new GroupEditExpertInfoViewModel(group, UserContext.Current.Id);

            if (Request.UrlReferrer != null)
                model.ReturnUrl = Request.UrlReferrer.ToString();

            return View(model);
        }