public async Task <IActionResult> AddMovementForArea(int bolgeGun, int sportListId) { int sayi = bolgeGun; int hangiOgun = (bolgeGun / 10); int hangiOgun1 = hangiOgun; hangiOgun--; sayi = sayi - (hangiOgun1 * 10); int hangiGun = sayi; hangiGun--; List <SportDay> getSDays = await _sportDayService.GetSportDaysBySportListId(sportListId); SportDay selectedDay = getSDays[hangiGun]; List <Area> getDayAreas = await _areaService.GetAreasBySportDayId(selectedDay.Id); Area selectedArea = getDayAreas[hangiOgun]; //return RedirectToAction("Movements", "SportList", new //{ // id = selectedArea.Id, // hangiOgun = hangiOgun //}); return(RedirectToAction("Movements", "SportList", new { @id = selectedArea.Id })); }
public static void Main(string[] args) { sportDay = new SportDay(); bool stop = false; PrintIntroduction(); while (!stop) { int choice = UserMenu(); Console.WriteLine(); switch (choice) { case 1: AddStudents(); break; case 2: ExecuteAndWait(sportDay.PrintAllStudents); break; case 3: AddSports(); break; case 4: ExecuteAndWait(sportDay.PrintAllEvents); break; case 5: AddScore(); break; case 6: ExecuteAndWait(sportDay.PrintAllScores); break; case 7: ExecuteAndWait(sportDay.PrintTopScores); break; case 0: stop = true; break; } Console.WriteLine("\n"); } }
public async Task <SportDay> SportDayById(int Id) { SportDay getSportDay = await _sportDayRepo.Get(p => p.Id == Id); return(getSportDay); }
public async Task <int> EditSportDayAsync(SportDay sportDay) { return(await _sportDayRepo.Edit(sportDay)); }
public async Task <int> DeleteSportDayAsync(SportDay sportDay) { return(await _sportDayRepo.Delete(sportDay)); }
public async Task <int> AddSportDayAsync(SportDay sportDay) { return(await _sportDayRepo.Add(sportDay)); }
public async Task <int> AddSportListAsync(SportList sportList) { var savedNutritionList = await _sportListRepo.AddEntityAndGetId(sportList); SportDay sDay = null; Area aDay = null; int success = 0; for (int i = 1; i <= 7; i++) { sDay = new SportDay(); sDay.Name = i + ".Gün"; sDay.FKSportListId = savedNutritionList.Id; sDay = await _sportDayRepository.AddEntityAndGetId(sDay); for (int j = 1; j <= 8; j++) { aDay = new Area(); if (j == 1) { aDay.Name = "Göğüs"; } else if (j == 2) { aDay.Name = "Sırt"; } else if (j == 3) { aDay.Name = "Omuz"; } else if (j == 4) { aDay.Name = "Ön Kol"; } else if (j == 5) { aDay.Name = "Arka Kol"; } else if (j == 6) { aDay.Name = "Bacak"; } else if (j == 7) { aDay.Name = "Kardiyo"; } else { aDay.Name = "Karın"; } aDay.FKDayId = sDay.Id; success = await _areaRepository.Add(aDay); } } if (success > 0) { return(1); } return(0); }