Пример #1
0
        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();
        }
Пример #2
0
        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();

        }
Пример #3
0
 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;
 }