Added the IsRoot user Field in employee profile VM

This commit is contained in:
ashutosh.nehete 2025-08-23 11:42:11 +05:30
parent 540c3e75fd
commit bd4f1d5e69
3 changed files with 3 additions and 1 deletions

View File

@ -35,6 +35,7 @@ namespace Marco.Pms.Model.Mapper
PhoneNumber = model.PhoneNumber,
Photo = base64String,
IsActive = model.IsActive,
IsRootUser = model.ApplicationUser!.IsRootUser!.Value,
IsSystem = model.IsSystem,
JoiningDate = model.JoiningDate,
TenantId = model.TenantId

View File

@ -21,6 +21,7 @@
public string? AadharNumber { get; set; }
public bool IsActive { get; set; } = true;
public bool IsRootUser { get; set; }
public string? PanNumber { get; set; }
public string? Photo { get; set; } // To store the captured photo

View File

@ -29,7 +29,7 @@ namespace MarcoBMS.Services.Helpers
{
var result = await _context.Employees.Where(c => c.ApplicationUserId == ApplicationUserID && c.IsActive == true).ToListAsync();
return await _context.Employees.Where(c => c.ApplicationUserId == ApplicationUserID && c.IsActive == true).SingleOrDefaultAsync() ?? new Employee { };
return await _context.Employees.Include(e => e.ApplicationUser).Where(c => c.ApplicationUserId == ApplicationUserID && c.ApplicationUser != null && c.IsActive == true).SingleOrDefaultAsync() ?? new Employee { };
}
catch (Exception ex)
{