/// <summary>Determines whether the given status name is valid for the status with the given ID.</summary> /// <param name="statusId">The status ID.</param> /// <param name="newStatusName">New name for the status.</param> /// <returns><c>true</c> if the given status name is valid for the status with the given ID; otherwise, <c>false</c>.</returns> private bool IsStatusNameUnique(int?statusId, string newStatusName) { var newStatusId = ApplicationStatus.GetStatusId(newStatusName, this.PortalId); return(!newStatusId.HasValue || (statusId.HasValue && newStatusId.Value == statusId.Value)); }