public bool Delete() { datos.Onbreak2Entities bbdd = new datos.Onbreak2Entities(); try { datos.Contrato cont = bbdd.Contrato.First(c => c.Numero == Numero); bbdd.Contrato.Remove(cont); bbdd.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public bool Update() { datos.Onbreak2Entities bbdd = new datos.Onbreak2Entities(); try { datos.Contrato cont = bbdd.Contrato.First(c => c.Numero == Numero); CommonBC.Syncronize(this, cont); bbdd.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public bool Read() { datos.Onbreak2Entities bbdd = new datos.Onbreak2Entities(); try { datos.Contrato cont = bbdd.Contrato.First(c => c.Numero == Numero); CommonBC.Syncronize(cont, this); leerDescripcionTipoEvento(); leerDescripcionModalidad(); return(true); } catch (Exception ex) { return(false); } }
public bool Create() { datos.Onbreak2Entities bbdd = new datos.Onbreak2Entities(); datos.Contrato cont = new datos.Contrato(); try { CommonBC.Syncronize(this, cont); bbdd.Contrato.Add(cont); bbdd.SaveChanges(); return(true); } catch (Exception ex) { bbdd.Contrato.Remove(cont); return(false); } }