public void ICanUpdateASpecificInspectionReport() { IInspectionReportService service = new InspectionReportService(_repo, _unit); DateTime dateNow = DateTime.Now; var tempReport = new InspectionReport { InspectionNo = "ABCDEF", InspectionDate = dateNow, StructureNo = "000000", DeckType = "SandPaper", IsMaintenanceRequired = true, IsHighwayBridge = true }; service.UpdateInspectionReport(tempReport); var result = service.GetInspectionReportByInspectionNo("ABCDEF"); Assert.IsTrue(result.Count() == 1); var report = result.FirstOrDefault(); Assert.IsTrue(report.InspectionNo == tempReport.InspectionNo); Assert.IsTrue(report.DeckType == tempReport.DeckType); Assert.IsTrue(report.InspectionDate == tempReport.InspectionDate); Assert.IsTrue(report.IsHighwayBridge == tempReport.IsHighwayBridge); Assert.IsTrue(report.IsMaintenanceRequired == tempReport.IsMaintenanceRequired); Assert.IsTrue(report.StructureNo == tempReport.StructureNo); }
public Task ReceiveAsync(IContext context) { switch (context.Message) { case LogMessage log: { _logs.Add(log); break; } case InspectionReport report: { _state = report; break; } case TrackedMessage message: { _messages.Add(message); break; } case QueryLogsAndMessages q: { var data = new LogsAndMessagesData(); data.Messages.Add(_messages); data.Logs.Add(_logs); context.Tell(context.Sender, data); break; } } return(Actor.Done); }
private IInspectionReport CreateReport(IContext context) { foreach (var child in context.Children) { child.Request(Inspect.Instance, context.Sender); } var report = InspectionReport .Create(context) .Add("kernel::name", __name) .Add("kernel::actorType", GetType().FullName) .Add("kernel::status", __currentStatus) .Add("kernel::uptime", DateTime.UtcNow - __created) .Add("kernel::receivedMessages", __receivedMessages); if (__restartCount > 0) { report.Add("kernel::restarts", __restartCount); } if (__group != null) { report.Add("kernel::group", __group); } OnReport(report); return(report); }
public InspectionReportAck PushReport(InspectionReport req) { return(new InspectionReportAck() { result = new Model.ServiceModel.Result() { code = 0, message = "OK" } }); }
public Node(InspectionReport report, bool recursive) : this(report.Pid.ToShortString(), recursive) { Timestamp = UnixEpoch.AddMilliseconds(report.MillisFromEpoch).ToLocalTime(); foreach (var keyValuePair in report.Status) { this.Status[keyValuePair.Key] = keyValuePair.Value; } this.Warnings = report.Warnings.ToList(); }
public void Update(InspectionReport entityToUpdate) { var report = _mockData.Where(r => r.InspectionNo == entityToUpdate.InspectionNo).FirstOrDefault(); if (report != null) { var idx = _mockData.IndexOf(report); if (idx >= 0) { _mockData[idx] = entityToUpdate; } } }
public void Initialize() { _repo = new MockInspectionReportRepository(); _unit = Substitute.For <IUnitOfWork>(); _report = new InspectionReport { InspectionNo = "ABCDEF", InspectionDate = new DateTime(2016, 06, 12, 00, 00, 00), StructureNo = "354891", DeckType = "Earth", IsMaintenanceRequired = false, IsHighwayBridge = false }; }
public static void SaveToXaml(IEnumerable <InspectionResult> tasks, string dir, string suffix = null) { var report = new InspectionReport(); foreach (var task in tasks) { report.Results.Add(task); } DateTime dateTime = DateTime.Now; var fileName = dateTime.ToString("yyyy-MM-dd_HH.mm.ss_") + suffix + "" + ".xaml"; // var reportsDir = Path.Combine(dir, "_reports" + dateTime.ToString("_yyyy-MM-dd_HH.mm.ss")); var fileFullName = Path.Combine(dir, fileName); report.SerializeToXamlFile(fileFullName); }
public IActionResult Put([FromBody] InspectionReport report) { if (ModelState.IsValid) { try { _inspectionReportService.UpdateInspectionReport(report); return(Ok(new { Result = "Success" })); } catch { return(BadRequest(new { ErrorMessage = "Could not update report" })); } } return(BadRequest(new { ErrorMessage = "Model state was invalid" })); }
public async Task <InspectionReportMap> GetReportAsync(string clientId) { if (clientId != null && _roots.TryGetValue(clientId, out var node)) { return(await node.RequestAsync <InspectionReportMap>(new InspectionReportRequest()).ConfigureAwait(false)); } var report = new InspectionReportMap(); var inspectionReport = new InspectionReport { Pid = new PID("nonhost", clientId ?? "Demo") }; inspectionReport.Status.Add("kernel::name", "Name"); inspectionReport.Status.Add("kernel::actorType", "ActorType"); inspectionReport.Status.Add("kernel::status", "Started"); report.Reports.Add("root", inspectionReport); return(report); }
void m_RepCon1_NewReport(object sender, ReportConnectionEventArgs e) { // Get the Inspection report report = e.Report; // Get Number of Blobs bool status; long numBlobs; status = report.Results[0].AsBool; textBox1.Text = status.ToString(); numBlobs = report.Results[1].AsInt; textBox2.Text = numBlobs.ToString(); //does our report contain any images, if so display it? if (report.Images.Count > 0) { //extract the image as a BufferDm, //and set it into the Buffer View BufferView1.Buffer = (BufferDm)report.Images[0]; } // This is a good place to collect unused memory GC.Collect(); }
public void Insert(InspectionReport entity) { throw new NotImplementedException(); }
public void Delete(InspectionReport entityToDelete) { throw new NotImplementedException(); }
public void UpdateInspectionReport(InspectionReport report) { _inspectionReportRepository.Update(report); _unitOfWork.SaveChanges(); }
public InspectionReportAck PushReport(InspectionReport req) { Uri uri = new Uri(ServiceURL.UrlINspectionReport); return(request <InspectionReport, InspectionReportAck> .executePost(req, uri)); }