public void Get_json_resource() { var person = new ResourceRepo().Get <Person>("person", GetType().Assembly); person.LastName.ShouldBe("Jenkins", StringComparison.Ordinal); person.FirstName.ShouldBe("Leeroy", StringComparison.Ordinal); }
public PlannerService(IPreactor preactor) { this._preactor = preactor; _planningBoard = _preactor.PlanningBoard; ordRepo = new OrderRepo(_preactor); resRepo = new ResourceRepo(_preactor); }
public void DeleteResourceTest() { var repo = new ResourceRepo(); var resource = repo.First(r => r.Username == "retite1"); repo.Delete(resource); UnitOfWork.Commit(); }
public bool changeReservation(int id, string studentId, int reserved) { ResourceRepo repo = new ResourceRepo(); if (reserved == 0) { studentId = null; } return(repo.changeReservation(id, reserved, studentId)); }
public Resource GetResource(int id) { Check_ResoruceId(id); if (Errors.Count == 0) { ResourceRepo repo = new ResourceRepo(); return(repo.RetrieveById(id)); } return(null); }
private bool IsResourceReserved(string id, string sid) { ResourceRepo repo = new ResourceRepo(); if (repo.CheckIfResourceReserved(id, sid) != 1) { Errors.Add(new ValidationError("This student cannot borrow this resource since its already reserved by another student.")); return(false); } return(true); }
private bool IsLoaned(string id) { ResourceRepo repo = new ResourceRepo(); if (repo.ResourceStatusIsOnloan(id) > 0) { Errors.Add(new ValidationError("This resource is already loaned")); return(false); } return(true); }
public void AddResourceTest() { var repo = new ResourceRepo(); var resource = new Resource { FirstName = "Test", LastName = "Reti", EmailAddress = "*****@*****.**", IsActive = true }; repo.Add(resource); UnitOfWork.Commit(); }
private bool IsResourceAvailable(string id) { ResourceRepo repo = new ResourceRepo(); if (repo.CheckIfResourceAvailable(id) > 0) { Errors.Add(new ValidationError("This resource cannot be reserved since its not available anymore.")); return(false); } return(true); }
private bool IsResourceReserved(string id) { ResourceRepo repo = new ResourceRepo(); if (repo.CheckIfResourceReservedForm3(id) > 0) { Errors.Add(new ValidationError("This resource cannot be reserved since its already reserved by another student.")); return(false); } return(true); }
public Resource GetResourceForm3(string id) { ResourceRepo repo = new ResourceRepo(); Validate(id); if (Errors.Count == 0) { return(repo.RetrieveByResourceId(id)); } return(repo.RetrieveByResourceId(id));; }
public void Setup() { _connectionContext = new FileSystemConnectionContext { DataRoot = @"TEST:\ThisIsNotARealDirectory\" }; var snapshotProcessor = new Mock <IInventorySnapshotProcessor>(); var resourceRepo = new ResourceRepo(); var fileSystemWrapper = new InMemoryFileSystem(); _inventoryRepo = new InventoryRepo(snapshotProcessor.Object, resourceRepo, fileSystemWrapper); }
public Resource GetResource(string id = "") { ResourceRepo repo = new ResourceRepo(); return(repo.RetrieveByResourceId(id)); }
public bool ReserveResource(string rid, string sid, string name) { ResourceRepo repo = new ResourceRepo(); return(repo.MakeReserve(rid, sid, name)); }
public bool UpdateResource2(Resource re) { ResourceRepo repo = new ResourceRepo(); return(repo.UpdateResource2(re)); }
public bool UpdateResource(string id) { ResourceRepo repo = new ResourceRepo(); return(repo.UpdateResource(id)); }
public IEnumerable <Resource> ResourceTest() { var repo = new ResourceRepo(); return(repo.GetAll()); }
public bool InsertResource(Resource r) { ResourceRepo repo = new ResourceRepo(); return(repo.InsertResource(r)); }
public Resource GetResourceOnLoan(int id) { ResourceRepo repo = new ResourceRepo(); return(repo.RetrieveByIdForResourceOnLoan(id)); }
public IQueryable <R.Resource> GetRSFromResource(long rsId) { return(ResourceRepo.Query(r => r.ResourceStructure.Id == rsId)); }