public static void Sua(int id, nhasanxuat nsx) { var db = new PhucMobileConnectionDB(); nsx.MaNSX = id; db.Update("nhasanxuat", "MaNSX", nsx); }
public static void Sua(int id, loaisanpham lsp) { var db = new PhucMobileConnectionDB(); lsp.MaLSP = id; db.Update("loaisanpham", "MaLSP", lsp); }
public static IEnumerable <loaisanpham> DanhSach() { using (var db = new PhucMobileConnectionDB()) { return(db.Query <PhucMobileConnection.loaisanpham>("SELECT * FROM loaisanpham WHERE bixoa<>1")); } }
public static IEnumerable <nhasanxuat> DanhSach() { using (var db = new PhucMobileConnectionDB()) { return(db.Query <PhucMobileConnection.nhasanxuat>("SELECT * FROM nhasanxuat WHERE bixoa<>1")); } }
public static void Xoa(int id) { var db = new PhucMobileConnectionDB(); var a = db.SingleOrDefault <loaisanpham>("SELECT * FROM loaisanpham WHERE MaLSP=@0", id); a.bixoa = 1; db.Update("loaisanpham", "MaLSP", a); }
public static void Sua(int id, sanpham sp) { var db = new PhucMobileConnectionDB(); var a = db.SingleOrDefault <sanpham>("SELECT * FROM sanpham WHERE MaSanPham=@0", id); a = sp; db.Update("sanpham", "MaSanPham", sp); }
public static void Xoa(int id) { var db = new PhucMobileConnectionDB(); var a = db.SingleOrDefault <nhasanxuat>("SELECT * FROM nhasanxuat WHERE MaNSX=@0", id); a.bixoa = 1; db.Update("nhasanxuat", "MaNSX", a); }
public static void Them(loaisanpham lsp) { var db = new PhucMobileConnectionDB(); db.Insert(lsp); }
public static loaisanpham ChiTiet(int id) { var db = new PhucMobileConnectionDB(); return(db.SingleOrDefault <loaisanpham>("SELECT * FROM loaisanpham WHERE MaLSP = @0", id)); }
public static nhasanxuat NSXbyHang(int id) { var db = new PhucMobileConnectionDB(); return(db.SingleOrDefault <nhasanxuat>("SELECT * FROM nhasanxuat WHERE MaNSX = @0", id)); }
public static void Them(nhasanxuat nsx) { var db = new PhucMobileConnectionDB(); db.Insert(nsx); }
public static IEnumerable <PhucMobileConnection.sanpham> SanPhambyNSX(int id) { var db = new PhucMobileConnectionDB(); return(db.Query <PhucMobileConnection.sanpham>("SELECT * FROM sanpham WHERE MaNSX = @0", id)); }
public static IEnumerable <PhucMobileConnection.sanpham> DanhSachNoiBat() { var db = new PhucMobileConnectionDB(); return(db.Query <PhucMobileConnection.sanpham>("SELECT TOP 6 * FROM sanpham ORDER BY SoLuotMua DESC")); }
public static IEnumerable <PhucMobileConnection.sanpham> DanhSach() { var db = new PhucMobileConnectionDB(); return(db.Query <PhucMobileConnection.sanpham>("SELECT * FROM sanpham")); }
public static IEnumerable <PhucMobileConnection.nhasanxuat> DanhSachNhaSanXuat() { var db = new PhucMobileConnectionDB(); return(db.Query <PhucMobileConnection.nhasanxuat>("SELECT * FROM nhasanxuat")); }