Пример #1
0
 public void Reset()
 {
     Continue         = Apps.Where(x => x.InOrder).ToList().Count > 0; // Should only be true if we have chains.
     _completedChains = 0;
     Apps.ForEach(x => x.Reset());
     Deadlines.ForEach(x => x.Reset());
     Jitters.ForEach(x => x.Reset());
     Schedules.ForEach(x => x.Reset());
 }
Пример #2
0
        public void EvalDeadline(Job task)
        {
            Deadline deadline = new Deadline(task);

            if (!eventMap.ContainsKey(task.Name))
            {
                eventMap.Add(task.Name, new List <IMeasurement>());
            }
            Deadlines.Add(deadline);
            eventMap[task.Name].Add(deadline);
        }
Пример #3
0
        public async Task <IActionResult> Edit(int id, [Bind("DeadlineId,SubjectId,DeadlineTypeId,DeadlineDate,DeadlineNotes")] Deadlines deadlines)
        {
            string returnURL = TempData["returnURL"].ToString();

            if (id != deadlines.DeadlineId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Database.ExecuteSqlRaw("EXEC Edit_Deadline @DeadlineID,@SubjectID, @DeadlineTypeID, @DeadlineDate, @DeadlineNotes",
                                                    new Microsoft.Data.SqlClient.SqlParameter("@DeadlineID", id),
                                                    new Microsoft.Data.SqlClient.SqlParameter("@SubjectID", Int32.Parse(deadlines.SubjectId.ToString())),
                                                    new Microsoft.Data.SqlClient.SqlParameter("@DeadlineTypeID", Int32.Parse(deadlines.DeadlineTypeId.ToString())),
                                                    new Microsoft.Data.SqlClient.SqlParameter("@DeadlineDate", DateTime.Parse(deadlines.DeadlineDate.ToString())),
                                                    new Microsoft.Data.SqlClient.SqlParameter("@DeadlineNotes", deadlines.DeadlineNotes.ToString()));
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DeadlinesExists(deadlines.DeadlineId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }

                if (returnURL == "Past")
                {
                    return(RedirectToAction("PastDeadlines", "Deadlines"));
                }

                else if (returnURL == "Future")
                {
                    return(RedirectToAction("FutureDeadlines", "Deadlines"));
                }
            }
            ViewData["DeadlineTypeId"] = new SelectList(_context.DeadlineTypes, "DeadlineTypeId", "DeadlineTypeName", deadlines.DeadlineTypeId);
            ViewData["SubjectId"]      = new SelectList(_context.Subjects, "SubjectId", "SubjectName", deadlines.SubjectId);
            return(View(deadlines));
        }