strSql.Append("SELECT TOP 1 BSNO,CORPID, CUSTOMERNAME,FEESTATUS,ISCANCEL,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '20%'),'') CTN20,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '40%'),'') CTN40 from op_seae where MBLNO like '"+MBLNO+"%'");
strSql.Append("SELECT TOP 1 BSNO,CORPID, CUSTOMERNAME,FEESTATUS,ISCANCEL,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '20%'),'') CTN20,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '40%'),'') CTN40 from op_seae where MBLNO like '"+MBLNO+"%' and isnull(ISCANCEL,'0')='0' ");
if(!string.IsNullOrWhiteSpace(YTD7Condition))
if(!string.IsNullOrWhiteSpace(YTD7Condition))
{
{
strSql.Append(" and "+YTD7Condition);
strSql.Append(" and "+YTD7Condition);
@ -209,6 +209,31 @@ namespace JobCreateFee
newbs.CORPID=row["CORPID"].ToString();
newbs.CORPID=row["CORPID"].ToString();
}
}
}
}
else{
strSql=newStringBuilder();
strSql.Append("SELECT TOP 1 BSNO,CORPID, CUSTOMERNAME,FEESTATUS,ISCANCEL,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '20%'),'') CTN20,isnull((select top 1 CTNALL from op_ctn where bsno=op_seae.BSNO and CTNALL like '40%'),'') CTN40 from op_seae where MBLNO like '"+MBLNO+"%' ");