public override string GetInformation() { // LOCAL VARIABLES int i; // Counter to for(). string s = string.Empty; s += "\n\t\tName: " + Name; s += "\n\t\tTitle: " + Title; s += "\n\t\tCompany: " + CompanyName; s += "\n\t\tCompany ID: " + CompanyId.ToString(); s += "\n\t\tList of Languages:"; if (_languages.Count > 0) { for (i = 0; i < _languages.Count; i++) { s += "\n\t\t\t" + _languages[i]; } } else { s += "\n\t\t\tNULL\n"; } return(s); }
public override int GetHashCode() { int hashcode = BeginDate.GetHashCode(); hashcode = 31 * hashcode + CompanyId.GetHashCode(); return(hashcode); }
public void AddSubContract(BuildingId buildingId, CompanyId companyId) { var company = _context.Companies.Single(c => c.Id == companyId.Value); var admin = _context.Users.FirstOrDefault(u => u.CompanyId == companyId.Value && u.CompanyRole == UserCompanyRole.Admin); if (company.Buildings == null) { company.Buildings = new List <BuildingCompany>(); } company.Buildings.Add(new BuildingCompany { BuildingId = buildingId.Value, ContractType = ContractType.SubContractor, Users = new List <UserRole>(new [] { new UserRole { UserId = admin.Id, UserBuildingRole = UserBuildingRole.Admin } }) }); _context.SaveChanges(); }
public override int GetHashCode() { int hash = 1; if (CompanyId.Length != 0) { hash ^= CompanyId.GetHashCode(); } if (CompanyName.Length != 0) { hash ^= CompanyName.GetHashCode(); } if (Status != 0) { hash ^= Status.GetHashCode(); } if (AreaCode.Length != 0) { hash ^= AreaCode.GetHashCode(); } if (CreateTime.Length != 0) { hash ^= CreateTime.GetHashCode(); } if (Address.Length != 0) { hash ^= Address.GetHashCode(); } return(hash); }
public void TestDeserialize() { Assert.AreEqual(1, CompanyId.Manipulator.InsertDataInto(TestConnection, TableName, Id1)); CompanyId toTest = CompanyId.Manipulator.RetrieveDataWhere(TestConnection, TableName, "LegalName=\"" + Id1.LegalName + "\"")[0]; Assert.AreEqual(Id1, toTest); Assert.AreEqual(1, CompanyId.Manipulator.RemoveDataWhere(TestConnection, TableName, "LegalName=\"" + Id1.LegalName + "\"")); }
public async Task <IQueryable <Employee> > GetAllAsync() { await Task.Yield(); CompanyId companyId = new CompanyId(Guid.NewGuid().ToString()); PersonId personId = new PersonId(Guid.NewGuid().ToString()); return(_dbContext.Employees.Select(o => new Employee(o))); }
public async Task <ClaimsIdentity> GenerateUserIdentityAsync(UserManager <ApplicationUser> manager) { // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); userIdentity.AddClaim(new Claim(nameof(CompanyId), CompanyId.ToString())); // Add custom user claims here return(userIdentity); }
public void Get_NotFound_CompanyNotExists() { var companyId = new CompanyId(12); _companyRepository.Get(companyId).ReturnsNull(); var response = _companyController.Get(companyId.Value); Assert.That(response, Is.TypeOf <NotFoundResult>()); }
public int CompareTo(SchedulingEntity other) { if (CompanyId == other.CompanyId) { return(DateStart.CompareTo(other.DateStart)); } else { return(CompanyId.CompareTo(other.CompanyId)); } }
public int CompareTo(CompanyCalenderEntity other) { if (CompanyId == other.CompanyId) { return(DateStart.CompareTo(other.DateStart)); } else { return(CompanyId.CompareTo(other.CompanyId)); } }
public override Dictionary <string, string> ToDictionary() { var parameters = new Dictionary <string, string>(); parameters.Add("{protocol}", Protocol); parameters.Add("{cdn}", CDN); parameters.Add("{companyId}", CompanyId.ToString()); parameters.Add("{domain}", Domain); return(parameters); }