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

            db.Sanphamcanmuas.Remove(loai);
            db.SaveChanges();
        }
Exemplo n.º 2
0
 internal string ThemSPCM(Sanphamcanmua loai)
 {
     loai.Ngaydang = DateTime.Today;
     db.Sanphamcanmuas.Add(loai);
     db.SaveChanges();
     return(null);
 }
Exemplo 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);
     }
 }
Exemplo 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();
        }