Esempio n. 1
0
 public int PutCloseTabRepairs(int id)
 {
     try
     {
         EFTabRepairs ef_trep = new EFTabRepairs(new EFDbContext());
         TabRepairs   value   = ef_trep.Context.Where(r => r.idRepair == id).FirstOrDefault();
         value.DateTimeEndRepair = DateTime.Now;
         ef_trep.Update(value);
         return(ef_trep.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }
Esempio n. 2
0
 public int PutOpenTabRepairs(int id)
 {
     try
     {
         EFTabRepairs ef_trep = new EFTabRepairs(new EFDbContext());
         TabRepairs   value   = new TabRepairs()
         {
             idRepair            = 0,
             IDNumLoko           = id,
             DateTimeStartRepair = DateTime.Now,
             DateTimeEndRepair   = null
         };
         ef_trep.Add(value);
         return(ef_trep.Save());
     }
     catch (Exception e)
     {
         return(-1);
     }
 }