/// <summary> /// Sửa dữ liệu của MaSP cũ bằng dữ liệu của DT. /// </summary> public static void UpdateDuLieu(string MaSPCu, DienThoai DT) { string sql = "update DienThoai " + "set MaSP = '" + DT.GSMaSP + "', TenSP = N'" + DT.GSTenSP + "', XuatSu = N'" + DT.GSXuatSu + "', DonGia = " + DT.GSDonGia + ", SoLuong = " + DT.GSSoLuong + ", ThanhTien = " + DT.ThanhTien() + " " + "where MaSP = '" + MaSPCu + "'"; Command(sql); }
/// <summary> /// Insert dữ liệu DT vào DataBase. /// </summary> public static void InsertDuLieu(DienThoai DT) { string sql = "insert into DienThoai values('" + DT.GSMaSP + "', N'" + DT.GSTenSP + "', N'" + DT.GSXuatSu + "'," + DT.GSDonGia + "," + DT.GSSoLuong + "," + DT.ThanhTien() + ")"; Command(sql); }