public Ders GetLessonBydersId(int dersId) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Ders.Where(x => x.DersId == dersId).FirstOrDefault()); } }
public User GetUser(int Id, int type) { using (OBSEntities2 o = new OBSEntities2()) { return(o.User.Where(x => x.Ogrt_ogrID == Id && x.Type == type).FirstOrDefault()); } }
public Ogrenci GetStudent(int Id) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Ogrenci.Where(x => x.OgrId == Id).FirstOrDefault()); } }
public List <Ogrenci_Ders_Model> OgrGetLessonList(int type, int aktifpasif, int bolumId) { using (OBSEntities2 o = new OBSEntities2()) { var od = o.Ogretmen_Ogrenci_Ders.Where(x => x.Type == type && x.Ders.AktifPasif == aktifpasif && x.Ders.BolumId == bolumId).ToList(); List <Ogrenci_Ders_Model> odml = new List <Ogrenci_Ders_Model>(); foreach (var item in od) { Ogrenci_Ders_Model odm = new Ogrenci_Ders_Model(); odm.Ogretmen_Ogrenci_DersID = item.Ogretmen_Ogrenci_DersID; odm.Type = item.Type; odm.Vize1 = item.Vize1; odm.Vize2 = item.Vize2; odm.Final = item.Final; odm.DersID = item.DersID; odm.Ders.DersAdi = item.Ders.DersAdi; odm.Ders.DersKodu = item.Ders.DersKodu; odm.Ders.Kredi = item.Ders.Kredi; odm.Ders.BolumId = item.Ders.BolumId; odm.Ogretmen.OgretmenAdi = item.Ogretmen.OgretmenAdi; odm.Ogretmen.BolumId = item.Ogretmen.BolumId; odm.Ogrt_Ogr_ID = item.Ogrt_Ogr_ID; odm.Ders.AktifPasif = item.Ders.AktifPasif; odml.Add(odm); } return(odml); } }
public Ogretmen_Ogrenci_Ders GetLesson(int Id) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Ogretmen_Ogrenci_Ders.Where(x => x.Ogretmen_Ogrenci_DersID == Id).FirstOrDefault()); } }
public List <Bolum> DepartmentList() { using (OBSEntities2 o = new OBSEntities2()) { return(o.Bolum.ToList()); } }
public List <Ders> GetLessonById(int Id) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Ders.Where(x => x.BolumId == Id).ToList()); } }
public User StudentUser(string name, string pass) { using (OBSEntities2 o = new OBSEntities2()) { return(o.User.Where(x => x.Username == name && x.Password == pass).FirstOrDefault()); } }
public Ogretmen GetOgretmen(int Id) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Ogretmen.Where(x => x.OgretmenId == Id).FirstOrDefault()); } }
public Ogretmen_Ogrenci_Ders GetTeacher(int dersId, int type) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Ogretmen_Ogrenci_Ders.Where(x => x.DersID == dersId && x.Type == type).FirstOrDefault()); } }
public List <Ogretmen> OgretmenList(int Id) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Ogretmen.Where(x => x.BolumId == Id).ToList()); } }
public Bolum GetDepartment(int BolumId) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Bolum.Where(x => x.BolumId == BolumId).FirstOrDefault()); } }
public List <Bolum> DepartmentList(string fakulte) { using (OBSEntities2 o = new OBSEntities2()) { return(o.Bolum.Where(x => x.FakulteAdi == fakulte).ToList()); } }
public List <StudentModel> StudentList(int aktifpasif) { using (OBSEntities2 o = new OBSEntities2()) { var a = o.Ogrenci.Where(x => x.AktifPasif == aktifpasif).ToList(); List <StudentModel> st = new List <StudentModel>(); foreach (var item in a) { StudentModel ogr = new StudentModel(); ogr.OgrId = item.OgrId; ogr.OgrNo = item.OgrNo; ogr.Ad = item.Ad; ogr.Soyad = item.Soyad; ogr.Tc = item.Tc; ogr.DogumTarih = item.DogumTarih; ogr.Cinsiyet = item.Cinsiyet; ogr.Email = item.Email; ogr.Bolum.BolumId = item.Bolum.BolumId; ogr.Bolum.BolumAdi = item.Bolum.BolumAdi; ogr.Bolum.FakulteAdi = item.Bolum.FakulteAdi; ogr.KayityapanID = item.KayityapanID; ogr.KayitYapilantarih = item.KayitYapilantarih; ogr.AktifPasif = item.AktifPasif; st.Add(ogr); } return(st); } }
public bool DersCUD(Ders d, EntityState state) { using (OBSEntities2 o = new OBSEntities2()) { o.Entry(d).State = state; if (o.SaveChanges() > 0) { return(true); } return(false); } }
public bool OgretmenDersCUD(Ogretmen_Ogrenci_Ders od, EntityState state) { using (OBSEntities2 o = new OBSEntities2()) { o.Entry(od).State = state; if (o.SaveChanges() > 0) { return(true); } return(false); } }
public bool CUD(Ogrenci o, EntityState state) { using (OBSEntities2 ogr = new OBSEntities2()) { ogr.Entry(o).State = state; if (ogr.SaveChanges() > 0) { return(true); } return(false); } }
public bool UserCUD(User u, EntityState state) { using (OBSEntities2 ogr = new OBSEntities2()) { ogr.Entry(u).State = state; if (ogr.SaveChanges() > 0) { return(true); } return(false); } }
public List <Ogrenci> GetStudentListByID(int dersID, int type) { using (OBSEntities2 o = new OBSEntities2()) { var d = o.Ogretmen_Ogrenci_Ders.Where(x => x.DersID == dersID && x.Type == type).ToList(); List <Ogrenci> sl = new List <Ogrenci>(); foreach (var item in d) { var s = o.Ogrenci.Where(x => x.OgrId == item.Ogrt_Ogr_ID).FirstOrDefault(); sl.Add(s); } return(sl); } }
public List <Ogrenci_Ders_Model> GetLessons(int Id, int type) { using (OBSEntities2 o = new OBSEntities2()) { var a = o.Ogretmen_Ogrenci_Ders.Where(x => x.Type == type && x.Ogrt_Ogr_ID == Id).ToList(); List <Ogrenci_Ders_Model> oml = new List <Ogrenci_Ders_Model>(); foreach (var item in a) { Ogrenci_Ders_Model ogr = new Ogrenci_Ders_Model(); ogr.Ders.DersId = item.Ders.DersId; ogr.Ders.DersKodu = item.Ders.DersKodu; ogr.Ders.DersAdi = item.Ders.DersAdi; ogr.Ders.Kredi = item.Ders.Kredi; ogr.Ogretmen.OgretmenAdi = item.Ogretmen.OgretmenAdi; ogr.Vize1 = item.Vize1; ogr.Vize2 = item.Vize2; ogr.Final = item.Final; oml.Add(ogr); } return(oml); } }