public ActionResult Index(FormCollection form)
        {
            var collection = Request.Form;
             DateTime from = DateTime.MinValue;
             DateTime to = DateTime.MinValue;
             int studentId = 0;

             if (collection["from"] != null)
             {
                 DateTime.TryParse(collection["from"], out from);
             }

             if (collection["to"] != null)
             {
                 DateTime.TryParse(collection["to"], out to);
             }

             if (collection["studentId"] != null)
             {
                 int.TryParse(collection["studentId"], out studentId);

             }

             var viewModel = new ParticipationsViewModel(GetActivityList(),
                                                        GetStudentsList(),
                                                        GetSubjectsList());
             if (from > DateTime.MinValue && to > DateTime.MinValue)
             {
                 viewModel.FromDate = from;
                 viewModel.ToDate = to;
             }
             else
             {
                 viewModel.FromDate = DateTime.UtcNow.Date.AddDays(-7);
                 viewModel.ToDate = DateTime.UtcNow.Date;
             }

             viewModel.Participations = GetParticipations(viewModel.FromDate, viewModel.ToDate, studentId);

             return View(viewModel);
        }
        public ActionResult Indexorg([FromJson] IEnumerable<Participation> participations)
        {
            if (ModelState.IsValid)
            {
                SaveParticipations(participations);
            }
            var viewModel = new ParticipationsViewModel(GetActivityList(),
                                                        GetStudentsList(),
                                                        GetSubjectsList());
            viewModel.FromDate = DateTime.UtcNow.Date.AddDays(-7);
            viewModel.ToDate = DateTime.UtcNow.Date;
            viewModel.Participations = participations;

            return View(viewModel);
        }
        //
        // GET: /Participation/
        public ActionResult Index()
        {
            var viewModel = new ParticipationsViewModel(GetActivityList(),
                                                        GetStudentsList(),
                                                        GetSubjectsList());

            viewModel.FromDate = DateTime.UtcNow.Date.AddDays(-7);
            viewModel.ToDate = DateTime.UtcNow.Date;

            viewModel.Participations = GetParticipations(viewModel.FromDate, viewModel.ToDate, 0);

            return View(viewModel);
        }