Example #1
0
        private void InsertRecord()
        {
            Todo todo = new Todo();

            GetDataPropertyValues(todo);
            _dataContext.Todo.InsertOnSubmit(todo);
            _dataContext.SubmitChanges();
            Items.Add(todo);
            Item = todo;
        }
Example #2
0
 public static void Import(string filename)
 {
     IEnumerable<Todo> todos = GetImportTodos(filename);
     //TODO 全体的に、変数定義をvarで行うべき
     using (TodoDataClassesDataContext d = new  TodoDataClassesDataContext())
     {
         foreach (Todo x in todos) d.Todo.InsertOnSubmit(x);
         d.SubmitChanges();
     }
 }
Example #3
0
        static public void Import(string filename)
        {
            IEnumerable <Todo> todos = GetImportTodos(filename);

            //TODO 全体的に、変数定義をvarで行うべき
            using (TodoDataClassesDataContext d = new  TodoDataClassesDataContext())
            {
                foreach (Todo x in todos)
                {
                    d.Todo.InsertOnSubmit(x);
                }
                d.SubmitChanges();
            }
        }