You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -608,30 +609,30 @@ public void UpdateUserDetailsAccount(string firstName, string lastName, string p
608
609
da.SelfReg,
609
610
da.UserID,
610
611
da.RegistrationConfirmationHash,
611
-
u.ID,
612
-
u.PrimaryEmail,
612
+
u.ID as UserId,
613
+
COALESCE(ucd.Email, u.PrimaryEmail) AS EmailAddress,
613
614
u.FirstName,
614
615
u.LastName,
615
-
u.Active,
616
+
u.Active as UserActive,
616
617
u.LearningHubAuthID,
617
618
u.EmailVerified,
618
619
ucd.ID,
619
620
ucd.UserID,
620
621
ucd.CentreID,
621
-
ucd.Email,
622
+
ucd.Email as CentreEmail,
622
623
ucd.EmailVerified,
623
624
(SELECT ID
624
625
FROM AdminAccounts aa
625
626
WHERE aa.UserID = da.UserID
626
627
AND aa.CentreID = da.CentreID
627
628
AND aa.Active = 1
628
629
) AS AdminID
629
-
FROM DelegateAccounts AS da
630
-
INNER JOIN Centres AS ce ON ce.CentreId = da.CentreID
631
-
INNER JOIN Users AS u ON u.ID = da.UserID
632
-
LEFT JOIN UserCentreDetails AS ucd ON ucd.UserID = u.ID
630
+
FROM DelegateAccounts AS da WITH (NOLOCK)
631
+
INNER JOIN Centres AS ce WITH (NOLOCK) ON ce.CentreId = da.CentreID
632
+
INNER JOIN Users AS u WITH (NOLOCK) ON u.ID = da.UserID
633
+
LEFT JOIN UserCentreDetails AS ucd WITH (NOLOCK) ON ucd.UserID = u.ID
633
634
AND ucd.CentreId = da.CentreID
634
-
INNER JOIN JobGroups AS jg ON jg.JobGroupID = u.JobGroupID";
635
+
INNER JOIN JobGroups AS jg WITH (NOLOCK) ON jg.JobGroupID = u.JobGroupID";
635
636
stringcondition=$@" WHERE ((@delegateId = 0) OR (da.ID = @delegateId)) AND (u.FirstName + ' ' + u.LastName + ' ' + u.PrimaryEmail + ' ' + COALESCE(ucd.Email, '') + ' ' + COALESCE(da.CandidateNumber, '') LIKE N'%' + @search + N'%')
636
637
AND ((ce.CentreID = @centreId) OR (@centreId= 0))
637
638
AND ((@accountStatus = 'Any') OR (@accountStatus = 'Active' AND da.Active = 1 AND u.Active =1) OR (@accountStatus = 'Inactive' AND (u.Active = 0 OR da.Active =0))
@@ -642,28 +643,20 @@ FROM DelegateAccounts AS da
642
643
stringsql=@$"{BaseSelectQuery}{condition} ORDER BY LTRIM(u.LastName), LTRIM(u.FirstName)
0 commit comments