|
|
@@ -258,5 +258,27 @@ namespace UnivateProperties_API.Repository.Users
|
|
258
|
258
|
{
|
|
259
|
259
|
_dbContext.SaveChanges();
|
|
260
|
260
|
}
|
|
|
261
|
+
|
|
|
262
|
+ public string UserDetails(int userId)
|
|
|
263
|
+ {
|
|
|
264
|
+ var individual = _dbContext.Individuals.Where(i => i.UserId == userId).FirstOrDefault();
|
|
|
265
|
+
|
|
|
266
|
+ if (individual == null)
|
|
|
267
|
+ {
|
|
|
268
|
+ var agent = _dbContext.Agents.Where(i => i.UserId == userId).FirstOrDefault();
|
|
|
269
|
+ if (agent != null)
|
|
|
270
|
+ {
|
|
|
271
|
+ return agent.Name + " " + agent.Surname;
|
|
|
272
|
+ }
|
|
|
273
|
+ else
|
|
|
274
|
+ {
|
|
|
275
|
+ return "";
|
|
|
276
|
+ }
|
|
|
277
|
+ }
|
|
|
278
|
+ else
|
|
|
279
|
+ {
|
|
|
280
|
+ return individual.Name + " " + individual.Surname;
|
|
|
281
|
+ }
|
|
|
282
|
+ }
|
|
261
|
283
|
}
|
|
262
|
284
|
}
|