|  | @@ -52,7 +52,7 @@ namespace UnivateProperties_API.Repository.Users
 | 
		
	
		
			
			| 52 | 52 |  
 | 
		
	
		
			
			| 53 | 53 |              user.PasswordHash = passwordHash;
 | 
		
	
		
			
			| 54 | 54 |              user.PasswordSalt = passwordSalt;
 | 
		
	
		
			
			| 55 |  | -            user.Id = NewUserId();
 | 
		
	
		
			
			|  | 55 | +            //user.Id = NewUserId();
 | 
		
	
		
			
			| 56 | 56 |              _dbContext.Users.Add(user);
 | 
		
	
		
			
			| 57 | 57 |              if (save)
 | 
		
	
		
			
			| 58 | 58 |              {
 | 
		
	
	
		
			
			|  | @@ -77,7 +77,7 @@ namespace UnivateProperties_API.Repository.Users
 | 
		
	
		
			
			| 77 | 77 |                  EAABEFFCNumber = agency.EaabeffcNumber,
 | 
		
	
		
			
			| 78 | 78 |                  CompanyRegNumber = agency.RegNo
 | 
		
	
		
			
			| 79 | 79 |              };
 | 
		
	
		
			
			| 80 |  | -            a.Id = NewAgencyId();
 | 
		
	
		
			
			|  | 80 | +            //a.Id = NewAgencyId();
 | 
		
	
		
			
			| 81 | 81 |              _dbContext.Agencies.Add(a);
 | 
		
	
		
			
			| 82 | 82 |              CreatePerson(agency.User, PersonType.Agent, false, a);
 | 
		
	
		
			
			| 83 | 83 |  
 | 
		
	
	
		
			
			|  | @@ -115,7 +115,7 @@ namespace UnivateProperties_API.Repository.Users
 | 
		
	
		
			
			| 115 | 115 |                      Telephone = individual.Telephone,
 | 
		
	
		
			
			| 116 | 116 |                      Agency = agency
 | 
		
	
		
			
			| 117 | 117 |                  };
 | 
		
	
		
			
			| 118 |  | -                agent.Id = NewAgentId();
 | 
		
	
		
			
			|  | 118 | +                //agent.Id = NewAgentId();
 | 
		
	
		
			
			| 119 | 119 |                  agent.User.Role = Role.Agency;
 | 
		
	
		
			
			| 120 | 120 |                  p = agent;
 | 
		
	
		
			
			| 121 | 121 |                  _dbContext.Agents.Add(agent);
 | 
		
	
	
		
			
			|  | @@ -131,7 +131,7 @@ namespace UnivateProperties_API.Repository.Users
 | 
		
	
		
			
			| 131 | 131 |                      CellNumber = individual.CellNumber,
 | 
		
	
		
			
			| 132 | 132 |                      Telephone = individual.Telephone
 | 
		
	
		
			
			| 133 | 133 |                  };
 | 
		
	
		
			
			| 134 |  | -                i.Id = NewIndividualId();
 | 
		
	
		
			
			|  | 134 | +                //i.Id = NewIndividualId();
 | 
		
	
		
			
			| 135 | 135 |                  i.User.Role = Role.PrivateUser;
 | 
		
	
		
			
			| 136 | 136 |                  p = i;
 | 
		
	
		
			
			| 137 | 137 |                  _dbContext.Individuals.Add(i);
 | 
		
	
	
		
			
			|  | @@ -262,49 +262,49 @@ namespace UnivateProperties_API.Repository.Users
 | 
		
	
		
			
			| 262 | 262 |              _dbContext.SaveChanges();
 | 
		
	
		
			
			| 263 | 263 |          }
 | 
		
	
		
			
			| 264 | 264 |  
 | 
		
	
		
			
			| 265 |  | -        public int NewAgencyId()
 | 
		
	
		
			
			| 266 |  | -        {
 | 
		
	
		
			
			| 267 |  | -            int id = 0;
 | 
		
	
		
			
			| 268 |  | -            if (_dbContext.Agencies.Count() > 0)
 | 
		
	
		
			
			| 269 |  | -            {
 | 
		
	
		
			
			| 270 |  | -                id = _dbContext.Agencies.Max(x => x.Id);
 | 
		
	
		
			
			| 271 |  | -            }
 | 
		
	
		
			
			| 272 |  | -            id += 1;
 | 
		
	
		
			
			| 273 |  | -            return id;
 | 
		
	
		
			
			| 274 |  | -        }
 | 
		
	
		
			
			| 275 |  | -
 | 
		
	
		
			
			| 276 |  | -        public int NewAgentId()
 | 
		
	
		
			
			| 277 |  | -        {
 | 
		
	
		
			
			| 278 |  | -            int id = 0;
 | 
		
	
		
			
			| 279 |  | -            if (_dbContext.Agents.Count() > 0)
 | 
		
	
		
			
			| 280 |  | -            {
 | 
		
	
		
			
			| 281 |  | -                id = _dbContext.Agents.Max(x => x.Id);
 | 
		
	
		
			
			| 282 |  | -            }
 | 
		
	
		
			
			| 283 |  | -            id += 1;
 | 
		
	
		
			
			| 284 |  | -            return id;
 | 
		
	
		
			
			| 285 |  | -        }
 | 
		
	
		
			
			| 286 |  | -
 | 
		
	
		
			
			| 287 |  | -        public int NewIndividualId()
 | 
		
	
		
			
			| 288 |  | -        {
 | 
		
	
		
			
			| 289 |  | -            int id = 0;
 | 
		
	
		
			
			| 290 |  | -            if (_dbContext.Individuals.Count() > 0)
 | 
		
	
		
			
			| 291 |  | -            {
 | 
		
	
		
			
			| 292 |  | -                id = _dbContext.Individuals.Max(x => x.Id);
 | 
		
	
		
			
			| 293 |  | -            }
 | 
		
	
		
			
			| 294 |  | -            id += 1;
 | 
		
	
		
			
			| 295 |  | -            return id;
 | 
		
	
		
			
			| 296 |  | -        }
 | 
		
	
		
			
			| 297 |  | -
 | 
		
	
		
			
			| 298 |  | -        public int NewUserId()
 | 
		
	
		
			
			| 299 |  | -        {
 | 
		
	
		
			
			| 300 |  | -            int id = 0;
 | 
		
	
		
			
			| 301 |  | -            if (_dbContext.Users.Count() > 0)
 | 
		
	
		
			
			| 302 |  | -            {
 | 
		
	
		
			
			| 303 |  | -                id = _dbContext.Users.Max(x => x.Id);
 | 
		
	
		
			
			| 304 |  | -            }
 | 
		
	
		
			
			| 305 |  | -            id += 1;
 | 
		
	
		
			
			| 306 |  | -            return id;
 | 
		
	
		
			
			| 307 |  | -        }
 | 
		
	
		
			
			|  | 265 | +        //public int NewAgencyId()
 | 
		
	
		
			
			|  | 266 | +        //{
 | 
		
	
		
			
			|  | 267 | +        //    int id = 0;
 | 
		
	
		
			
			|  | 268 | +        //    if (_dbContext.Agencies.Count() > 0)
 | 
		
	
		
			
			|  | 269 | +        //    {
 | 
		
	
		
			
			|  | 270 | +        //        id = _dbContext.Agencies.Max(x => x.Id);
 | 
		
	
		
			
			|  | 271 | +        //    }
 | 
		
	
		
			
			|  | 272 | +        //    id += 1;
 | 
		
	
		
			
			|  | 273 | +        //    return id;
 | 
		
	
		
			
			|  | 274 | +        //}
 | 
		
	
		
			
			|  | 275 | +
 | 
		
	
		
			
			|  | 276 | +        //public int NewAgentId()
 | 
		
	
		
			
			|  | 277 | +        //{
 | 
		
	
		
			
			|  | 278 | +        //    int id = 0;
 | 
		
	
		
			
			|  | 279 | +        //    if (_dbContext.Agents.Count() > 0)
 | 
		
	
		
			
			|  | 280 | +        //    {
 | 
		
	
		
			
			|  | 281 | +        //        id = _dbContext.Agents.Max(x => x.Id);
 | 
		
	
		
			
			|  | 282 | +        //    }
 | 
		
	
		
			
			|  | 283 | +        //    id += 1;
 | 
		
	
		
			
			|  | 284 | +        //    return id;
 | 
		
	
		
			
			|  | 285 | +        //}
 | 
		
	
		
			
			|  | 286 | +
 | 
		
	
		
			
			|  | 287 | +        //public int NewIndividualId()
 | 
		
	
		
			
			|  | 288 | +        //{
 | 
		
	
		
			
			|  | 289 | +        //    int id = 0;
 | 
		
	
		
			
			|  | 290 | +        //    if (_dbContext.Individuals.Count() > 0)
 | 
		
	
		
			
			|  | 291 | +        //    {
 | 
		
	
		
			
			|  | 292 | +        //        id = _dbContext.Individuals.Max(x => x.Id);
 | 
		
	
		
			
			|  | 293 | +        //    }
 | 
		
	
		
			
			|  | 294 | +        //    id += 1;
 | 
		
	
		
			
			|  | 295 | +        //    return id;
 | 
		
	
		
			
			|  | 296 | +        //}
 | 
		
	
		
			
			|  | 297 | +
 | 
		
	
		
			
			|  | 298 | +        //public int NewUserId()
 | 
		
	
		
			
			|  | 299 | +        //{
 | 
		
	
		
			
			|  | 300 | +        //    int id = 0;
 | 
		
	
		
			
			|  | 301 | +        //    if (_dbContext.Users.Count() > 0)
 | 
		
	
		
			
			|  | 302 | +        //    {
 | 
		
	
		
			
			|  | 303 | +        //        id = _dbContext.Users.Max(x => x.Id);
 | 
		
	
		
			
			|  | 304 | +        //    }
 | 
		
	
		
			
			|  | 305 | +        //    id += 1;
 | 
		
	
		
			
			|  | 306 | +        //    return id;
 | 
		
	
		
			
			|  | 307 | +        //}
 | 
		
	
		
			
			| 308 | 308 |  
 | 
		
	
		
			
			| 309 | 309 |          public SimplePersonDto UserDetails(int userId)
 | 
		
	
		
			
			| 310 | 310 |          {
 |