@ -75,9 +75,15 @@ namespace QMAPP.FJC.DAL.MD
try
try
{
{
string sql = "SELECT * FROM [T_MD_MATERIAL] WHERE REPLACE(REPLACE(REPLACE([MATERIAL_CODE],'.',''),' ',''),'-','')=@materialcode" ;
string sql = "SELECT * FROM [T_MD_MATERIAL] WHERE REPLACE(REPLACE(REPLACE([MATERIAL_CODE],'.',''),' ',''),'-','')=@materialcode" ;
List < DataParameter > parameters = new List < DataParameter > ( ) ;
List < DataParameter > parameters = new List < DataParameter > ( ) ;
materialcode = materialcode . Replace ( "." , "" ) . Replace ( "-" , "" ) . Replace ( " " , "" ) ;
materialcode = materialcode . Replace ( "." , "" ) . Replace ( "-" , "" ) . Replace ( " " , "" ) ;
parameters . Add ( new DataParameter ( "materialcode" , materialcode ) ) ;
parameters . Add ( new DataParameter ( "materialcode" , materialcode ) ) ;
if ( materialcode . Length > = 1 3 )
{
sql = $"SELECT * FROM [T_MD_MATERIAL] WHERE REPLACE(REPLACE(REPLACE([MATERIAL_CODE],'.',''),' ',''),'-','')=@materialcode or REPLACE(REPLACE(REPLACE([MATERIAL_CODE],'.',''),' ',''),'-','')='{materialcode.Substring(0,13)}'" ;
}
using ( IDataSession session = AppDataFactory . CreateMainSession ( ) )
using ( IDataSession session = AppDataFactory . CreateMainSession ( ) )
{
{
//获取信息
//获取信息