示例#1
0
        protected void CreateToDo_OnClick(object sender, EventArgs e)
        {
            DataClasses1DataContext db = new DataClasses1DataContext();

            todo CurrentToDo = new todo
            {
                dt   = DateTime.Now,
                name = ToDoName.Text
            };

            db.todos.InsertOnSubmit(CurrentToDo);
            db.SubmitChanges();
            PopulateList();
        }
示例#2
0
        protected void ToDoListBoxes_OnSelectedIndexChange(object sender, EventArgs e)
        {
            for (int i = 0; i < ToDoListBoxes.Items.Count; i++)
            {
                if (ToDoListBoxes.Items[i].Selected)
                {
                    DataClasses1DataContext db = new DataClasses1DataContext();

                    todo SelectedItem = db.todos.Where(p =>
                                                       p.todoID == Convert.ToInt32(ToDoListBoxes.Items[i].Value)).FirstOrDefault();

                    db.todos.DeleteOnSubmit(SelectedItem);
                    db.SubmitChanges();
                    PopulateList();
                }
            }
        }
示例#3
0
 partial void Deletetodo(todo instance);
示例#4
0
 partial void Updatetodo(todo instance);
示例#5
0
 partial void Inserttodo(todo instance);