Exemple #1
0
        public void DeleteStudent(int id)
        {
            var db   = new QLBHEntities();
            var good = db.Goods.Find(id);

            db.Goods.Remove(good);
            db.SaveChanges();
        }
Exemple #2
0
        public void UpdateStudent(int id, string name, int number, DateTime date, string status)
        {
            var db   = new QLBHEntities();
            var Good = db.Goods.Find(id);

            Good.name     = name;
            Good.number   = number;
            Good.date_add = date;
            Good.status   = status;

            db.Entry(Good).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
        }
Exemple #3
0
        public void CreateGood(string code, string name, int number, DateTime date, string status)
        {
            var newGood = new Goods();

            newGood.code     = code;
            newGood.name     = name;
            newGood.number   = number;
            newGood.date_add = date;
            newGood.status   = status;

            var db = new QLBHEntities();

            db.Goods.Add(newGood);
            db.SaveChanges();
        }
Exemple #4
0
        public Goods[] GetClasses()
        {
            var db = new QLBHEntities();

            return(db.Goods.ToArray());
        }
Exemple #5
0
        public Goods GetStudent(int id)
        {
            var db = new QLBHEntities();

            return(db.Goods.Find(id));
        }