68 lines
2.0 KiB
C#
68 lines
2.0 KiB
C#
using Logic.ProductionToProductMapper.Cordonel;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Logic.ProductionToProductMapper.Cordonel;
|
|
using Xylem.Common.CommonCore.Configuration;
|
|
using Xylem.Common.Logic.SoftwareAccessHelper;
|
|
|
|
namespace Xylem.Common.Ui.GenesisToolBox
|
|
{
|
|
public partial class FrmCalibrationResults : Form
|
|
{
|
|
|
|
public List<CalibrationResult> CalibrationResults { get; set; }
|
|
public FrmCalibrationResults()
|
|
{
|
|
CalibrationResults = new List<CalibrationResult>();
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void btnLoadHistory_Click(Object sender, EventArgs e)
|
|
{
|
|
|
|
var url = ServiceUrls.GenesisMeter() + $"GetCalibrationResults?PcbId={txtPcbId.Text}";
|
|
|
|
CalibrationResults = JsonConvert.DeserializeObject<List<CalibrationResult>>(LocalWebRequest.GetRequest(url));
|
|
|
|
dgvCalibrationResults.DataSource = CalibrationResults;
|
|
}
|
|
|
|
|
|
private void selectionChanges(Int32 RowIndex)
|
|
{
|
|
if (CalibrationResults.Any())
|
|
{
|
|
|
|
if (RowIndex >= 0 && CalibrationResults.Count >= RowIndex)
|
|
{
|
|
|
|
var logInfo = CalibrationResults[RowIndex];
|
|
dgvAdditionalLoginfo.Rows.Clear();
|
|
foreach (var item in logInfo.AdditionalLogInfos)
|
|
{
|
|
dgvAdditionalLoginfo.Rows.Add(new Object[] { logInfo.DbId, item.Key, item.Value });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
private void dgvCalibrationResults_CellContentClick(Object sender, DataGridViewCellEventArgs e)
|
|
{
|
|
selectionChanges(e.RowIndex);
|
|
}
|
|
|
|
private void dgvCalibrationResults_CellClick(Object sender, DataGridViewCellEventArgs e)
|
|
{
|
|
selectionChanges(e.RowIndex);
|
|
}
|
|
}
|
|
}
|