private void button1_Click(object sender, EventArgs e) { try { User user = ToDoAPI.Register(usernameInput.Text, passwordInput.Text); } catch (Exception errors) { label3.Text = errors.Message; Console.WriteLine(errors.Message); } }
private void TaskListView_Load(object sender, EventArgs e) { var tasks = ToDoAPI.GetTasks(); foreach (var task in tasks) { var taskView = new TaskViewModel(task); taskView.TaskDelete += OnTaskDelete; flowLayoutPanel1.Controls.Add(taskView.taskControl); } }
public void ReLoad() { var oldScrollPosition = flowLayoutPanel1.VerticalScroll.Value; var tasks = ToDoAPI.GetTasks(); flowLayoutPanel1.Controls.Clear(); foreach (var task in tasks) { var taskView = new TaskViewModel(task); taskView.TaskDelete += OnTaskDelete; flowLayoutPanel1.Controls.Add(taskView.taskControl); } flowLayoutPanel1.VerticalScroll.Value = oldScrollPosition; }
private void loginBtn_Click(object sender, EventArgs e) { errorLabel.Text = ""; User user = ToDoAPI.Login(usernameInput.Text, passwordInput.Text); if (user.access_token != null && user.message == null) { Program.currentUser = user; //Close(); var taskView = new TaskListView(); taskView.Show(); } else { errorLabel.Text = user.message; } }