System Profile
System Full Name | Radio Inspection Database Management System |
Business Contact | Julie K. Leclerc (Julie.Leclerc@dfo-mpo.gc.ca) |
Business Owner | Alexandre Lavoie |
Prod Source Location | |
Dev Source Location | Marine Safety/RIDMS/DEVELOPMENT/v5.0.4 https://dev.azure.com/transport-canada/DSD-MARINE Support/_git/RIDMS |
Technology Assessment
Database Platform and Version | Oracle |
18c | |
Development Language and Framework | C# .NET Framework 4.0 |
Operating System and Version | Windows Server 2016 |
Environment Access Information
...
Url: https://wwwappstest.tc.gc.ca/Saf-Sec-Sur/4/RIDMS-SGDIR/
KANGA
User (admin):
Pass:
Unc: \\NCRWS518\wwwappstestextroot\Saf-Sec-Sur\4\ridms-sgdir\
Url: https://wwwappstestext.tc.gc.ca/Saf-Sec-Sur/4/ridms-sgdir/eng/security/login
PROD
User (admin): See credentials doc.
...
Unc: \\tcwwwmaster\wwwappsroot\Saf-Sec-Sur\4\RIDMS-SGDIR
Url: httphttps://wwwapps.tc.gc.ca/Saf-Sec-Sur/4/RIDMS-SGDIR/eng/Security/login
PROD(2018 Server)
UNC:\\tcwwwmasterx\wwwappsroot\Saf-Sec-Sur\4\RIDMS-SGDIR
...
How-To and Fixes
Known issues:
When attempting to print an inspection report for a vessel, sometimes application crashes. Now we know what causes this problem. This requires some code changes which is not minor. This issue will be fixed when this task is prioritized.
When trying to run from local desktop, application failed to run, we had to clean up some old application strings which were not valid, also, we had to re-generate entity model from database. make sure Web.config and App.config have the same connection strings.
Problem 1: User permissions are not sufficient to enable record edits.
...
“Looks like the allowed format for text and symbols has been changed for Radio Operator. All GOC expiry every 5 years and all ROC-M prior Jan 2005 have expired. Since there is no special box allotted for dates we have been told for many years now to record the dates beside name as { expiry DDMMYY}. When I entered expiry here the filed error and now is locked out from opening. Please repair and notify when complete.”
*You will need to have account “edit permissions” to reproduce the error. If you don’t see the edit icon (as per Problem #1, then enable the fix there.
...
The record was saved as "RICHARD TREMBLAY {expiry?}" in the RD_OP1 data field, within the RIDMS_INSPECTION data table.
When later attempting to open the record for editing, the "injection" crashes RIDMS:
Server Error in '/Saf-Sec-Sur/4/RIDMS-SGDIR' Application.
Input string was not in a correct format…@Html.TextBoxFor(model => model.InspectionEditInfoViewModel.OperatorName1, Model.InspectionEditInfoViewModel.OperatorName1)
...
Problem 3: How to make Agent Status Inactive
...
Problem 4: Update Vessel Name (info) in the RIDMS database
Client was requesting that the vessel name be modified/updated
Find the vessel, change current vessel name.
select * from RIDMS_VESSEL where ship_no = '169953';
--Official Number also known as SHIP_NO: 169953
--Former Name: LAC MANITOBA
--New Name: BURCH NASH
update RIDMS_VESSEL
set current_vessel_name = 'BURCH NASH'
where ship_no = '169953';
How to Publish and Host RIDMS-WCAG
Problem 5: Duplicate or even triplicate records are being created unexpectedly in RIDMS
This problem could be caused by clicking the save button multiple times once submission.
Solution: disabling the save button after the 1st click.
Code Block |
---|
<script>
function disableButton(obj) {
obj.style.display = "none";
var fakebutton = document.getElementById("fakebutton");
fakebutton.style.display = "";
}
</script>
<div class="align-center span-6">
<input type="submit" name="SaveNew" value="@RidmsResource.Button_Save" title="@RidmsResource.Button_Save" id="saveButton" onclick="disableButton(this)"/>
<input type="submit" id="fakebutton" value="Saving" disabled style="display:none;" onclick="event.preventDefault(); " />
</div> |
For users, please try not to do multiple clicking during saving before this kind of protection.
Problem 6: Once added MaxLength or MinLength DataAnnotation in Model define, if there is @Html.ValidationMessageFor in view, it will pop up null value error.
The problem could be fix by in the DataAnnotation part, announcing the Error massage like:
[MinLength(4, ErrorMessage = "The username must be at least 4 characters long.")]
Problem 7: result = _context.RIDMS_TABLE_RUNITS.Where(x => x.REPORTING_UNIT_ID == id && x.ACTIVE_FLAG == "A").Select(x => x.REPORTING_UNIT_DESC_E).Single(); returns "System.InvalidOperationException: 'Sequence contains no elements'"
The exception "System.InvalidOperationException: 'Sequence contains no elements'" is thrown when you try to call the Single()
method on a sequence that contains no elements. In your case, the LINQ query you provided is attempting to retrieve a single element based on certain conditions, but it seems there are no elements in the result.
Solution:Use FirstOrDefault
with Null Check: Consider using FirstOrDefault
instead of Single
. This way, if there are no matching elements, the result will be null
, and you can check for it before trying to access its properties.
result = _context.RIDMS_TABLE_RUNITS
.Where(x => x.REPORTING_UNIT_ID == id && x.ACTIVE_FLAG == "A")
.Select(x => x.REPORTING_UNIT_DESC_E)
.FirstOrDefault();
if (result != null)
{
// Your logic when a result is found
}
else
{
// Handle the case when no matching element is found
}