public ActionResult DeleteConfirmed(int id) { ChallengeDay challengeDay = db.ChallengeDays.Find(id); db.ChallengeDays.Remove(challengeDay); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Day,ChallengeID,RepeatCircuit,Title")] ChallengeDay challengeDay) { if (ModelState.IsValid) { db.Entry(challengeDay).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ChallengeID = new SelectList(db.Challenges, "ID", "ChallengeTitle", challengeDay.ChallengeID); return(View(challengeDay)); }
// GET: ChallengeDays/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChallengeDay challengeDay = db.ChallengeDays.Find(id); if (challengeDay == null) { return(HttpNotFound()); } return(View(challengeDay)); }
// GET: ChallengeDays/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChallengeDay challengeDay = db.ChallengeDays.Find(id); if (challengeDay == null) { return(HttpNotFound()); } ViewBag.ChallengeID = new SelectList(db.Challenges, "ID", "ChallengeTitle", challengeDay.ChallengeID); return(View(challengeDay)); }
public void Day8Test() { Dictionary <string, string> keyValuePairs = new Dictionary <string, string>(); var data = File.ReadAllLines("1.txt"); var totalTest = data[0]; var list = data.ToList().Skip(1).Take(int.Parse(totalTest)).ToList(); try { list.ForEach(a => { string[] pair = a.Split(' '); keyValuePairs.Add(pair[0], pair[1]); }); } catch (Exception e) { } var f = keyValuePairs; ChallengeDay.Day8(f); }
//[InlineData(9)] public void Day9Test(int input, int expected) { Assert.Equal(expected, ChallengeDay.Day9(input)); }