private void LaunchQuestionDialog(String questionID, ListBoxRow row) { var questionDialog = new QuestionDialog(questions[questionID], this, row); DepartmentApp.GetApp().AddWindow(questionDialog); questionDialog.ShowAll(); }
private async Task AuthenticateUser() { var email = emailBox.Text; var pass = passwordBox.Text; var loginBody = new JObject(); loginBody["email"] = email; loginBody["password"] = pass; var response = await DepartmentApp.PostRequest("/api/auth/login", loginBody); if (response == null) { return; } DepartmentApp.SetJwt(response["auth_token"].ToString()); DepartmentApp.SetEmail(response["email"].ToString()); var mainWindow = new MainWindow(); DepartmentApp.GetApp().AddWindow(mainWindow); mainWindow.ShowAll(); DepartmentApp.GetApp().RemoveWindow(this); this.Hide(); }
private void RegisterButton_Clicked(object sender, EventArgs a) { var registerWindow = new RegisterWindow(); DepartmentApp.GetApp().AddWindow(registerWindow); registerWindow.ShowAll(); DepartmentApp.GetApp().RemoveWindow(this); this.Hide(); }
private void LoginButton_Clicked(object sender, EventArgs a) { var loginWindow = new LoginWindow(); DepartmentApp.GetApp().AddWindow(loginWindow); loginWindow.ShowAll(); DepartmentApp.GetApp().RemoveWindow(this); this.Hide(); }
private async Task AutheticateSolver() { var email = emailBox.Text; var name = nameBox.Text; var pass = passBox.Text; var conf = confBox.Text; var registerBody = new JObject(); registerBody["email"] = email; registerBody["username"] = name; registerBody["password"] = pass; registerBody["passwordConf"] = conf; registerBody["role"] = "solver"; var response = await DepartmentApp.PostRequest("/api/users/", registerBody); if (response == null) { return; } var loginBody = new JObject(); loginBody["email"] = email; loginBody["password"] = pass; var loginResponse = await DepartmentApp.PostRequest("/api/auth/login", loginBody); if (loginResponse == null) { return; } DepartmentApp.SetJwt(loginResponse["auth_token"].ToString()); DepartmentApp.SetEmail(loginResponse["email"].ToString()); var mainWindow = new MainWindow(); DepartmentApp.GetApp().AddWindow(mainWindow); mainWindow.ShowAll(); DepartmentApp.GetApp().RemoveWindow(this); this.Hide(); }
public static void Main(string[] args) { DotNetEnv.Env.Load(); Application.Init(); var app = new Application(null, GLib.ApplicationFlags.None); app.Register(GLib.Cancellable.Current); DepartmentApp.Init(app); var win = new LoginWindow(); app.AddWindow(win); win.Show(); Application.Run(); }
private async Task sendAnswer() { var endpoint = $"/api/solver/{question.issueID}/questions/{question.ID}"; var answer = answerBox.Buffer.Text; var requestBody = new JObject(); requestBody["answer"] = answer; var response = await DepartmentApp.PutRequest(endpoint, requestBody); if (response["statusCode"].ToString() != "OK") { return; } row.Hide(); mainWindow.questionsList.Remove(row); mainWindow.SaveData(); mainWindow.questions.Remove(question.Text); this.Hide(); DepartmentApp.GetApp().RemoveWindow(this); }
private void CloseButton_Clicked(object sender, EventArgs args) { this.Hide(); DepartmentApp.GetApp().RemoveWindow(this); }
private void Window_DeleteEvent(object sender, DeleteEventArgs args) { DepartmentApp.GetApp().RemoveWindow(this); }