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;
     }
     
 }
Exemple #3
0
 public async static Task Update(Connection connection)
 {
     await DatabaseManagement.Update(connection);
 }
Exemple #4
0
 public async static Task Remove(Connection connection)
 {
     await DatabaseManagement.Remove(connection);
 }
Exemple #5
0
 public async static Task Insert(Connection connection)
 {
     await DatabaseManagement.Insert(connection);
 }