private bool DoScheduleTasks(int hour) { try { VballManagerWebservice.VballWebServiceSoapClient client = new VballManagerWebservice.VballWebServiceSoapClient(); client.RunScheduleTasks(DateTime.Now.Hour); String reservationData = client.RetrieveData(hour); if (!String.IsNullOrEmpty(reservationData)) { File.WriteAllText(System.AppDomain.CurrentDomain.BaseDirectory + DATAFILE + DateTime.Today.ToString("yyyy-MM-dd"), reservationData); } return(true); }catch (Exception ex) { this.LogTb.Text = this.LogTb.Text + "\r\n" + DateTime.Now.ToString() + " " + ex.Message; return(false); } // ResetHourSharpTimer(); }
private WechatMessage[] QueryVballMessages() { VballManagerWebservice.VballWebServiceSoapClient client = new VballManagerWebservice.VballWebServiceSoapClient(); List <WechatMessage> wechatMessages = new List <WechatMessage>(); VballManagerWebservice.WechatMessage[] receivdMesseages = client.WechatMessages(); foreach (VballManagerWebservice.WechatMessage wechatMessage in receivdMesseages) { WechatMessage theWechatMessage = new WechatMessage(); theWechatMessage.At = wechatMessage.At; theWechatMessage.Date = wechatMessage.Date; theWechatMessage.Message = wechatMessage.Message; theWechatMessage.Name = wechatMessage.Name; theWechatMessage.WechatName = wechatMessage.WechatName; wechatMessages.Add(theWechatMessage); } return(wechatMessages.ToArray()); }