private void PopulateList() { List <ToDoItem> todos = ToDoItemData.GetToDoItems(); TODOs.DataSource = todos; TODOs.DataBind(); }
private void PopulateCategories() { List <string> categories = ToDoItemData.GetCategories(); Category.DataSource = categories; Category.DataBind(); }
protected void TODOs_ItemCommand(object source, RepeaterCommandEventArgs e) { int index = int.Parse((string)e.CommandArgument); List <ToDoItem> todos = ToDoItemData.GetToDoItems(); todos[index].Done = true; PopulateList(); }
protected void Submit_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(Description.Text)) { ErrorMessage.Visible = false; ToDoItemData.AddItem(Description.Text, Category.SelectedValue); PopulateList(); Description.Text = string.Empty; } else { ErrorMessage.Visible = true; } }