Example #1
0
 private void StartBT_Click(object sender, EventArgs e)
 {
     IsTracking = true;
     if (CurrentTD == null)
     {
         CurrentTD = new TrackDetail()
         {
             Project = ProjectTB.Text.Trim(), Start = DateTime.Now, End = DateTime.Now, Task = TaskTB.Text.Trim()
         };
         using (var ctx = new TimeTrackerContext())
         {
             ctx.TrackDetails.Add(CurrentTD);
             ctx.SaveChanges();
         }
     }
 }
Example #2
0
 public Form1()
 {
     InitializeComponent();
     IsTracking = false;
     CurrentTD  = null;
 }