Exemple #1
0
 public TrainServiceClient GetClientService()
 {
     if (clientSvc == null)
     {
         InstanceContext context = new InstanceContext(this);
         clientSvc = new TrainServiceClient(context);
     }
     return(clientSvc);
 }
Exemple #2
0
        public Login()
        {
            InitializeComponent();
            client          = TrainClientSVC.GetTrainSVC().GetClientService();
            this.Loaded    += Login_Loaded;
            _timer.Interval = 500;
            _timer.Tick    += _timer_Tick;

            _timer2.Interval = 2000;
            _timer2.Tick    += _timer2_Tick;
            _timer2.Start();
        }
Exemple #3
0
 public Loaded()
 {
     InitializeComponent();
     log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo("Log4Net.config"));
     //log4net.Config.XmlConfigurator.Configure();
     this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
     client = TrainClientSVC.GetTrainSVC().GetClientService();
     Dispatcher.Invoke(() =>
     {
         Task.Factory.StartNew(InitializeStation);
         Task.Run(() => InitAllSaleStation());
     });
 }
Exemple #4
0
 /// <summary>
 /// 重新刷新验证码
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="eventArgs"></param>
 private void RefreshPasscode(object sender, object eventArgs)
 {
     try
     {
         TrainServiceClient client = TrainClientSVC.GetTrainSVC().GetClientService();
         string             url    = StringHelper.GetConfigValByKey(Constant.VerifyCodeUrl, false) + "&" + new Random().NextDouble().ToString() + new Random().Next(0, 10);
         string             path   = StringHelper.VirtualPath;
         //path = client.HttpGet(url, path).ToString();
         path = TrainCommon.HttpRequest.HttpGet(url, path).ToString();
         this.InitBackgroundImage(this.gridMain, path);
         this.Border_MouseDown(sender, eventArgs as MouseButtonEventArgs);
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex);
     }
 }