コード例 #1
0
        public ActionResult Index(int id)
        {
            Login            login         = Login.Find(id);
            List <Breakfast> allBreakfasts = Breakfast.GetAllBreakfast();

            ViewBag.Breakfast = allBreakfasts;
            return(View("Index", login));
        }
コード例 #2
0
        public ActionResult DeleteBreakfast(int id, int breakfastId)
        {
            Breakfast breakfast = Breakfast.Find(breakfastId);

            breakfast.Delete();
            Login            login         = Login.Find(id);
            List <Breakfast> allBreakfasts = Breakfast.GetAllBreakfast();

            ViewBag.Breakfast = allBreakfasts;
            return(View("Index", login));
        }
コード例 #3
0
        public ActionResult Create(string food, string sugarLevel, DateTime stampTime, string carb, int loginId)
        {
            Login     foundLogin   = Login.Find(loginId);
            Breakfast newBreakfast = new Breakfast(food, stampTime, float.Parse(sugarLevel), float.Parse(carb), loginId);

            newBreakfast.Save();
            List <Breakfast> newList = Breakfast.GetAllBreakfast();

            ViewBag.Breakfast = newList;
            return(View("Index", foundLogin));
        }