private async void AbbSave_Click(object sender, RoutedEventArgs e) { if (await validateInput()) { if (EditConn != null) { EditConn.Host = txtAddress.Text; EditConn.Port = txtPort.Text; EditConn.Name = txtName.Text; await Connection.Update(EditConn); } else { Connection conn = new Connection(); conn.Host = txtAddress.Text; conn.Port = txtPort.Text; conn.Name = txtName.Text; await Connection.Insert(conn); } Frame.Navigate(typeof(ListPage)); } }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { EditConn = e.Parameter as Connection; if (EditConn != null) { txtAddress.Text = EditConn.Host; txtName.Text = EditConn.Name; txtPort.Text = EditConn.Port; } }
public async static Task Update(Connection connection) { await DatabaseManagement.Update(connection); }
public async static Task Remove(Connection connection) { await DatabaseManagement.Remove(connection); }
public async static Task Insert(Connection connection) { await DatabaseManagement.Insert(connection); }