private void btnAdd_Click(object sender, EventArgs e) { AzureApp app; if (((AzureAppType)comboType.SelectedItem) == AzureAppType.Server) { app = new ServerAzureApp { AppName = textAppName.Text, ClientId = txtClientId.Text, RedirectURL = txtRedirectURL.Text, Secret = txtSecret.Text }; } else { app = new ClientAzureApp { AppName = textAppName.Text, ClientId = txtClientId.Text, RedirectURL = txtRedirectURL.Text, }; } TokenAssistantServiceClient dataServiceSlient = new TokenAssistantServiceClient(); dataServiceSlient.AddApp(app); MessageBox.Show("Add successfully!"); this.Close(); }
private void btnEdit_Click(object sender, EventArgs e) { AzureApp app; if (((AzureAppType)comboType.SelectedItem) == AzureAppType.Server) { app = new ServerAzureApp(); ((ServerAzureApp)app).Secret = txtSecret.Text; } else { app = new ClientAzureApp(); } app.ClientId = txtClientId.Text; app.AppName = txtAppName.Text; app.RedirectURL = txtRedirectURL.Text; dataService.SaveApp(app); MessageBox.Show("Modify Successfuly!"); this.Close(); }