public void addcumul(CumulEnt cment, List <Piece_cumulent> listcumul) { db.CumulEnt.Add(cment); foreach (Piece_cumulent cumul_piece in listcumul) { db.Piece_cumulent.Add(cumul_piece); } db.SaveChanges(); }
public void addbonret(BonRetour br, List <Piece_bonret> listbr) { db.BonRetour.Add(br); foreach (Piece_bonret piec_br in listbr) { db.Piece_bonret.Add(piec_br); } db.SaveChanges(); }
public bool addfamille(famille famil) { bool check = false; check = checklist(famil.familledesign); if (check == false) { db.famille.Add(famil); db.SaveChanges(); return(true); } else { return(false); } }
public String ajouterBS(bon_sortie lBl) { String resultat = "Ok"; using (NewCampusEntities db = new NewCampusEntities()) { if (this.testAjouterBS(lBl) == false) { try { db.bon_sortie.Add(lBl); db.SaveChanges(); } catch (Exception e) { resultat = e.Message; } } else { resultat = "LF existante "; } } return(resultat); }
public bool addspeciality(specialite sp) { bool check = false; check = checklist(sp.designation); if (check == false) { db.specialite.Add(sp); db.SaveChanges(); return(true); } else { return(false); } }
public string supprimerLDevis(List <ligne_devis> listp) { String resultat = "OK"; foreach (ligne_devis aX in listp) { using (NewCampusEntities db = new NewCampusEntities()) { try { if (aX.id > 0) { ligne_devis artX = db.ligne_devis.Single(a => a.id == aX.id); db.ligne_devis.Remove(artX); db.SaveChanges(); } } catch (Exception) { resultat = resultat + "," + aX.id_devis; db.Dispose(); } } } return(resultat); }
public string supprimerLF(List <piece_fact> listp) { String resultat = "OK"; foreach (piece_fact aX in listp) { using (NewCampusEntities db = new NewCampusEntities()) { try { if (aX.id_piece > 0) { piece_fact artX = db.piece_fact.Single(a => a.id_piece == aX.id_piece); db.piece_fact.Remove(artX); db.SaveChanges(); } } catch (Exception) { //resultat = resultat + "," + aX.id_commande; db.Dispose(); } } } return(resultat); }
public String ajouterDevis(devis Bl) { String resultat = "Ok"; using (NewCampusEntities db = new NewCampusEntities()) { if (this.testAjouterDevis(Bl) == false) { try { db.devis.Add(Bl); db.SaveChanges(); } catch (Exception e) { resultat = e.Message; } } else { resultat = "Devis existante, verifiez le champs num devis "; } } return(resultat); }
public bool addemp(emplacement emp) { bool check = false; check = checklist(emp.empdesign); if (check == false) { db.emplacement.Add(emp); db.SaveChanges(); return(true); } else { return(false); } }
public String ajouterLBL(ligne_bl lBl) { String resultat = "Ok"; using (NewCampusEntities db = new NewCampusEntities()) { if (this.testAjouterLBl(lBl) == false) { try { db.ligne_bl.Add(lBl); db.SaveChanges(); } catch (Exception e) { resultat = e.Message; } } else { resultat = "LBL existante, verifiez le champs num Bl "; } } return(resultat); }
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 String ajouterBL(bon_livraison Bl) { String resultat = "Ok"; using (NewCampusEntities db = new NewCampusEntities()) { if (this.testAjouterBl(Bl) == false) { try { db.bon_livraison.Add(Bl); db.SaveChanges(); } catch (Exception e) { resultat = e.Message; } } else { resultat = "BL existante, verifiez le champs num Bl "; } } return(resultat); }
public void deletereservation(reservation reservat) { using (NewCampusEntities db = new NewCampusEntities()) { db.reservation.Remove(reservat); db.SaveChanges(); } }
public void addReservation(reservation reservat) { using (NewCampusEntities db = new NewCampusEntities()) { db.reservation.Add(reservat); db.SaveChanges(); } }
public void annulerreservblivcmdstay(string codearticle, double quantit) { NewCampusEntities db = new NewCampusEntities(); Livre art = db.Livre.Where(aa => aa.codeart == codearticle).Single(); art.quantitenstock = art.quantitenstock + quantit; db.SaveChanges(); }
public void livrer(string codearticle, double quantit) { NewCampusEntities db = new NewCampusEntities(); Livre art = db.Livre.Where(aa => aa.codeart == codearticle).Single(); art.quantitenstock = art.quantitenstock - quantit; 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 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 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 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 deletelbl(int numbl) { using (NewCampusEntities db = new NewCampusEntities()) { List <ligne_bl> lbls = db.ligne_bl.Where(a => a.id_bl == numbl).ToList(); foreach (ligne_bl lbl in lbls) { db.ligne_bl.Remove(lbl); } db.SaveChanges(); } }
public void deleteallreserv(int numcmd) { List <reservation> rsvs = new List <reservation>(); using (NewCampusEntities db = new NewCampusEntities()) { rsvs = db.reservation.Where(aa => aa.ncmd == numcmd).ToList(); foreach (reservation rsv in rsvs) { db.reservation.Remove(rsv); } db.SaveChanges(); } }
public void supprimerLbcbyone(ligne_bc listp) { using (NewCampusEntities db = new NewCampusEntities()) { try { ligne_bc artX = db.ligne_bc.Single(a => a.id == listp.id); db.ligne_bc.Remove(artX); db.SaveChanges(); } catch (Exception) { } } }
public String supprimerBL(bon_livraison bl) { String resultat = "BL supprimé"; using (NewCampusEntities db = new NewCampusEntities()) { try { db.bon_livraison.Attach(bl);// selectionne l'element dans la base pour le supprimer dans l'etape suivante db.bon_livraison.Remove(bl); db.SaveChanges(); } catch (Exception) { resultat = resultat + "," + bl.numero_bl; db.Dispose(); } } return(resultat); }
public String supprimerDevis(devis bl) { String resultat = "Devis supprimé"; using (NewCampusEntities db = new NewCampusEntities()) { try { db.devis.Attach(bl);// selectionne l'element dans la base pour le supprimer dans l'etape suivante db.devis.Remove(bl); db.SaveChanges(); } catch (Exception) { resultat = resultat + "," + bl.numero_devis; db.Dispose(); } } return(resultat); }
public String supprimerBS(bon_sortie f) { String resultat = "Bon sortie supprimé"; using (NewCampusEntities db = new NewCampusEntities()) { try { db.bon_sortie.Attach(f);// selectionne l'element dans la base pour le supprimer dans l'etape suivante db.bon_sortie.Remove(f); db.SaveChanges(); } catch (Exception) { resultat = resultat + "," + f.numero_bs; db.Dispose(); } } return(resultat); }
public void addagent(agent ag) { db.agent.Add(ag); db.SaveChanges(); }
public void addReglement(Reglement reg) { db.Reglement.Add(reg); db.SaveChanges(); }
public void addficheauteur(ficheauteur aut) { db.ficheauteur.Add(aut); db.SaveChanges(); }