public void GetTasks() { Tasks.Clear(); CLOM.List taskList = context.Web.Lists.GetByTitle("Tasks"); CLOM.CamlQuery query = new CLOM.CamlQuery(); taskListItems = taskList.GetItems(query); context.Load(taskListItems); context.ExecuteQueryAsync(onQuerySucceeded, onQueryFailed); }
private void button1_Click(object sender, RoutedEventArgs e) { CLOM.ClientContext context = new CLOM.ClientContext(CLOM.ApplicationContext.Current.Url); CLOM.List taskList = context.Web.Lists.GetByTitle("Tasks"); CLOM.ListItemCreationInformation itemCreateInfo = new CLOM.ListItemCreationInformation(); CLOM.ListItem newItem = taskList.AddItem(itemCreateInfo); newItem["Title"] = textBox1.Text; newItem["DueDate"] = calendar1.SelectedDate.Value.ToShortDateString(); newItem.Update(); context.ExecuteQueryAsync(ClientRequestSucceeded, ClientRequestFailed); }