Exemplo n.º 1
0
 public virtual void SetWashAsFinished(Guid WashID)
 {
     using (var context = new CarWashContext())
     {
         Statistic stats = context.Statistics.Find(WashID);
         stats.Running  = false;
         stats.Finished = true;
         context.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public virtual void CreateStatistics(string washProgram)
 {
     using (var context = new CarWashContext())
     {
         Statistic stats = new Statistic {
             MachineID = this.MachineID, Program = washProgram, Running = true, Cancelled = false, Finished = false
         };
         context.Statistics.Add(stats);
         context.SaveChanges();
         this.washID = stats.Id;
     }
 }
Exemplo n.º 3
0
 public virtual void SetWashAsCancelled(Guid WashID)
 {
     if (this.WashProgram.Running)
     {
         using (var context = new CarWashContext())
         {
             Statistic stats = context.Statistics.Find(WashID);
             stats.Running   = false;
             stats.Cancelled = true;
             context.SaveChanges();
         }
     }
 }