strSql.Append($",SUM(B.NETWEIGHT) AS NETWEIGHT,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) AS TEU,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) AS CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) AS CNTR2,");
strSql.Append($"SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) AS CNTR3,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) AS CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) AS CNTR5,");
strSql.Append($"SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) AS CNTR6,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) AS CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) AS CNTR8,");
strSql.Append($"SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) AS CNTR9,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) AS CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) AS OTCNTR");
strSql.Append($",(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",(B.NETWEIGHT) NETWEIGHT,(B.KGS) KGS,(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
//strSql.Append(" left join (select t3.* from (select *,row_number() over (partition by EDICODE order by portid asc) as rownum from code_disport) t3 where t3.rownum = 1 ) cd on B.DESTINATIONID = cd.EDICODE ");
strSql.Append(" left join (select * from( select *,row_number() over (partition by EDICODE order by CHAU desc) as rownum from (select EDICODE,COUNTRY,CHAU from code_disport union all select PORTENAME EDICODE,COUNTRY,'' CHAU from code_air_port)t4) t3 where t3.rownum = 1) cd on B.DESTINATIONID = cd.EDICODE ");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
//strSql.Append(" left join (select t3.* from (select *,row_number() over (partition by EDICODE order by portid asc) as rownum from code_disport) t3 where t3.rownum = 1 ) cd on B.DESTINATIONID = cd.EDICODE ");
strSql.Append(" left join (select * from( select *,row_number() over (partition by EDICODE order by CHAU desc) as rownum from (select EDICODE,COUNTRY,CHAU from code_disport union all select PORTENAME EDICODE,COUNTRY,'' CHAU from code_air_port)t4) t3 where t3.rownum = 1) cd on B.DESTINATIONID = cd.EDICODE ");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) CNTR2,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) CNTR3");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) CNTR5,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) CNTR6");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) CNTR8,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) CNTR9");
strSql.Append($",SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append($",SUM(B.NETWEIGHT) NETWEIGHT,SUM(B.KGS) KGS,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) TEU");
strSql.Append($",SUM(B.NETWEIGHT) AS NETWEIGHT,SUM(CASE WHEN {BLTYPE子句} THEN B.TEU ELSE 0 END) AS TEU,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR1 ELSE 0 END) AS CNTR1,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR2 ELSE 0 END) AS CNTR2,");
strSql.Append($"SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR3 ELSE 0 END) AS CNTR3,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR4 ELSE 0 END) AS CNTR4,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR5 ELSE 0 END) AS CNTR5,");
strSql.Append($"SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR6 ELSE 0 END) AS CNTR6,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR7 ELSE 0 END) AS CNTR7,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR8 ELSE 0 END) AS CNTR8,");
strSql.Append($"SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR9 ELSE 0 END) AS CNTR9,SUM(CASE WHEN {BLTYPE子句} THEN B.CNTR10 ELSE 0 END) AS CNTR10,SUM(CASE WHEN {BLTYPE子句} THEN B.OTCNTR ELSE 0 END) AS OTCNTR");
str=" (B.OP='"+usercode+"' OR B.SALE='"+usercode+"' OR B.CUSTSERVICE='"+usercode+"')";
}
elseif(visiblerange=="2")
{
if(tb=="index")
{
varrangeDa=newRangeDA();
vardeptname=rangeDa.GetDEPTNAME(userid);
varuserstr=newStringBuilder();
userstr.Append(" select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='"+companyid+"') and GID in (select userid from user_baseinfo where DEPTNAME='"+deptname+"')");
str=" (B.OP='"+Convert.ToString(reader["SHOWNAME"])+"' OR B.SALE='"+Convert.ToString(reader["SHOWNAME"])+"' OR B.CUSTSERVICE='"+Convert.ToString(reader["SHOWNAME"])+"'";
}
else
{
str=str+" or B.OP='"+Convert.ToString(reader["SHOWNAME"])+"' OR B.SALE='"+Convert.ToString(reader["SHOWNAME"])+"' OR B.CUSTSERVICE='"+Convert.ToString(reader["SHOWNAME"])+"' ";
};
}
str=str+")";
reader.Close();
}
}
else
{
str=" UPPER(B.Corpid)='"+companyid+"'";
}
}
elseif(visiblerange=="5")
{
varuserstr=newStringBuilder();
userstr.Append(" select COMPANYID from user_authority_range_company where userid='"+userid+"' and AUTHORITYID='"+AUTHORITYID+"' and VISIBLERANGE=1");
str=str+" or B.Corpid='"+Convert.ToString(reader["COMPANYID"])+"'";
};
}
str=str+")";
reader.Close();
}
}
elseif(visiblerange=="6")
{
varuserstr=newStringBuilder();
userstr.Append(" select OPID,(select SHOWNAME from [user] where GID=user_authority_range_op.OPID) SHOWNAME from user_authority_range_op where userid='"+userid+"' and AUTHORITYID='"+AUTHORITYID+"' and VISIBLERANGE=1");
str=" (B.OP='"+Convert.ToString(reader["SHOWNAME"])+"' OR B.SALE='"+Convert.ToString(reader["SHOWNAME"])+"' OR B.CUSTSERVICE='"+Convert.ToString(reader["SHOWNAME"])+"'";
}
else
{
str=str+" or B.OP='"+Convert.ToString(reader["SHOWNAME"])+"' OR B.SALE='"+Convert.ToString(reader["SHOWNAME"])+"' OR B.CUSTSERVICE='"+Convert.ToString(reader["SHOWNAME"])+"'";