public static void insert_ArticoleDrepturi(int id_stud, int id_admin, DateTime data, int savoniera, int sapun, int spuma, int aparat, int caiete, int rigla, int guma, int crema, int maieu, int agrafe, int capse) { var bd = new DataLayer.Models.ProiectBDContext(); ArticoleDrepturi art = new ArticoleDrepturi { ID_Student = id_stud, ID_Administrator = id_admin, Data_Alocarii = data, Savoniera = savoniera, Sapun = sapun, Spuma_ras = spuma, Aparat_ras = aparat, Caiete = caiete, Rigla = rigla, Guma = guma, Crema = crema, Maieu = maieu, Agrafe = agrafe, Capse = capse }; bd.ArticoleDrepturis.Add(art); bd.Entry(art).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static IQueryable<Models.newArticoleVest> get_ArticoleVest() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.ArticoleVests join s in bd.Students on b.ID_Student equals s.ID_Student join a in bd.Administratoris on b.ID_Administrator equals a.ID_Admistrator select new newArticoleVest { ID_Student = b.ID_Student, Nume_Student = s.Nume+" "+s.Prenume, ID_Administrator = b.ID_Administrator, Nume_Administrator = a.Nume+" "+a.Prenume, Data_Alocarii = b.Data_Alocarii, Bocanci = b.Bocanci, Capela = b.Capela, Cascheta = b.Cascheta, Costum_Camuflaj = b.Costum_Camuflaj, Costum_Tercot = b.Costum_Tercot, Costum_Camgarn = b.Costum_Camgarn, Camasa_Alba = b.Camasa_Alba, Camasa_Arma = b.Camasa_Arma, Camasa_Camuflaj = b.Camasa_Camuflaj, Boneta = b.Boneta, Fular = b.Fular, Pantofi =b.Pantofi, Ghete = b.Ghete, Ecuson_Nominal= b.Ecuson_Nominal, Ecuson_Romania = b.Ecuson_Romania, Cuc = b.Cuc, Cravata = b.Cravata, Scurta_Oras =b.Scurta_Oras, Scurta_Camuflat = b.Scurta_Camuflat }; return query; }
public static IQueryable<string> get_nume_Companie() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Companies select b.Nume; return query; }
public static IQueryable<Models.Grade> get_Grade() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Grades select b; return query; }
public static void insert_ArticoleDrepturi(int id_stud, int id_admin, DateTime data, int savoniera, int sapun, int spuma, int aparat, int caiete, int rigla, int guma, int crema, int maieu, int agrafe, int capse) { var bd = new DataLayer.Models.ProiectBDContext(); ArticoleDrepturi art = new ArticoleDrepturi { ID_Student = id_stud, ID_Administrator = id_admin, Data_Alocarii = data, Savoniera = savoniera, Sapun = sapun, Spuma_ras = spuma, Aparat_ras = aparat, Caiete = caiete, Rigla = rigla, Guma = guma, Crema = crema, Maieu = maieu, Agrafe = agrafe, Capse = capse }; bd.ArticoleDrepturis.Add(art); bd.Entry(art).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static IQueryable <Models.newArticoleDrepturi> get_ArticoleDrepturi() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.ArticoleDrepturis join s in bd.Students on b.ID_Student equals s.ID_Student join a in bd.Administratoris on b.ID_Administrator equals a.ID_Admistrator select new newArticoleDrepturi { ID_Student = b.ID_Student, Nume_Student = s.Nume + " " + s.Prenume, ID_Administrator = b.ID_Administrator, Nume_Administrator = a.Nume + " " + a.Prenume, Data_Alocarii = b.Data_Alocarii, Savoniera = b.Savoniera, Sapun = b.Sapun, Spuma_ras = b.Spuma_ras, Aparat_ras = b.Aparat_ras, Caiete = b.Caiete, Rigla = b.Rigla, Guma = b.Guma, Crema = b.Crema, Maieu = b.Maieu, Agrafe = b.Agrafe, Capse = b.Capse }; return(query); }
public static IQueryable<Models.newArticoleDrepturi> get_ArticoleDrepturi() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.ArticoleDrepturis join s in bd.Students on b.ID_Student equals s.ID_Student join a in bd.Administratoris on b.ID_Administrator equals a.ID_Admistrator select new newArticoleDrepturi { ID_Student = b.ID_Student, Nume_Student = s.Nume + " " + s.Prenume, ID_Administrator = b.ID_Administrator, Nume_Administrator = a.Nume + " " + a.Prenume, Data_Alocarii = b.Data_Alocarii, Savoniera = b.Savoniera, Sapun = b.Sapun, Spuma_ras = b.Spuma_ras, Aparat_ras = b.Aparat_ras, Caiete = b.Caiete, Rigla = b.Rigla, Guma = b.Guma, Crema = b.Crema, Maieu = b.Maieu, Agrafe = b.Agrafe, Capse = b.Capse }; return query; }
public static IQueryable <SumarCompanie> get_sumar_comp_by_name(string name) { var bd = new DataLayer.Models.ProiectBDContext(); int query1 = (from b in bd.Administratoris join c in bd.Companies on b.ID_Admistrator equals c.ID_Administrator join d in bd.CDT_Comp on c.ID_Comandant equals d.ID_Comandant join e in bd.Students on c.ID_Companie equals e.ID_Companie where d.Nume == name select e.ID_Student).Count(); var query = from b in bd.Administratoris join c in bd.Companies on b.ID_Admistrator equals c.ID_Administrator join d in bd.CDT_Comp on c.ID_Comandant equals d.ID_Comandant join e in bd.Students on c.ID_Companie equals e.ID_Companie where d.Nume == name select new SumarCompanie { nume_comp = d.Nume, nume_adm = b.Nume + " " + b.Prenume, nume_cdt = d.Nume + " " + d.Prenume, numar_stud = query1 }; return(query); }
public static IQueryable <Models.Grade> get_Grade() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Grades select b; return(query); }
public static IQueryable <string> get_nume_Companie() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Companies select b.Nume; return(query); }
public static void insert_Grade(string grad) { var bd = new DataLayer.Models.ProiectBDContext(); Grade gr = new Grade { Nume = grad }; bd.Grades.Add(gr); bd.Entry(gr).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static IQueryable<Models.Preturi> get_Preturi() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Preturis select b; var x = query.ToList(); return query; }
public static IQueryable <Models.Preturi> get_Preturi() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Preturis select b; var x = query.ToList(); return(query); }
public static void delete_Administratori(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var query = (from b in bd.Administratoris where b.ID_Admistrator == id select b).First(); bd.Administratoris.Remove(query); bd.Entry(query).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_Student(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var st = (from b in bd.Students where b.ID_Student == id select b).First(); bd.Students.Remove(st); bd.Entry(st).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_Grade(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var gr = (from g in bd.Grades where g.ID_Grad == id select g).First(); bd.Grades.Remove(gr); bd.Entry(gr).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_Companie(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var comp = (from b in bd.Companies where b.ID_Companie == id select b).First(); bd.Companies.Remove(comp); bd.Entry(comp).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_CDT_Comp(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var cdt = (from b in bd.CDT_Comp where b.ID_Comandant == id select b).First(); bd.CDT_Comp.Remove(cdt); bd.Entry(cdt).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_Companie(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var comp = (from b in bd.Companies where b.ID_Companie == id select b).First(); bd.Companies.Remove(comp); bd.Entry(comp).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_Grade(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var gr = (from g in bd.Grades where g.ID_Grad == id select g).First(); bd.Grades.Remove(gr); bd.Entry(gr).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_Preturi(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var pr = (from b in bd.Preturis where b.ID_Pret == id select b).First(); bd.Preturis.Remove(pr); bd.Entry(pr).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void insert_Grade(string grad) { var bd = new DataLayer.Models.ProiectBDContext(); Grade gr = new Grade { Nume = grad }; bd.Grades.Add(gr); bd.Entry(gr).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static void delete_CDT_Comp(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var cdt = (from b in bd.CDT_Comp where b.ID_Comandant == id select b).First(); bd.CDT_Comp.Remove(cdt); bd.Entry(cdt).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_Preturi(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var pr = (from b in bd.Preturis where b.ID_Pret == id select b).First(); bd.Preturis.Remove(pr); bd.Entry(pr).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_Administratori(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var query = (from b in bd.Administratoris where b.ID_Admistrator == id select b).First(); bd.Administratoris.Remove(query); bd.Entry(query).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void update_Grade(int id, string nume) { var bd = new DataLayer.Models.ProiectBDContext(); var gr = (from g in bd.Grades where g.ID_Grad == id select g).First(); gr.Nume = nume; bd.Entry(gr).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static IQueryable<Models.newCompanie> get_IDCompanie(string nume) { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Companies where b.Nume == nume select new newCompanie { ID_Companie = b.ID_Companie }; return query; }
public static void delete_AlocareHrana(int student, int pret) { var bd = new DataLayer.Models.ProiectBDContext(); var aloc = (from b in bd.AlocareHranas where b.ID_Student == student && b.ID_Pret == pret select b).First(); bd.AlocareHranas.Remove(aloc); bd.Entry(aloc).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static void delete_AlocareHrana(int student, int pret) { var bd = new DataLayer.Models.ProiectBDContext(); var aloc = (from b in bd.AlocareHranas where b.ID_Student == student && b.ID_Pret == pret select b).First(); bd.AlocareHranas.Remove(aloc); bd.Entry(aloc).State = System.Data.Entity.EntityState.Deleted; bd.SaveChanges(); }
public static IQueryable <Models.newCompanie> get_IDCompanie(string nume) { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Companies where b.Nume == nume select new newCompanie { ID_Companie = b.ID_Companie }; return(query); }
public static void update_Grade(int id, string nume) { var bd = new DataLayer.Models.ProiectBDContext(); var gr = (from g in bd.Grades where g.ID_Grad == id select g).First(); gr.Nume = nume; bd.Entry(gr).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static bool Exists(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var st = from g in bd.Grades where g.ID_Grad == id select g; var list = st.ToList(); if (list.Count != 0) return true; else return false; }
public static bool Exists(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var st = from b in bd.Preturis where b.ID_Pret == id select b; var list = st.ToList(); if (list.Count != 0) return true; else return false; }
public static void increment_AlocareHrana(int student, int pret, int counter) { var bd = new DataLayer.Models.ProiectBDContext(); var aloc = (from b in bd.AlocareHranas where b.ID_Student == student && b.ID_Pret == pret select b).First(); aloc.Counter = aloc.Counter + counter; bd.Entry(aloc).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void insert_Companie(string nume, int com, int admin) { var bd = new DataLayer.Models.ProiectBDContext(); Companie comp = new Companie { Nume = nume, ID_Comandant = com, ID_Administrator = admin }; bd.Companies.Add(comp); bd.Entry(comp).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static void insert_CDT_Comp(string nume, string prenume, int grad) { var bd = new DataLayer.Models.ProiectBDContext(); CDT_Comp cdt = new CDT_Comp { Nume = nume, Prenume = prenume, ID_Grad = grad }; bd.CDT_Comp.Add(cdt); bd.Entry(cdt).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static void update_Preturi(int id, string nume, double pret, DateTime data) { var bd = new DataLayer.Models.ProiectBDContext(); var pr = (from b in bd.Preturis where b.ID_Pret == id select b).First(); pr.Nume = nume; pr.Pret = pret; pr.Data = data; bd.Entry(pr).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void update_CDT_Comp(int id, string nume, string prenume, int grad) { var bd = new DataLayer.Models.ProiectBDContext(); var cdt = (from b in bd.CDT_Comp where b.ID_Comandant == id select b).First(); cdt.Nume = nume; cdt.Prenume = prenume; cdt.ID_Grad = grad; bd.Entry(cdt).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void update_Companie(int id, string nume, int com, int admin) { var bd = new DataLayer.Models.ProiectBDContext(); var comp = (from b in bd.Companies where b.ID_Companie == id select b).First(); comp.Nume = nume; comp.ID_Comandant = com; comp.ID_Administrator = admin; bd.Entry(comp).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void update_Preturi(int id, string nume, double pret, DateTime data) { var bd = new DataLayer.Models.ProiectBDContext(); var pr = (from b in bd.Preturis where b.ID_Pret == id select b).First(); pr.Nume = nume; pr.Pret = pret; pr.Data = data; bd.Entry(pr).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void insert_Companie(string nume, int com, int admin) { var bd = new DataLayer.Models.ProiectBDContext(); Companie comp = new Companie { Nume = nume, ID_Comandant = com, ID_Administrator = admin }; bd.Companies.Add(comp); bd.Entry(comp).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static void insert_Administratori(string nume, string prenume, int grad) { var bd = new DataLayer.Models.ProiectBDContext(); Administratori admin = new Administratori { Nume = nume, Prenume = prenume, ID_Grad = grad }; bd.Administratoris.Add(admin); bd.Entry(admin).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static void update_CDT_Comp(int id, string nume, string prenume, int grad) { var bd = new DataLayer.Models.ProiectBDContext(); var cdt = (from b in bd.CDT_Comp where b.ID_Comandant == id select b).First(); cdt.Nume = nume; cdt.Prenume = prenume; cdt.ID_Grad = grad; bd.Entry(cdt).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void insert_CDT_Comp(string nume, string prenume, int grad) { var bd = new DataLayer.Models.ProiectBDContext(); CDT_Comp cdt = new CDT_Comp { Nume = nume, Prenume = prenume, ID_Grad = grad }; bd.CDT_Comp.Add(cdt); bd.Entry(cdt).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static void update_Administratori(int id, string nume, string prenume, int grad) { var bd = new DataLayer.Models.ProiectBDContext(); var query = (from b in bd.Administratoris where b.ID_Admistrator == id select b).First(); query.Nume = nume; query.Prenume = prenume; query.ID_Grad = grad; bd.Entry(query).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void update_AlocareHrana(int student, int pret, int admin, int counter) { var bd = new DataLayer.Models.ProiectBDContext(); var aloc = (from b in bd.AlocareHranas where b.ID_Student == student && b.ID_Pret == pret select b).First(); aloc.ID_Administrator = admin; aloc.Counter = counter; bd.Entry(aloc).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void update_Administratori(int id, string nume, string prenume, int grad) { var bd = new DataLayer.Models.ProiectBDContext(); var query = (from b in bd.Administratoris where b.ID_Admistrator == id select b).First(); query.Nume = nume; query.Prenume = prenume; query.ID_Grad = grad; bd.Entry(query).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static void insert_Administratori(string nume, string prenume, int grad) { var bd = new DataLayer.Models.ProiectBDContext(); Administratori admin = new Administratori { Nume = nume, Prenume = prenume, ID_Grad = grad }; bd.Administratoris.Add(admin); bd.Entry(admin).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static IQueryable<Models.newAdministratori> get_Administratori() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Administratoris join c in bd.Grades on b.ID_Grad equals c.ID_Grad select new newAdministratori { ID_Administrator = b.ID_Admistrator, Nume = b.Nume, Prenume = b.Prenume, ID_Grad = b.ID_Grad, Grad = c.Nume }; return query; }
public static void insert_Preturi(string nume, double pret, DateTime data) { var bd = new DataLayer.Models.ProiectBDContext(); Preturi pr = new Preturi { Nume = nume, Pret = pret, Data = data }; bd.Preturis.Add(pr); bd.Entry(pr).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static void insert_AlocareHrana(int student, int pret, int admin, int counter) { var bd = new DataLayer.Models.ProiectBDContext(); AlocareHrana aloc = new AlocareHrana { ID_Student = student, ID_Pret = pret, ID_Administrator = admin, Counter = counter }; bd.AlocareHranas.Add(aloc); bd.Entry(aloc).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static void insert_Preturi(string nume, double pret, DateTime data) { var bd = new DataLayer.Models.ProiectBDContext(); Preturi pr = new Preturi { Nume = nume, Pret = pret, Data = data }; bd.Preturis.Add(pr); bd.Entry(pr).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static IQueryable<Models.newCDT_Comp> get_CDT_comp() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.CDT_Comp join g in bd.Grades on b.ID_Grad equals g.ID_Grad select new newCDT_Comp { ID_Comandant = b.ID_Comandant, Nume = b.Nume, Prenume = b.Prenume, ID_Grad = b.ID_Grad, Grad = g.Nume }; return query; }
public static void insert_AlocareHrana(int student, int pret, int admin, int counter) { var bd = new DataLayer.Models.ProiectBDContext(); AlocareHrana aloc = new AlocareHrana { ID_Student = student, ID_Pret = pret, ID_Administrator = admin, Counter = counter }; bd.AlocareHranas.Add(aloc); bd.Entry(aloc).State = System.Data.Entity.EntityState.Added; bd.SaveChanges(); }
public static IQueryable <Models.newCDT_Comp> get_CDT_comp() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.CDT_Comp join g in bd.Grades on b.ID_Grad equals g.ID_Grad select new newCDT_Comp { ID_Comandant = b.ID_Comandant, Nume = b.Nume, Prenume = b.Prenume, ID_Grad = b.ID_Grad, Grad = g.Nume }; return(query); }
public static IQueryable <Models.newAdministratori> get_Administratori() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Administratoris join c in bd.Grades on b.ID_Grad equals c.ID_Grad select new newAdministratori { ID_Administrator = b.ID_Admistrator, Nume = b.Nume, Prenume = b.Prenume, ID_Grad = b.ID_Grad, Grad = c.Nume }; return(query); }
public static IQueryable<Models.newCompanie> get_Companie() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from b in bd.Companies join c in bd.CDT_Comp on b.ID_Comandant equals c.ID_Comandant join a in bd.Administratoris on b.ID_Administrator equals a.ID_Admistrator select new newCompanie { ID_Companie = b.ID_Companie, Nume = b.Nume, ID_Comandant = b.ID_Comandant, Nume_Comandant = c.Nume+" "+c.Prenume, ID_Administrator = b.ID_Administrator, Nume_Administrator = a.Nume+" "+a.Prenume }; return query; }
public static bool Exists(int id) { var bd = new DataLayer.Models.ProiectBDContext(); var st = from b in bd.Students where b.ID_Student == id select b; var list = st.ToList(); if (list.Count != 0) { return(true); } else { return(false); } }
public static void update_Student(int id, string nume, string prenume, int grad, string cnp, string adresa, int comp) { var bd = new DataLayer.Models.ProiectBDContext(); var st = (from b in bd.Students where b.ID_Student == id select b).First(); st.Nume = nume; st.Prenume = prenume; st.ID_Grad = grad; st.CNP = cnp; st.Adresa = adresa; st.ID_Companie = comp; bd.Entry(st).State = System.Data.Entity.EntityState.Modified; bd.SaveChanges(); }
public static IQueryable<Models.newAlocareHrana> get_AlocareHrana() { var bd = new DataLayer.Models.ProiectBDContext(); var query = from a in bd.AlocareHranas join s in bd.Students on a.ID_Student equals s.ID_Student join p in bd.Preturis on a.ID_Pret equals p.ID_Pret join adm in bd.Administratoris on a.ID_Administrator equals adm.ID_Admistrator select new newAlocareHrana { ID_Student = s.ID_Student, Nume_Student = s.Nume + " " + s.Prenume, ID_Pret = p.ID_Pret, Nume_Produs = p.Nume, Pret = p.Pret, ID_Administrator = adm.ID_Admistrator, Nume_Administrator = adm.Nume + " " + adm.Prenume, Counter = a.Counter }; return query; }