Exemplo n.º 1
0
        public void Can_get_court()
        {
            IRepository <Court> repository = new CourtRepository();
            var courts = repository.GetAll();

            Assert.IsNotNull(courts);
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 4
0
 public EFReservationUnitOfWork(SportsClubContext ctx,
                                ReservationRepository reservationRepository,
                                MemberRepository memberRepository,
                                CourtRepository courtRepository)
 {
     this.ctx = ctx;
     ReservationRepository = reservationRepository;
     MemberRepository      = memberRepository;
     CourtRepository       = courtRepository;
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        /// <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;
            }
        }
Exemplo n.º 7
0
        //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);
            }));
        }
Exemplo n.º 8
0
 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();
     }
 }
Exemplo n.º 9
0
 public Biz()
 {
     memberRepository = new MemberRepository();
     courtRepository  = new CourtRepository();
 }
Exemplo n.º 10
0
 public EFCourtUnitOfWork(SportsClubContext ctx, CourtRepository courtRepository)
 {
     this.ctx        = ctx;
     CourtRepository = courtRepository;
 }
Exemplo n.º 11
0
 public CourtController()
 {
     _courtRepository = new CourtRepository();
 }
Exemplo n.º 12
0
 //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)));
 }
Exemplo n.º 13
0
 //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));
 }
Exemplo n.º 14
0
 public Task <Court> GetCourtDetails(int courtId)
 {
     return(Task.Factory.StartNew(() => CourtRepository.GetCourtDetail(courtId).Item1));
 }
Exemplo n.º 15
0
 public Task <bool> AssignPlayerToACourt(int courtId, int playerId)
 {
     return(Task.Factory.StartNew(() => CourtRepository.AssignPlayerToACourt(courtId, playerId)));
 }
Exemplo n.º 16
0
 public Task <bool> DeleteSinglePlayerFromAllCourt(Player player)
 {
     return(Task.Factory.StartNew(() => CourtRepository.DeleteSinglePlayerFromCourt(player)));
 }
Exemplo n.º 17
0
 ///NEW area
 public Task <bool> IsCourtFullyOccupied(Court court)
 {
     return(Task.Factory.StartNew(() => CourtRepository.IsCourtFullyOccupied(court.ID)));
 }
Exemplo n.º 18
0
 public CourtController()
 {
     db = new ApplicationDbContext();
     CourtRepository = new CourtRepository();
 }
Exemplo n.º 19
0
 public CourtsController()
 {
     CourtRepository = new CourtRepository();
 }