Esempio n. 1
0
        internal void DeleteSPCM(int id)
        {
            Sanphamcanmua loai = db.Sanphamcanmuas.Find(id);

            db.Sanphamcanmuas.Remove(loai);
            db.SaveChanges();
        }
Esempio n. 2
0
 internal string ThemSPCM(Sanphamcanmua loai)
 {
     loai.Ngaydang = DateTime.Today;
     db.Sanphamcanmuas.Add(loai);
     db.SaveChanges();
     return(null);
 }
Esempio n. 3
0
 public Sanphamcanmua getSanphamcanmua(int ID)
 {
     using (Entities db = new Entities())
     {
         Sanphamcanmua var = (from p in db.Sanphamcanmuas where p.ID == ID select p).FirstOrDefault();
         return(var);
     }
 }
Esempio n. 4
0
        internal void EditSPCM(SanPhamCanMuaEdit loai)
        {
            Sanphamcanmua lsp = db.Sanphamcanmuas.Find(loai.ID);

            lsp.Soluong         = loai.Soluong;
            lsp.Ngayketthuc     = loai.Ngayketthuc;
            lsp.Mota            = loai.Mota;
            db.Entry(lsp).State = EntityState.Modified;
            db.SaveChanges();
        }