Example #1
0
        public IActionResult CreateMessage(int id, string text)
        {
            var     c       = int.Parse(User.Identity.Name);
            User    user    = allUsers.FindUserById(c);
            Section section = allSections.FindSectionById(id);

            allMessages.CreateMessage(user, section, text);
            return(Redirect($"~/Section/Section/{section.Id}"));
        }
Example #2
0
        public IActionResult Section(int id)
        {
            var s = allSections.FindSectionById(id);
            SelectedSectionViewModel model = new SelectedSectionViewModel()
            {
                Section = s
            };

            if (s == null)
            {
                QSection qs = allSections.FindQSectionById(id);
                model.Section   = qs;
                model.Variants  = qs.Variants;
                model.UniqUsers = qs.UniqUsers;
            }
            return(View(model));
        }