public void updateReglement(Reglement reg) { db.Reglement.Attach(db.Reglement.Single(x => x.id == reg.id)); db.Entry(db.Reglement.Single(x => x.id == reg.id)).CurrentValues.SetValues(reg); //db.piece.ApplyCurrentValues(Cab); db.SaveChanges(); }
public void updateAvoir(Avoir avoir) { db.Avoir.Attach(db.Avoir.Single(x => x.id == avoir.id)); db.Entry(db.Avoir.Single(x => x.id == avoir.id)).CurrentValues.SetValues(avoir); //db.piece.ApplyCurrentValues(Cab); db.SaveChanges(); }
public String modifierStock(Livre Cab) { String resultat = "OK"; using (NewCampusEntities db = new NewCampusEntities()) { if (this.testModifierStock(Cab) == false) { try { db.Livre.Attach(db.Livre.Single(x => x.Rang == Cab.Rang)); db.Entry(db.Livre.Single(x => x.Rang == Cab.Rang)).CurrentValues.SetValues(Cab); //db.piece.ApplyCurrentValues(Cab); db.SaveChanges(); } catch (Exception e) { resultat = e.Message; } } else { resultat = "piece inexistante"; } } return(resultat); }
public void updateart(Livre art) { db.Livre.Attach(db.Livre.Single(x => x.Rang == art.Rang)); db.Entry(db.Livre.Single(x => x.Rang == art.Rang)).CurrentValues.SetValues(art); db.SaveChanges(); }
public void updatesoc(societe soc) { db.societe.Attach(db.societe.Single(x => x.id == soc.id)); db.Entry(db.societe.Single(x => x.id == soc.id)).CurrentValues.SetValues(soc); //db.piece.ApplyCurrentValues(Cab); db.SaveChanges(); }
public void modifier(devis bl) { using (NewCampusEntities db = new NewCampusEntities()) { db.devis.Attach(db.devis.Single(x => x.id == bl.id)); db.Entry(db.devis.Single(x => x.id == bl.id)).CurrentValues.SetValues(bl); //db.piece.ApplyCurrentValues(Cab); db.SaveChanges(); } }
public void updatefact(facturevente fact) { using (NewCampusEntities db = new NewCampusEntities()) { db.facturevente.Attach(db.facturevente.Single(x => x.id == fact.id)); db.Entry(db.facturevente.Single(x => x.id == fact.id)).CurrentValues.SetValues(fact); //db.piece.ApplyCurrentValues(Cab); db.SaveChanges(); } }
public string updatereservation(reservation rsv) { using (NewCampusEntities db = new NewCampusEntities()) { db.reservation.Attach(db.reservation.Single(x => x.id == rsv.id)); db.Entry(db.reservation.Single(x => x.id == rsv.id)).CurrentValues.SetValues(rsv); db.SaveChanges(); } return(rsv.article); }
public void modifierLBC(ligne_bc lignebc) { using (NewCampusEntities db = new NewCampusEntities()) { db.ligne_bc.Attach(db.ligne_bc.Single(x => x.id == lignebc.id)); db.Entry(db.ligne_bc.Single(x => x.id == lignebc.id)).CurrentValues.SetValues(lignebc); db.SaveChanges(); } }
public void modifierBC(bon_commande bc) { using (NewCampusEntities db = new NewCampusEntities()) { db.bon_commande.Attach(db.bon_commande.Single(x => x.id == bc.id)); db.Entry(db.bon_commande.Single(x => x.id == bc.id)).CurrentValues.SetValues(bc); db.SaveChanges(); } }
public void updatebank(Banque bank) { db.Banque.Attach(db.Banque.Single(x => x.idbanque == bank.idbanque)); db.Entry(db.Banque.Single(x => x.idbanque == bank.idbanque)).CurrentValues.SetValues(bank); db.SaveChanges(); //var sql = @"Update Banque SET nombanque = @nombanque ,rib=@rib,soldeinitial=@soldeinitial WHERE idbanque = @idbanque"; //db.Database.ExecuteSqlCommand( // sql, // new SqlParameter("@nombanque", bank.nombanque), // new SqlParameter("@rib", bank.rib), // new SqlParameter("@soldeinitial", bank.soldeinitial), // new SqlParameter("@idbanque", bank.idbanque)); }
public void updateagent(agent ag) { db.agent.Attach(db.agent.Single(x => x.idagent == ag.idagent)); db.Entry(db.agent.Single(x => x.idagent == ag.idagent)).CurrentValues.SetValues(ag); db.SaveChanges(); }
public void updateDroit(Droit dr) { db.Droit.Attach(db.Droit.Single(x => x.code == dr.code)); db.Entry(db.Droit.Single(x => x.code == dr.code)).CurrentValues.SetValues(dr); db.SaveChanges(); }
public void updatefichesuivi(fichesuivi fs) { db.fichesuivi.Attach(db.fichesuivi.Single(x => x.idfiche == fs.idfiche)); db.Entry(db.fichesuivi.Single(x => x.idfiche == fs.idfiche)).CurrentValues.SetValues(fs); db.SaveChanges(); }