Столбец «Выйти из комментариев» сортируется некорректно.
Я подозреваю, что проблема в хранимой процедуре. Пожалуйста, посмотрите и дайте несколько советов.
Я приложил код хранимой процедуры.
Спасибо
/// <summary>
/// Executes procedure logic.
/// </summary>
/// <param name="parameters">Parameters in form of <see cref="Dictionary{String, Object}"/>.</param>
/// <returns>Result returned by procedure.</returns>
public override dynamic Execute(Dictionary<string, object> parameters)
{
int pageIndex = Convert.ToInt32(parameters["@pageIndex"]);
int maximumRows = Convert.ToInt32(parameters["@maximumRows"]);
string userName = parameters["@userName"] == null ? string.Empty : parameters["@userName"].ToString();
string loginStatus = parameters["@loginStatus"] == null ? string.Empty : parameters["@loginStatus"].ToString();
string browser = parameters["@browser"] == null ? string.Empty : parameters["@browser"].ToString();
DateTime? loginTimeStartDate = (DateTime?)parameters["@loginTimeStartDate"] == null ? new DateTime(1900, 1, 1, 5, 0, 0) : (DateTime?)parameters["@loginTimeStartDate"];
DateTime? loginTimeEndDate = (DateTime?)parameters["@loginTimeEndDate"] == null ? new DateTime(3000, 1, 1, 5, 0, 0) : (DateTime?)parameters["@loginTimeEndDate"];
DateTime? logoutTimeStartDate = (DateTime?)parameters["@logoutTimeStartDate"] == null ? new DateTime(1900, 1, 1, 5, 0, 0) : (DateTime?)parameters["@logoutTimeStartDate"];
DateTime? logoutTimeEndDate = (DateTime?)parameters["@logoutTimeEndDate"] == null ? new DateTime(3000, 1, 1, 5, 0, 0) : (DateTime?)parameters["@logoutTimeEndDate"];
string logoutReason = parameters["@logoutReason"] == null ? string.Empty : parameters["@logoutReason"].ToString();
int callingOrganizationId = Convert.ToInt32(parameters["@callingUserOrganizationId"]);
string orderBy = parameters["@orderBy"] == null ? "LogoutDate DESC" : parameters["@orderBy"].ToString();
string serverNames = parameters["@serverNames"] == null ? string.Empty : parameters["@serverNames"].ToString();
string certificate = parameters["@certificate"] == null ? string.Empty : parameters["@certificate"].ToString();
string browserSettings = parameters["@browserSettings"] == null ? string.Empty : parameters["@browserSettings"].ToString();
string sessionIds = parameters["@sessionTypes"] == null ? string.Empty : parameters["@sessionTypes"].ToString();
bool IsGetTotalRecordsCount = parameters["@IsGetTotalRecordsCount"] == null ? false : Convert.ToBoolean(parameters["@IsGetTotalRecordsCount"]);
string[] userNameList = userName.Split(',');
string[] loginStatusList = loginStatus.Split(',');
string[] browserList = browser.Split(',');
string[] logoutReasonList = logoutReason.Split(',');
string[] serverNameList = serverNames.Split(',');
string[] sessionTypeList = sessionIds.Split(',');