public ligne_bc findlcmdbyartcmd(string codeart, int lcmd) { using (NewCampusEntities db = new NewCampusEntities()) { return(db.ligne_bc.Where(aa => aa.code_art == codeart && aa.id_bc == lcmd).FirstOrDefault()); } }
public List <bon_commande> getAllBbyetat(string etat) { using (NewCampusEntities db = new NewCampusEntities()) { return(db.bon_commande.Where(aa => aa.etat == etat).ToList()); } }
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 bon_commande getAllBcbycode(int numcmd) { using (NewCampusEntities db = new NewCampusEntities()) { return(db.bon_commande.Where(aa => aa.numero_bc == numcmd).FirstOrDefault()); } }
public List <reservation> getallreservbyarticle(string codeart) { using (NewCampusEntities db = new NewCampusEntities()) { return(db.reservation.Where(aa => aa.article == codeart).ToList()); } }
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 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 List <reservation> getallreservationbycmd(int numbc) { using (NewCampusEntities db = new NewCampusEntities()) { return(db.reservation.Where(aa => aa.ncmd == numbc).ToList()); } }
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 reservation getreserv(string codeart, int idcmd) { using (NewCampusEntities db = new NewCampusEntities()) { return(db.reservation.Where(aa => aa.article == codeart && aa.ncmd == idcmd).FirstOrDefault()); } }
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 List <facturevente> GetFactByetat(string etat) { using (NewCampusEntities db = new NewCampusEntities()) { return(db.facturevente.Where(aa => aa.etat == etat).ToList()); } }
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 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 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 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 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 List <piece_fact> rapportventearticle(Livre art, DateTime date1, DateTime date2) { List <piece_fact> lBlst = new List <piece_fact>(); using (NewCampusEntities db = new NewCampusEntities()) { return(db.spRapportArt(art.codeart, date1, date2).ToList()); } }
public List <Livre> getarticlestartby(string vartext) { List <Livre> arts = new List <Livre>(); using (NewCampusEntities db = new NewCampusEntities()) { return(db.spFindlistartstartby(vartext).ToList()); } }
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 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 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 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 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 List <piece_fact> getpiecefacts(int codeart) { List <piece_fact> pcfacts = new List <piece_fact>(); using (NewCampusEntities db = new NewCampusEntities()) { pcfacts = (from p in db.piece_fact where p.idauteur == codeart select p).ToList(); } return(pcfacts); }
public int checkavailab(string codearticle, double quantit) { NewCampusEntities db = new NewCampusEntities(); Livre art = db.Livre.Where(c => c.codeart == codearticle).First(); if (art.quantitenstock >= quantit) { return(1); } else { return(0); } }
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 Livre GetProdByQtRest(string code) { NewCampusEntities db = new NewCampusEntities(); Livre p = new Livre(); try { return(db.Livre.Where(aa => aa.codeart == code).FirstOrDefault()); } catch (Exception) { p = new Livre(); } return(p); }