コード例 #1
0
 private void ButtonStopClick(object sender, System.Windows.RoutedEventArgs e)
 {
     try
     {
         timerStopWatch.Stop();
         dispatcherTimer.Stop();
         MessageBoxResult messResuly = MessageBox.Show("Are you want to save data ?", "Time Tracker", MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (messResuly.Equals(MessageBoxResult.Yes))
         {
             var sqltoLinqDataContract = new sqltoLinqDataDataContext();
             TimeTrickTable AddTime = new TimeTrickTable
             {
                 //Autoinc = 1,
                 EntryDate = DateTime.Today,
                 ETime = TimeSpan.Parse(this.TextBlockTimer.Text)
             };
             sqltoLinqDataContract.TimeTrickTables.InsertOnSubmit(AddTime);
             sqltoLinqDataContract.SubmitChanges();
         }
     }
     catch(Exception error)
     {
          MessageBox.Show(error.Message, "Time Tracker", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
コード例 #2
0
 partial void DeleteTimeTrickTable(TimeTrickTable instance);
コード例 #3
0
 partial void UpdateTimeTrickTable(TimeTrickTable instance);
コード例 #4
0
 partial void InsertTimeTrickTable(TimeTrickTable instance);