Example #1
0
 private void ComboProzentErledigt_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         ComboBox   combo      = (ComboBox)sender;
         ToDos4Grid toDos4Grid = (ToDos4Grid)((GridExtended)combo.Parent).DataObject;
         this.core.SaveToDo(null, toDos4Grid.Cosplan_Nr, ((ComboBoxItem)combo.SelectedItem).Content.ToString().Replace("%", "").ToInt(), null, null, toDos4Grid.Nummer);
     }
     catch (NullReferenceException)
     { /* combo.Parent is null, if window isn't loaded yet */ }
 }
Example #2
0
        private void ChkErledigt_CheckedChanged(object sender, EventArgs e)
        {
            BaseCheckBox chk        = (BaseCheckBox)sender;
            ToDos4Grid   toDos4Grid = (ToDos4Grid)((GridExtended)chk.Parent).DataObject;

            if (chk.IsChecked)
            {
                this.core.SaveToDo(null, toDos4Grid.Cosplan_Nr, 100, null, null, toDos4Grid.Nummer);
            }
            else
            {
                this.core.SaveToDo(null, toDos4Grid.Cosplan_Nr, 0, null, null, toDos4Grid.Nummer);
            }
        }
Example #3
0
        private void Grid_EditCompleted(object sender, EventArgs e)
        {
            GridExtended grid = ((GridExtended)sender);

            if (grid.Edit)
            {
                string  bezeichnung = grid.FindVisualChildren <TextBox>().ElementAt(0).Text;
                int     erledigt    = 0;
                decimal kosten      = 0;
                Time    zeit        = null;

                ToDos4Grid toDos4Grid = (ToDos4Grid)grid.DataObject;
                if (this.core.GetKategorie(toDos4Grid.Kategorie_Nr) == "Kaufen")
                {
                    kosten = grid.FindVisualChildren <TextBox>().ElementAt(1).Text.Replace(" €", "").ToDecimal();
                }
                else if (this.core.GetKategorie(toDos4Grid.Kategorie_Nr) == "Machen")
                {
                    zeit = new Time(grid.FindVisualChildren <TextBox>().ElementAt(1).Text);
                }

                this.core.SaveToDo(bezeichnung, toDos4Grid.Cosplan_Nr, erledigt, kosten, zeit, toDos4Grid.Nummer);
            }
        }