private async void buttonHost_Click(object sender, EventArgs e) { if (checkFields()) { using (var form = new HostForm()) { var result = form.ShowDialog(); if (result == DialogResult.OK) { Survey survey = await viewModel.hostSurvey(); if (survey == null) { MessageBox.Show("Cant reach server, please check your internet connection and try again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (survey.host != null) { using (var formS = new HostSuccessForm(survey.host.id)) { formS.ShowDialog(); } } else { MessageBox.Show("This survey is already hosted. You need to delete the host from MySurveys tab in order to host it again."); } } } } }
private void buttonShare_Click(object sender, EventArgs e) { if (this.viewModel.survey.host != null) { using (var formS = new HostSuccessForm(this.viewModel.survey.host.id)) { formS.ShowDialog(); } } }