public Header(char usage) { this.interchangeDate = InterchangeTracker.GetInterchangeDate(); this.interchangeTime = InterchangeTracker.GetInterchangeTime(); this.interchangeControlNum = InterchangeTracker.GetInterchangeNumber().ToString().PadLeft(9, '0'); //if (Form1.cbType.SelectedIndex == 0) { // this.usageIndicator = 'T'; //} else { // this.usageIndicator = 'P'; //} this.usageIndicator = usage; }
private void BtnUpdate_Click(object sender, EventArgs e) { InterchangeTracker.UpdateInterchange(); string interchangeNumber = InterchangeTracker.GetInterchangeNumber().ToString(); string dateStr = InterchangeTracker.GetInterchangeDate(); int year = Convert.ToInt32("20" + dateStr.Substring(0, 2)); int mon = Convert.ToInt32(dateStr.Substring(2, 2)); int day = Convert.ToInt32(dateStr.Substring(4, 2)); string time = InterchangeTracker.GetInterchangeTime(); int hour = Convert.ToInt32(time.Substring(0, 2)); int min = Convert.ToInt32(time.Substring(2, 2)); DateTime dt = new DateTime(year, mon, day, hour, min, 0); this.lblInterchangeNumber.Text = "Interchange Number: " + interchangeNumber; this.dtPicker.Value = dt; Log.Info("updated interchange to " + InterchangeTracker.ToString()); }
public Form1() { this.InitializeComponent(); this.cbType.SelectedIndex = 0; // log4net.Config.XmlConfigurator.Configure(); string interchangeNumber = InterchangeTracker.GetInterchangeNumber().ToString(); string dateStr = InterchangeTracker.GetInterchangeDate(); int year = Convert.ToInt32("20" + dateStr.Substring(0, 2)); int mon = Convert.ToInt32(dateStr.Substring(2, 2)); int day = Convert.ToInt32(dateStr.Substring(4, 2)); string time = InterchangeTracker.GetInterchangeTime(); int hour = Convert.ToInt32(time.Substring(0, 2)); int min = Convert.ToInt32(time.Substring(2, 2)); DateTime dt = new DateTime(year, mon, day, hour, min, 0); this.lblInterchangeNumber.Text = "Interchange Number: " + interchangeNumber; this.dtPicker.Value = dt; Log.Info("Starting form loading at " + DateTime.Now); }