Exemplo n.º 1
0
        public async Task <IActionResult> AddWeek(Week data)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    await _repository.AddWeek(data);

                    return(RedirectToAction("Weeks"));
                }
                ViewBag.Programs = _repository.GetDietProgramSelectList();
                return(View(data));
            }
            catch (Exception ex)
            {
                return(View("Error", ex));
            }
        }