예제 #1
0
        private void InitTask()
        {
            int taskId = -1;
            int.TryParse(NavigationContext.QueryString["TaskId"], out taskId);

            Debug.Assert(taskId != -1, "TaskId should not be null");

            task = SterlingService.Current.Database.Query<Task, int>()
                    .Where(delegate(TableKey<Task, int> key) { return key.Key == taskId; })
                    .First<TableKey<Task, int>>()
                    .LazyValue.Value;

            LocationPicker.Visibility = (task.Latitude != 0 && task.Longitude!= 0) ? Visibility.Visible : Visibility.Collapsed;

            Debug.Assert(task != null, "Task should not be null");
        }
예제 #2
0
        private void InitTask()
        {
            if (task != null) return;

            if (!NavigationContext.QueryString.ContainsKey("TaskId"))
            {
                task = new Task();
                int categoryId = 0;
                int.TryParse(NavigationContext.QueryString["CategoryId"], out categoryId);

                task.CategoryId = categoryId;

                if (NavigationContext.QueryString.ContainsKey("ProjectId"))
                {
                    int projectId;
                    int.TryParse(NavigationContext.QueryString["ProjectId"], out projectId);
                    task.ProjectId = projectId;
                }
            }
            else
            {
                int taskId;
                int.TryParse(NavigationContext.QueryString["TaskId"], out taskId);

                task = SterlingService.Current.Database.Query<Task, int>()
                        .Where(delegate(TableKey<Task, int> key) { return key.Key == taskId; })
                        .First<TableKey<Task, int>>()
                        .LazyValue.Value;

                Debug.Assert(task != null, "Task should not be null");
            }
        }
예제 #3
0
 private void ShowTaskDetails(Task task)
 {
     AppModel.TaskDoneNextPage = new Uri("/Views/AllTasks.xaml", UriKind.Relative);
     NavigationService.Navigate(new Uri("/Views/ViewTask.xaml?TaskId=" + task.Id, UriKind.Relative));
 }
예제 #4
0
 private void CancelButton_Click(object sender, EventArgs e)
 {
     task = null;
     this.NavigateToNextPage();
 }
예제 #5
0
 private void ShowTaskDetails(Task task)
 {
     NavigationService.Navigate(new Uri("/Views/ViewTask.xaml?TaskId=" + task.Id, UriKind.Relative));
 }