private async void Btn_ToSiteInfo_Click(object sender, EventArgs e) { string url = "https://localhost:5001/api/route?routeId=" + routeID; XmlSerializer xmlSerializer = new XmlSerializer(typeof(Route)); Client client = new Client(); try { HttpResponseMessage result = await client.Get(url); if (result.IsSuccessStatusCode) { Route route = (Route)xmlSerializer.Deserialize(await result.Content.ReadAsStreamAsync()); UC_SiteInfo uc_siteInfo = new UC_SiteInfo(changePanel, travelTitle, travelId, false, routeID, siteId); uc_siteInfo.delegate_Get = new delegate_getTask(uc_siteInfo.getTask); changePanel(uc_siteInfo); } else { using (Form_Tips tip = new Form_Tips("警告", "获取失败")) { tip.ShowDialog(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void Btn_AddRoute_Click(object sender, EventArgs e) { UC_SiteInfo uc_siteInfo = new UC_SiteInfo(changePanel, travelTitle, travelId, true); uc_siteInfo.delegate_Get = new delegate_getTask(uc_siteInfo.getTask); changePanel(uc_siteInfo); }
private void Btn_ToSiteInfo_Click(object sender, EventArgs e) { UC_SiteInfo uc_siteInfo = new UC_SiteInfo(changePanel, routeID); changePanel(uc_siteInfo); }
private void Btn_addSite_Click(object sender, EventArgs e) { UC_SiteInfo newsite = new UC_SiteInfo(); changePanel(newsite); }