コード例 #1
0
 public RedirectToRouteResult SystemSessionPdf(String type)
 {
     CodeFile1 pdf = new CodeFile1();
     var userList = userRepository.GetUsers().Where(user => user.IsDeleted == false).ToList<User>();
     PollReportViewModel viewModel = new PollReportViewModel(userList);
     PdfPTable table = pdf.SystemUtilization(Server.MapPath("/Resources"), viewModel);
     IList<IElement> tab = new List<IElement>();
     tab.Add(table);
     pdf.CreatePDF2(tab, Server.MapPath("/Resources"), type);
     return RedirectToAction("SystemUtilizationPDF");
 }
コード例 #2
0
 public ActionResult SystemUtilizationTextual()
 {
     // Get user list
     var userList = userRepository.GetUsers().Where(user => user.IsDeleted==false).ToList<User>();
     var viewModel = new PollReportViewModel(userList);
     return View(viewModel);
 }
コード例 #3
0
        public ActionResult SystemHistoryTextual()
        {
            // Get the user
            var user = userRepository.GetUserByUsername(User.Identity.Name);
            //var allPolls = new List<Poll>();
            var allPolls = user.ManagedPolls;
            var unique = new List<Poll>();
            foreach (Poll poll in allPolls) { if (!unique.Contains(poll)) unique.Add(poll); }
            allPolls = unique;

            IDictionary<Poll, IList<User>> creatorList = new Dictionary<Poll, IList<User>>();
            IDictionary<Poll, int> attendanceList = new Dictionary<Poll, int>();
            foreach (var poll in allPolls)
            {
                // Get poll creators
                creatorList.Add(poll, userRepository.GetCreatorsOfPoll(poll));

                // Get poll attendance
                int attendance = 0;
                foreach (var participant in poll.participants)
                {
                    if (participant.attended)
                    {
                        attendance += 1;
                    }
                }
                attendanceList.Add(poll, attendance);
            }

            var viewModel = new PollReportViewModel(allPolls, creatorList, attendanceList);
            return View(viewModel);
        }
コード例 #4
0
        public ActionResult SystemUtilizationGraphical()
        {
            // Get user list
            var userList = userRepository.GetUsers();

            // Get roles
            var roleList = roleRepository.GetRoles();

            IDictionary<String, int> userRoles = new Dictionary<String, int>();

            foreach (Role role in roleList)
            {
                userRoles.Add(role.RoleName, 0);
                foreach (User user in userList)
                {
                    foreach (var userRole in user.Roles)
                    {
                        if (userRole.Equals(role))
                        {
                            userRoles[role.RoleName] += 1;
                        }
                    }
                }
            }

            var viewModel = new PollReportViewModel(userRoles);
            return View(viewModel);
        }
コード例 #5
0
        public ActionResult QuestionReportTextualPlain(int pollID, String urls,String name,bool? include, int? field, String items, String selectedEntities)
        {
            if (urls == null) return QuestionReportTextualPlain(pollID);

            var poll = pollRepository.GetPollByID(pollID);
            var tryomg = new CodeFile1();
            PollReportViewModel model = QuestionViewModel(pollID);
            model.include = include.GetValueOrDefault(false);
            if (!String.IsNullOrEmpty(selectedEntities))
            {
                int[] sEntities = commaStringToArray(selectedEntities);
                model.selectedEntities = entityRepository.GetEntityByEntityIDs(sEntities);
            }
            if (field!=null) model.field = participantRepository.GetParticipantFieldByID(field.Value);
            if (items != null) model.tick = items.Split('.');
            PdfPTable table = tryomg.GraphicalReport(Server.MapPath("/Resources"), poll, urls, model,null);
            IList<IElement> stuff = new List<IElement>();
            stuff.Add(table);
            tryomg.CreatePDF(stuff, Server.MapPath("/Resources"), name,poll.name);
            var m = new PollReportViewModel(pollID, poll.name);
            return View(new PollReportViewModel(pollID, poll.name));
        }
コード例 #6
0
 public RedirectToRouteResult SessionPdf(int pollID, String type)
 {
     var tryomg = new CodeFile1();
     var poll = pollRepository.GetPollByID(pollID);
     var viewModel = new PollReportViewModel(pollID, poll.name, poll.participants);
     PdfPTable table = tryomg.SessionParticipation(Server.MapPath("/Resources"),viewModel);
     IList<IElement> tab = new List<IElement>();
     tab.Add(table);
     tryomg.CreatePDF(tab, Server.MapPath("/Resources"), type, poll.name);
     return RedirectToAction("QuestionReportTextualPlain", new { pollID = pollID });
 }
コード例 #7
0
 public ActionResult SessionParticipationTextual(int pollID)
 {
     var poll = pollRepository.GetPollByID(pollID);
     IList<Participant> participants = poll.participants;
     var viewModel = new PollReportViewModel(pollID, poll.name, participants);
     return View(viewModel);
 }
コード例 #8
0
        public ActionResult Reports(int pollID)
        {
            var poll = pollRepository.GetPollByID(pollID);
            if (poll.participants.Where(m => m.isTestParticipant).Count() > 0)
            {
                RemoveTestParticipants(pollID);
            }
            IList<Question> questions = poll.questions;
            IDictionary<String, int> responses = new Dictionary<String, int>();

            var viewModel = new PollReportViewModel(pollID, poll.name);
            return View(viewModel);
        }