public bool remove(int id) { LoaiSanPham = (from c in justshop.LoaiSanPhams where c.MaLoai == id select c).SingleOrDefault(); justshop.LoaiSanPhams.Remove(LoaiSanPham); justshop.SaveChanges(); return(true); }
public bool update(int id, string tenloai, string trichdan, string anh) { LoaiSanPham = (from c in justshop.LoaiSanPhams where c.MaLoai == id select c).SingleOrDefault(); if (LoaiSanPham != null) { LoaiSanPham.AnhTieuBieu = anh; LoaiSanPham.TenLoai = tenloai; LoaiSanPham.TrichDan = trichdan; justshop.SaveChanges(); return(true); } return(false); }
public string gettenloai(int id) { LoaiSanPham sanpham = (from c in justshop.LoaiSanPhams where c.MaLoai == id select c).SingleOrDefault(); return(sanpham.TenLoai); }
public LoaiSanPham getloai(int id) { LoaiSanPham loaisp = (from c in justshop.LoaiSanPhams where c.MaLoai == id select c).SingleOrDefault(); return(loaisp); }