示例#1
0
        /// <summary>
        /// this function prepares the selected task for editing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditBtn_Tapped(object sender, TappedRoutedEventArgs e)
        {
            Button btn = (Button)sender;
            int id = (int)btn.Tag;

            placeholder = tList.Where(x => x.id == id).First();

            FinalEdit.Visibility = Windows.UI.Xaml.Visibility.Visible;
            TaskBtn.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

            NewDate.Date = placeholder.dateTime.Date;
            NewTime.Time = placeholder.dateTime.TimeOfDay;

            NewProject.Text = placeholder.project;
            NewDescription.Text = placeholder.description;
        }
示例#2
0
 private Task prepareTask(Task task)
 {
     task.description = NewDescription.Text;
     task.project = NewProject.Text;
     string dateTime = NewDate.Date.ToString("yyyy-MM-dd");
     string time = NewTime.Time.ToString();
     task.duedate = dateTime + "T" + time;
     Logger.log(dateTime + "T" + time);
     return task;
 }
示例#3
0
        private void TaskBtn_Tapped(object sender, TappedRoutedEventArgs e)
        {
            Task task = new Task();
            task.completed = false;

            if(!NewDescription.Equals("") && !NewProject.Equals("")){
                task = prepareTask(task);
                api.Post(task);
            }
        }
示例#4
0
        /// <summary>
        /// here we send the edited task to the server
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FinalEdit_Tapped(object sender, TappedRoutedEventArgs e)
        {
            placeholder = prepareTask(placeholder);
            api.Put(placeholder);

            NewProject.Text = "";
            NewDescription.Text = "";

            FinalEdit.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            TaskBtn.Visibility = Windows.UI.Xaml.Visibility.Visible;
        }