//probar metodo public bool ActualizarRetail() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.RETAIL ret = ctx.RETAIL.First(r => r.ID_RETAIL == IdRetail); ret.RUT = this.RutRetail; ret.NOMBRE = this.NombreRetail; ret.RAZON_SOCIAL = this.RazonSocial; ret.TELEFONO = this.Telefono; ret.EMAIL = this.Email; ret.DIRECCION = this.Direccion; ret.REGION_ID = this.IdRegion; ret.COMUNA_ID = this.IdComuna; ctx.SaveChanges(); ctx = null; return(true); } catch (Exception) { return(false); } }
//probar metodo public bool EliminarRetail() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.RETAIL ret = ctx.RETAIL.First(r => r.ID_RETAIL == IdRetail); ctx.Entry(ret).State = System.Data.EntityState.Deleted; ctx.SaveChanges(); ctx = null; return(true); } catch (Exception) { return(false); } }