示例#1
0
        //Предоставление информации о ВКР
        public ActionResult showVKRInfo(int id)
        {
            VKR              vkr     = vkrDAO.getVKRbyId(id);
            List <Answer>    answers = aDAO.getAnswersByVKR(id);
            ViewAnswerAndVKR vAVKR   = new ViewAnswerAndVKR(answers, vkr);

            return(View(vAVKR));
        }
示例#2
0
        //Стартовая страница
        public ActionResult Index()
        {
            if (User.IsInRole("Student"))
            {
                int id = sDAO.getStudentId(User.Identity.Name);
                Console.WriteLine(id);
                VKR vkr = vDAO.getVKRbyStudent(id);
                ViewAnswerAndVKR vav     = new ViewAnswerAndVKR(vkr, id);
                List <Answer>    answers = aDAO.getAnswersByVKR(vkr.id);
                vav.answers = answers;
                return(View(vav));
            }
            else if (User.IsInRole("Teacher"))
            {
                int id = tDAO.getTeacherId(User.Identity.Name);
                ViewAnswerAndVKR vav = new ViewAnswerAndVKR(aDAO.getLastAnswers(id), id);
                return(View(vav));
            }
            else

            if (User.IsInRole("Decan"))
            {
                List <Plan>      plans    = pDAO.showPlansByStatus(6);
                ViewAnswerAndVKR vav      = new ViewAnswerAndVKR(plans);
                List <Kafedra>   kafedras = kDAO.getAllKafedras();
                vav.kafedras = kafedras;
                return(View(vav));
            }
            else
            {
                if (User.IsInRole("Leiter"))
                {
                    List <Kafedra>   kafedras = kDAO.getAllKafedras();
                    ViewAnswerAndVKR vav      = new ViewAnswerAndVKR(kafedras);
                    aDAO.checkAllAnswers();
                    return(View(vav));
                }
                else
                {
                    return(View());
                }
            }
        }