public bool deletedata(En_SanPham en) { string query = string.Format("DELETE FROM SanPham WHERE MaSP=@MaSP"); SqlParameter[] sqlPara = new SqlParameter[1]; sqlPara[0] = new SqlParameter("@MaSP", en.MaSP); return(cnn.executeDeleteQuery(query, sqlPara)); }
public int deletedata(En_LoaiSanPham en) { string query = string.Format("DELETE FROM LoaiSanPham WHERE MaLoai=@MaLoai"); SqlParameter[] sqlPara = new SqlParameter[1]; sqlPara[0] = new SqlParameter("@MaLoai", en.MaLoai); int rows = 0; try { cnn.executeDeleteQuery(query, sqlPara); rows += 1; } catch (Exception ex) { throw ex; } return(rows); }