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); } }
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); } }
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); } }
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); } }