public bool EliminarUsuario() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.USUARIO user = ctx.USUARIO.First(u => u.ID_USUARIO == IdUsuario); ctx.Entry(user).State = System.Data.EntityState.Deleted; ctx.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool EliminarSucursal() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.SUCURSALES suc = ctx.SUCURSALES.First(o => o.ID_SUCURSAL == IdSucursal); ctx.Entry(suc).State = System.Data.EntityState.Deleted; 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); } }
public bool EliminarOferta() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.OFERTA of = ctx.OFERTA.First(o => o.ID_OFERTA == IdOferta); ctx.Entry(of).State = System.Data.EntityState.Deleted; ctx.SaveChanges(); ctx = null; return(true); } catch (Exception) { return(false); } }
public bool EliminarCategoria() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.CATEGORIA_OFERTA cat = ctx.CATEGORIA_OFERTA.First(d => d.ID_CATEGORIA_OFERTA == IdCategoria); ctx.Entry(cat).State = System.Data.EntityState.Deleted; ctx.SaveChanges(); ctx = null; return(true); } catch (Exception) { return(false); } }
//probar metodo public bool EliminarDescuento() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.DESCUENTO des = ctx.DESCUENTO.First(d => d.ID_DESCUENTO == IdDescuento); ctx.Entry(des).State = System.Data.EntityState.Deleted; ctx.SaveChanges(); ctx = null; return(true); } catch (Exception) { return(false); } }
public bool EliminarProducto() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.PRODUCTO prod = ctx.PRODUCTO.First(p => p.ID_PRODUCTO == IdProducto); ctx.Entry(prod).State = System.Data.EntityState.Deleted; ctx.SaveChanges(); ctx = null; return(true); } catch (Exception) { throw; } }
public bool EliminarPerfil() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.PERFIL per = ctx.PERFIL.First(d => d.ID_PERFIL == IdPerfil); ctx.Entry(per).State = System.Data.EntityState.Deleted; ctx.SaveChanges(); ctx = null; return(true); } catch (Exception) { return(false); } }
//OK public bool EliminarRubro() { try { DALC.QueOfrecesEntities ctx = new DALC.QueOfrecesEntities(); DALC.RUBRO ru = ctx.RUBRO.First(r => r.TIPO == TipoRubro); ctx.Entry(ru).State = System.Data.EntityState.Deleted; ctx.SaveChanges(); ctx = null; return(true); } catch (Exception) { return(false); } }