internal void DeleteSPCM(int id) { Sanphamcanmua loai = db.Sanphamcanmuas.Find(id); db.Sanphamcanmuas.Remove(loai); db.SaveChanges(); }
internal string ThemSPCM(Sanphamcanmua loai) { loai.Ngaydang = DateTime.Today; db.Sanphamcanmuas.Add(loai); db.SaveChanges(); return(null); }
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); } }
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(); }