Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ChallengeDay challengeDay = db.ChallengeDays.Find(id);

            db.ChallengeDays.Remove(challengeDay);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        // 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));
        }
Esempio n. 4
0
        // 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));
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 //[InlineData(9)]
 public void Day9Test(int input, int expected)
 {
     Assert.Equal(expected, ChallengeDay.Day9(input));
 }