public RouteStationFailure AddFailure(ServiceCode code, string comments) { RouteStationFailure failure = Scout.Core.Data.CreateEntity <RouteStationFailure>(Session); failure.FailCode = code; failure.Comments = comments; Failures.Add(failure); return(failure); }
public static bool CreateNoRepairRecord(RouteStationFailure failure) { RouteStationRepair repair = Scout.Core.Data.CreateEntity <RouteStationRepair>(failure.Session); repair.Comments = "No Repair"; repair.Component = null; repair.Failure = failure; repair.ArePartsRequired = false; repair.Repair = RepairAction.None; ReplacementComponentFacts facts = CreateNoPartComponent(repair); return(Save(repair, facts)); }
public void ChangeFpErrorCodeOwner(RouteStationFailure failure) { var currentFpHolder = AllProcessFailures.FirstOrDefault(f => f.IsFpErrorCode); if (currentFpHolder == null) { currentFpHolder = Failures.FirstOrDefault(f => f.IsFpErrorCode); } if (currentFpHolder != null) { currentFpHolder.IsFpErrorCode = false; } failure.IsFpErrorCode = true; }