public void Can_get_court() { IRepository <Court> repository = new CourtRepository(); var courts = repository.GetAll(); Assert.IsNotNull(courts); }
public CasesController() { db = new ApplicationDbContext(); CaseRepository = new CaseRepository(); AttorneyRepository = new AttorneyRepository(); CourtRepository = new CourtRepository(); PartyRepository = new PartyRepository(); }
public UnitOfWork(AppDbContext context) { _context = context; Courts = new CourtRepository(context); Jurisdictions = new JurisdictionRepository(context); Cases = new CaseRepository(context); Litigants = new LitigantRepository(context); }
public EFReservationUnitOfWork(SportsClubContext ctx, ReservationRepository reservationRepository, MemberRepository memberRepository, CourtRepository courtRepository) { this.ctx = ctx; ReservationRepository = reservationRepository; MemberRepository = memberRepository; CourtRepository = courtRepository; }
public void Can_add_new_Court() { var court = new Court() { Name = "Toyota Center", Id = Guid.NewGuid(), Address = "Houston" }; IRepository <Court> repository = new CourtRepository(); repository.Save(court); }
/// <summary> /// Loads all courts from the repo /// </summary> /// <returns></returns> public override async Task LoadAllAsync() { try { CourtRepository repo = new CourtRepository(); IEnumerable <Court> courts = await repo.GetAllAsync(); Courts.ReplaceWith(courts); } catch { throw; } }
//Initialise the courts. So that we can draw the UI. //This should be called ONCE. public Task <List <Court> > InitCourts(int maxCourts) { return(Task.Factory.StartNew(() => { var courts = new List <Court>(); for (int i = 0; i < maxCourts; i++) { int courtNum = i + 1; string courtName = courtNum.ToString(); var newCourt = new Court() { GuId = Guid.NewGuid(), Name = courtName, IsOccupied = false }; courts.Add(newCourt); } ; return CourtRepository.InitCourtDetail(courts); })); }
public void InitDB() { if (CaseRepository.GetAll().Count() == 0) { CaseRepository.Insert(new Case() { Caseid = 1, Name = "Все" }); CaseRepository.Insert(new Case() { Caseid = 2, Name = "Уголовное" }); CaseRepository.Insert(new Case() { Caseid = 3, Name = "Гражданское" }); CaseRepository.Insert(new Case() { Caseid = 4, Name = "Административное" }); CaseRepository.Insert(new Case() { Caseid = 5, Name = "Экономическое" }); CaseRepository.Insert(new Case() { Caseid = 6, Name = "Дисциплинарный спор" }); this.Save(); } if (CourtRepository.GetAll().Count() == 0) { CourtRepository.Insert(new Court() { CourtId = 1, Name = "Все", BaseURL = "none", URLToDoc = "none", TypeSite = "none", TypeSiteId = 0, Encoding = "none" }); CourtRepository.Insert(new Court() { CourtId = 2, Name = "Верховный Суд", BaseURL = "http://www.vsrf.ru", URLToDoc = "indexA.php?", TypeSite = "vsrf", TypeSiteId = 1, Encoding = "windows-1251" }); CourtRepository.Insert(new Court() { CourtId = 3, Name = "Архангельский областной суд", BaseURL = "http://oblsud.arh.sudrf.ru", URLToDoc = "modules.php?", TypeSite = "sudrf", TypeSiteId = 2, Encoding = "windows-1251" }); this.Save(); } if (InstanceRepository.GetAll().Count() == 0) { InstanceRepository.Insert(new Instance() { InstanceId = 1, Name = "Все" }); InstanceRepository.Insert(new Instance() { InstanceId = 2, Name = "Первая инстанция" }); InstanceRepository.Insert(new Instance() { InstanceId = 3, Name = "Апелляция" }); InstanceRepository.Insert(new Instance() { InstanceId = 4, Name = "Кассация" }); InstanceRepository.Insert(new Instance() { InstanceId = 5, Name = "Надзор" }); this.Save(); } if (TypeDocRepository.GetAll().Count() == 0) { TypeDocRepository.Insert(new DocType() { DocTypeId = 1, Name = "Все" }); TypeDocRepository.Insert(new DocType() { DocTypeId = 2, Name = "Решение" }); TypeDocRepository.Insert(new DocType() { DocTypeId = 3, Name = "Приговор" }); TypeDocRepository.Insert(new DocType() { DocTypeId = 4, Name = "Определение" }); TypeDocRepository.Insert(new DocType() { DocTypeId = 5, Name = "Постановление" }); this.Save(); } }
public Biz() { memberRepository = new MemberRepository(); courtRepository = new CourtRepository(); }
public EFCourtUnitOfWork(SportsClubContext ctx, CourtRepository courtRepository) { this.ctx = ctx; CourtRepository = courtRepository; }
public CourtController() { _courtRepository = new CourtRepository(); }
//Update the court when assigning a player to a court. Need to update the stattus too. public Task <int> UpdateCourtDetail(Court court) { return(Task.Factory.StartNew(() => CourtRepository.SaveOrUpdateCourt(court))); }
//Will be used in Queue list. Provide a list of Q that is not fully occupied. public Task <List <Court> > GetAllCourtDetails() { return(Task.Factory.StartNew(() => CourtRepository.GetAllCourtDetails().Item1)); }
public Task <Court> GetCourtDetails(int courtId) { return(Task.Factory.StartNew(() => CourtRepository.GetCourtDetail(courtId).Item1)); }
public Task <bool> AssignPlayerToACourt(int courtId, int playerId) { return(Task.Factory.StartNew(() => CourtRepository.AssignPlayerToACourt(courtId, playerId))); }
public Task <bool> DeleteSinglePlayerFromAllCourt(Player player) { return(Task.Factory.StartNew(() => CourtRepository.DeleteSinglePlayerFromCourt(player))); }
///NEW area public Task <bool> IsCourtFullyOccupied(Court court) { return(Task.Factory.StartNew(() => CourtRepository.IsCourtFullyOccupied(court.ID))); }
public CourtController() { db = new ApplicationDbContext(); CourtRepository = new CourtRepository(); }
public CourtsController() { CourtRepository = new CourtRepository(); }