private async void LoginBtn_Click(object sender, EventArgs e) { try { this.waitingBar.StartWaiting(); // Get all events var base64HeaderValue = Convert.ToBase64String( System.Text.Encoding.UTF8.GetBytes($@"{this.loginTextEdit.Text}:{this.passwordTextEdit.Text}")); const string Url = @"http://openeventor.ru/api/get_events"; var task = await Queries.GetAllEventsAsync(Url, base64HeaderValue); var result = JsonConvert.DeserializeObject <Eventor>(task); this.waitingBar.StopWaiting(); CustomFlyoutDialog.ShowForm(this, null, new GetEvents(result)); this.urlTextEdit.Text = $@"http://openeventor.ru/api/event/{CurrentApiData.Token}/get_event"; } catch (Exception ex) { this.waitingBar.StopWaiting(); XtraMessageBox.Show("Проверте логин и пароль или нет доступ к апи, проверьте интернет соединения", "Error", MessageBoxButtons.OK); if (CurrentEzd.EzdPictureEdit != null) { ezdObjects = EzdDataControl.ReopositoryEzdFile.GetEzdData(); updatedEzdObjects = new List <Tuple <string, StringBuilder> >(); new UpdateEzdData(ezdObjects); } } }
private void SearchSimpleButton_Click(object sender, EventArgs e) { CustomFlyoutDialog.ShowForm(_form, null, new SearchCompetitor(this.searchTextEdit)); }