示例#1
0
 private void Name_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.DateSumNameOrderByDirection = SQLiteClass.toggleDirection(SQLiteClass.DateSumNameOrderByDirection);
     SQLiteClass.DateSumSetOrderBy("name", SQLiteClass.DateSumNameOrderByDirection);
     ExecuteFirstSelectTableTaskTime(DateCalc.StringToDate(textboxDateSum.Text, System.Globalization.CultureInfo.CurrentCulture));
 }
示例#2
0
        private void ButtonNewWindowOk_Click(object sender, RoutedEventArgs e)
        {
            Int64 retId;

            NewWindowOk.IsEnabled = false;

            // template description update check
            var selectedTemplate = (ListTemplate)templateBox.SelectedItem;

            if ((selectedTemplate.Id > 0) &&
                (!string.IsNullOrEmpty(NewDescriptionBox.Text)) &&
                (!string.IsNullOrEmpty(selectedTemplate.Template)))
            {
                var result = MessageBox.Show(Properties.Resources.WH_AlreadyExists, "taskalu",
                                             MessageBoxButton.YesNo, MessageBoxImage.Warning);
                if (result == MessageBoxResult.No)
                {
                    NewWindowOk.IsEnabled = true;
                    return;
                }
            }

            DateTime due     = (DateTime)dateBox.SelectedDate;
            DateTime dueDate = new DateTime(due.Year, due.Month, due.Day, hourBox.SelectedIndex, (minuteBox.SelectedIndex * 5), 0);

            if (TimeZoneInfo.Local.IsInvalidTime(dueDate))
            {
                MessageBox.Show(Properties.Resources.MW_InvalidDate);
            }
            else
            {
                ListViewFile lvFile = new ListViewFile()
                {
                    Name        = NewTitleBox.Text,
                    Description = NewDescriptionBox.Text,
                    Memo        = "",
                    Priority    = priorityBox.Text,
                    DueDate     = TimeZoneInfo.ConvertTimeToUtc(dueDate).ToString("yyyy-MM-dd HH:mm:ss"),
                    Status      = "Active",
                    WorkHolder  = WorkHolder.CreateWorkHolder(NewTitleBox.Text)
                };
                if (!string.IsNullOrEmpty(selectedTemplate.Template))
                {
                    lvFile.Description = selectedTemplate.Template;
                }
                retId = SQLiteClass.ExecuteInsertTable(SQLiteClass.dbpath, lvFile);
                SQLiteClass.ExecuteInsertTableFTSString(SQLiteClass.dbpath, retId, "tasklist_name", Ngram.getNgramText(NewTitleBox.Text, 2));
                SQLiteClass.ExecuteInsertTableFTSString(SQLiteClass.dbpath, retId, "tasklist_description", Ngram.getNgramText(NewDescriptionBox.Text, 2));

                // copy template path
                if (selectedTemplate.Id > 0)
                {
                    string workHolder = WorkHolder.CreateWorkHolder(NewTitleBox.Text);
                    WorkHolder.CopyTemplatePathToWorkFolder(SQLiteClass.dbpath, selectedTemplate.Id, workHolder);
                }

                // Dialog box accepted; ウィンドウを閉じる
                this.DialogResult = true;
            }
            NewWindowOk.IsEnabled = true;
        }
示例#3
0
 private void DurationDes_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.DateSumNameOrderByDirection = "DESC";
     SQLiteClass.DateSumSetOrderBy("duration", "DESC");
     ExecuteFirstSelectTableTaskTime(DateCalc.StringToDate(textboxDateSum.Text, System.Globalization.CultureInfo.CurrentCulture));
 }
示例#4
0
 private void DueDate_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.duedateOrderByDirection = SQLiteClass.toggleDirection(SQLiteClass.duedateOrderByDirection);
     SQLiteClass.SetOrderBy("duedate", SQLiteClass.duedateOrderByDirection);
     ExecuteFirstSelectTable();
 }
示例#5
0
 private void DueDateDes_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.duedateOrderByDirection = "DESC";
     SQLiteClass.SetOrderBy("duedate", "DESC");
     ExecuteFirstSelectTable();
 }
示例#6
0
 private void MemoDes_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.memoOrderByDirection = "DESC";
     SQLiteClass.SetOrderBy("memo", "DESC");
     ExecuteFirstSelectTable();
 }
示例#7
0
 private void Memo_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.memoOrderByDirection = SQLiteClass.toggleDirection(SQLiteClass.memoOrderByDirection);
     SQLiteClass.SetOrderBy("memo", SQLiteClass.memoOrderByDirection);
     ExecuteFirstSelectTable();
 }
示例#8
0
 private void NameAsc_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.nameOrderByDirection = "ASC";
     SQLiteClass.SetOrderBy("name", "ASC");
     ExecuteFirstSelectTable();
 }
示例#9
0
 private void PriorityDes_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.priorityOrderByDirection = "DESC";
     SQLiteClass.SetOrderBy("priority", "DESC");
     ExecuteFirstSelectTable();
 }
示例#10
0
 // ASC/DESC
 private void Priority_Click(object sender, RoutedEventArgs e)
 {
     SQLiteClass.priorityOrderByDirection = SQLiteClass.toggleDirection(SQLiteClass.priorityOrderByDirection);
     SQLiteClass.SetOrderBy("priority", SQLiteClass.priorityOrderByDirection);
     ExecuteFirstSelectTable();
 }