Ejemplo n.º 1
0
 public bool Read()
 {
     datos.Onbreak2Entities bbdd = new datos.Onbreak2Entities();
     try
     {
         datos.CoffeeBreak cb = bbdd.CoffeeBreak.First(c => c.Numero == Numero);
         CommonBC.Syncronize(cb, this);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
 public bool Delete()
 {
     datos.Onbreak2Entities bbdd = new datos.Onbreak2Entities();
     try
     {
         datos.CoffeeBreak cb = bbdd.CoffeeBreak.First(c => c.Numero == Numero);
         bbdd.CoffeeBreak.Remove(cb);
         bbdd.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 public bool Update()
 {
     datos.Onbreak2Entities bbdd = new datos.Onbreak2Entities();
     try
     {
         datos.CoffeeBreak cb = bbdd.CoffeeBreak.First(c => c.Numero == Numero);
         CommonBC.Syncronize(this, cb);
         bbdd.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Ejemplo n.º 4
0
 public bool Create()
 {
     datos.Onbreak2Entities bbdd = new datos.Onbreak2Entities();
     datos.CoffeeBreak      cb   = new datos.CoffeeBreak();
     try
     {
         CommonBC.Syncronize(this, cb);
         bbdd.CoffeeBreak.Add(cb);
         bbdd.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         bbdd.CoffeeBreak.Remove(cb);
         return(false);
     }
 }