QuocLe

Untitled

Nov 28th, 2020
917
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Chạy được
  2.         public bool InsertBangDia(string tieuDeCD, int maTL, int namSanXuat, string quocGia, int soLuong, int maNCC, decimal giaNhap, decimal giaThue)
  3.         {
  4.             string query = string.Format("INSERT INTO dbo.[DiaCD](TieuDeCD, MaTL, NamSanXuat, QuocGia, SoLuong, MaNCC, GiaNhap, GiaThue)" +
  5.                 "Values (N'{0}', {1}, {2}, N'{3}', {4}, {5}, {6}, {7})", tieuDeCD, maTL, namSanXuat, quocGia, soLuong, maNCC, giaNhap, giaThue);
  6.             int resual = DataProvider.Instance.ExecuteNonQuery(query);
  7.             return resual > 0;
  8.         }
  9.  
  10.  
  11.  
  12. //Không chạy đc
  13.         public bool InsertBangDia2(BangDia CD)
  14.         {
  15.             string query = string.Format("INSERT INTO dbo.[DiaCD](TieuDeCD, MaTL, NamSanXuat, QuocGia, SoLuong, MaNCC, GiaNhap, GiaThue)" +
  16.                 "Values (N'{0}', {1}, {2}, N'{3}', {4}, {5}, {6}, {7})", CD.TieuDeCD, CD.MaTL, CD.NamSanXuat, CD.QuocGia, CD.SoLuong, CD.MaNCC, CD.GiaNhap, CD.GiaThue);
  17.             int resual = DataProvider.Instance.ExecuteNonQuery(query);
  18.             return resual > 0;
  19.         }
  20.  
RAW Paste Data