diff --git a/Gordon360/Models/CCT/Housing/ResidentialStatus_View.cs b/Gordon360/Models/CCT/Housing/ResidentialStatus_View.cs index b2d440912..3a8e83742 100644 --- a/Gordon360/Models/CCT/Housing/ResidentialStatus_View.cs +++ b/Gordon360/Models/CCT/Housing/ResidentialStatus_View.cs @@ -22,5 +22,5 @@ public partial class ResidentialStatus_View [Unicode(false)] public string Residency_Status { get; set; } - public int Is_Residential { get; set; } + public bool? Is_Residential { get; set; } } \ No newline at end of file diff --git a/Gordon360/Properties/launchSettings.json b/Gordon360/Properties/launchSettings.json index 96d610b3e..6b3e2504f 100644 --- a/Gordon360/Properties/launchSettings.json +++ b/Gordon360/Properties/launchSettings.json @@ -3,12 +3,12 @@ "Development": { "commandName": "Project", "launchBrowser": true, - "launchUrl": "https://localhost:51659/swagger", + "launchUrl": "https://localhost:51657/swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "sqlDebugging": true, - "applicationUrl": "https://localhost:51659;http://localhost:51660" + "applicationUrl": "https://localhost:51657;http://localhost:51658" }, "Train": { "commandName": "Project", diff --git a/Gordon360/Services/HousingService.cs b/Gordon360/Services/HousingService.cs index a0eec9be9..23d611181 100644 --- a/Gordon360/Services/HousingService.cs +++ b/Gordon360/Services/HousingService.cs @@ -550,11 +550,11 @@ public async Task CreateRoomRangeAsync(HallAssignmentRan } // Check if there is any overlapping room ranges in the same hall var overlappingRange = await context.Hall_Assignment_Ranges - .FirstOrDefaultAsync(r => r.Hall_ID == model.Hall_ID + .AnyAsync(r => r.Hall_ID == model.Hall_ID && ((r.Room_Start <= model.Room_Start && r.Room_End >= model.Room_Start) || (r.Room_Start <= model.Room_End && r.Room_End >= model.Room_End))); - if (overlappingRange != null) + if (overlappingRange) { throw new InvalidOperationException("The room range overlaps with an existing range in this hall."); } @@ -1062,12 +1062,12 @@ public async Task IsRAOnCallAsync(string raId) /// True if the student is a resident public async Task IsStudentResidentialAsync(int idNum) { - var student = await context.ResidentialStatus_View + var isRes = await context.ResidentialStatus_View .Where(s => s.Student_ID == idNum) .Select(s => s.Is_Residential) .FirstOrDefaultAsync(); - return student == 1; + return isRes ?? false; }