Esempio n. 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();
        }
Esempio n. 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();
                }
            }
        }
Esempio n. 3
0
 partial void Deletetodo(todo instance);
Esempio n. 4
0
 partial void Updatetodo(todo instance);
Esempio n. 5
0
 partial void Inserttodo(todo instance);