Пример #1
0
        private void TrainPropertiesDlg_Closed(object sender, EventArgs e)
        {
            TrainPropertiesDlg dlg = sender as TrainPropertiesDlg;

            if ((dlg != null) && !(!dlg.DialogResult.HasValue ? true : !dlg.DialogResult.Value))
            {
                TISWebServiceSoapClient client = this.GetClient();
                client.SetTrainDataCompleted += new EventHandler <SetTrainDataCompletedEventArgs>(this.TISWebService_SetTrainDataCompleted);
                client.SetTrainDataAsync(dlg.Train.ID, dlg.TrainIdNew, dlg.Locomotive, dlg.Description, this.m_strUserName);
            }
        }
Пример #2
0
        private void Layout_OnTrainProperties(Train t)
        {
            List <string> possibleTrainIds = this.GetPossibleTrainIds();

            if (!possibleTrainIds.Contains(t.ID))
            {
                possibleTrainIds.Insert(0, t.ID);
            }
            Uri                u      = new Uri(string.Format("/TrainRoute.aspx?TrainId={0}", HttpUtility.UrlEncode(t.ID)), UriKind.Relative);
            TimeSpan           span   = (TimeSpan)(DateTime.Now - this.m_LastShiftPressed);
            bool               enable = (span.TotalSeconds < 2.0) || (this.m_strUserName.Length > 0);
            TrainPropertiesDlg dlg    = new TrainPropertiesDlg(t, possibleTrainIds, u, enable);

            dlg.Closed += new EventHandler(this.TrainPropertiesDlg_Closed);
            dlg.Show();
        }
Пример #3
0
 private void Layout_OnTrainProperties(Train t)
 {
     List<string> possibleTrainIds = this.GetPossibleTrainIds();
     if (!possibleTrainIds.Contains(t.ID))
     {
         possibleTrainIds.Insert(0, t.ID);
     }
     Uri u = new Uri(string.Format("/TrainRoute.aspx?TrainId={0}", HttpUtility.UrlEncode(t.ID)), UriKind.Relative);
     TimeSpan span = (TimeSpan) (DateTime.Now - this.m_LastShiftPressed);
     bool enable = (span.TotalSeconds < 2.0) || (this.m_strUserName.Length > 0);
     TrainPropertiesDlg dlg = new TrainPropertiesDlg(t, possibleTrainIds, u, enable);
     dlg.Closed += new EventHandler(this.TrainPropertiesDlg_Closed);
     dlg.Show();
 }