protected void BtnSave_Click(object sender, EventArgs e) { var todo = new Todo { Id = int.Parse(TxbTodoId.Text), Title = TxbTitle.Text, Description = TxbDescription.Text, IsDone = ChxIsDone.Checked, Box = DdlBox.SelectedValue }; _todoRepo.SaveOrUpdate(todo); FillTodoList(); }
protected void BtnAddNew_OnClick(object sender, EventArgs e) { var todo = new Todo { Title = TxbNewTodoTitle.Text, Box = "Today" }; _todoRepo.SaveOrUpdate(todo); FillTodoList(); LbxTodayTodos.SelectedValue = todo.Id.ToString(); FillDetailForm(todo); EnableDetailForm(); }
private void FillDetailForm(Todo todo) { TxbTodoId.Text = todo.Id.ToString(); TxbTitle.Text = todo.Title; TxbDescription.Text = todo.Description; ChxIsDone.Checked = todo.IsDone; DdlBox.SelectedValue = todo.Box; }