59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Forms;
|
|
using Xylem.Common.Utils.DateTimeServer;
|
|
using Xylem.ServiceFwUpdate.Common.FwUpdateConfig.Consts;
|
|
using Xylem.ServiceFwUpdate.Common.FwUpdateDb;
|
|
|
|
namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
|
{
|
|
/// <summary>
|
|
/// History display of update process
|
|
/// </summary>
|
|
[Serializable]
|
|
public partial class FrmHistory : Form
|
|
{
|
|
/// <summary>
|
|
/// Ctor
|
|
/// </summary>
|
|
public FrmHistory()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void FrmHistory_FormClosing(Object sender, FormClosingEventArgs e)
|
|
{
|
|
//avoid destroying of object
|
|
e.Cancel = true;
|
|
//instead just hide it
|
|
Hide();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Apply labels
|
|
/// </summary>
|
|
public void ApplyLabels(FwUpdateReportDb report, CultureInfo currentCulture)
|
|
{
|
|
if (report == null) return;
|
|
if (report.FileName != null)
|
|
{
|
|
var splitName = report.FileName.Split(FwUpdateConfig.FwUpdateFileFieldSeparator);
|
|
lblCustomerName.Text = splitName[1];
|
|
}
|
|
|
|
lblDate.Text = DateTimeServer.GetDateStringFromDateTimeOffset(report.Date, currentCulture);
|
|
lblOperatorId.Text = report.UserId.ToString();
|
|
lblOrder.Text = $@"{report.OrderNr}-{report.OrderPos}";
|
|
lblPcbId.Text = report.PcbId.ToString();
|
|
}
|
|
/// <summary>
|
|
/// Select always the last line for the display.
|
|
/// </summary>
|
|
private void rtbHistory_TextChanged(Object sender, EventArgs e)
|
|
{
|
|
//rtbHistory.SelectionStart = rtbHistory.Text.Length;
|
|
//rtbHistory.ScrollToCaret();
|
|
}
|
|
}
|
|
}
|