public bool borrarHuesped() { try { DALC.HUESPED huesped = CommonBC.Modelo.HUESPED.FirstOrDefault(us => us.RUT == this.Rut); CommonBC.Modelo.HUESPED.Remove(huesped); CommonBC.Modelo.SaveChanges(); return(true); } catch (Exception ex) { Logger.Log(ex.Message); return(false); } }
public bool actualizarHuesped() { try { DALC.HUESPED huesped = CommonBC.Modelo.HUESPED.FirstOrDefault(us => us.RUT == this.Rut); huesped.NOMBRE = this.Nombre; huesped.APELLIDO = this.Apellido; huesped.TELEFONO = this.Telefono; huesped.EMPRESA_RUT = this.EmpresaRut; CommonBC.Modelo.SaveChanges(); return(true); } catch (Exception ex) { Logger.Log(ex.Message); return(false); } }
public bool agregarHuesped() { try { DALC.HUESPED hues = new DALC.HUESPED(); hues.RUT = this.Rut; hues.NOMBRE = this.Nombre; hues.APELLIDO = this.Apellido; hues.TELEFONO = this.Telefono; hues.EMPRESA_RUT = this.EmpresaRut; CommonBC.Modelo.HUESPED.Add(hues); CommonBC.Modelo.SaveChanges(); return(true); } catch (Exception ex) { Logger.Log(ex.Message); return(false); } }