Beispiel #1
0
 public  user_table CheckUserName(string name)
   {
       using (Notice_boardEntities2 db = new Notice_boardEntities2())
       {
           return db.user_table.SingleOrDefault(x2 => x2.User_name == name);
       }
   }
Beispiel #2
0
 public Klass CheckklassName(string klassName)
    {
        using (Notice_boardEntities2 db = new Notice_boardEntities2())
        {
            return db.Klasses.SingleOrDefault(x => x.Name == klassName);
        }
    }
Beispiel #3
0
 public Klass getOneKlass(int? id)
 {
     using (Notice_boardEntities2 db = new Notice_boardEntities2())
     {
         return db.Klasses.SingleOrDefault(x => x.Id == id);
     }
 }
Beispiel #4
0
        public List<Klass> getAllKlass()
        {
            using (Notice_boardEntities2 db = new Notice_boardEntities2())
            {
                return db.Klasses.ToList();
            }

        }
Beispiel #5
0
        public List<string> GetKlass(string term)
        {
            using (Notice_boardEntities2 db = new Notice_boardEntities2())
            {

             return db.Klasses.Where(x => x.Name.Contains(term)).Select(y => y.Name).ToList();
            }
        }
Beispiel #6
0
        public void addKlass(Klass obj)
        {
            using (Notice_boardEntities2 db = new Notice_boardEntities2()) 
            {

                db.Klasses.Add(obj);
                db.SaveChanges();
            
            }
        }
Beispiel #7
0
        public void deleteKlass(int id)
        {
            using (Notice_boardEntities2 db = new Notice_boardEntities2())
            {

                var q=db.Klasses.SingleOrDefault(x=>x.Id == id);
                db.Klasses.Remove(q);
                db.SaveChanges();

            }
        }
Beispiel #8
0
        public void editKlass(Klass obj)
        {
            using (Notice_boardEntities2 db = new Notice_boardEntities2())
            {

                obj.Name = obj.Name;
                obj.Degree = obj.Degree;
                obj.Date = DateTime.Today;
                db.SaveChanges();
            }

        }