using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace TBF.Forms { public partial class PreviousResultCtrl : UserControl { PreviousResultsDlg parent; public int BatchNr; public DateTime StarTime; public DateTime EndTime; public string ProcedureName; public string PurchaseOrder; public int PassedCount; public int FailedCount; public bool Sent; protected PreviousResultCtrl() { InitializeComponent(); } public PreviousResultCtrl(PreviousResultsDlg parent, int bnr, DateTime s, DateTime e, string proc, string pOrd, int passCnt, int failCnt, bool sent) : this() { this.parent = parent; BatchNr = bnr; StarTime = s; EndTime = e; ProcedureName = proc; PurchaseOrder = pOrd; PassedCount = passCnt; FailedCount = failCnt; Sent = sent; batchNrLabel.Text = BatchNr.ToString(); startTimeLabel.Text = string.Format("{0} {1}", StarTime.ToShortDateString(), StarTime.ToShortTimeString()); endTimeLabel.Text = string.Format("{0} {1}", EndTime.ToShortDateString(), EndTime.ToShortTimeString()); procedureLabel.Text = ProcedureName; purchaseOrderLabel.Text = string.Format("Obj.: {0}", PurchaseOrder); passedCountLabel.Text = string.Format("Dobrých: {0}", PassedCount); failedCountLabel.Text = string.Format("Zlých: {0}", FailedCount); sentCheckBox.Text = "Odoslané"; sentCheckBox.Checked = Sent; sendButton.Enabled = !Sent; sendButton.Text = "Znova"; } public void UpdateSentState(bool sent) { this.Sent = sent; sentCheckBox.Checked = sent; sendButton.Enabled = !sent; } private void sendButton_Click(object sender, EventArgs e) { parent.OnSendAgain(this, new PreviousResultIdEventArgs(BatchNr)); } } }