public bool Exists(GetReadType GRT, ClientMessageGetRead TypeID, string MessageID, stringUserID)
{int ThisGRT =Convert.ToInt32(GRT);int ThisTypeID =Convert.ToInt32(TypeID);string strSql = @"select
count(1)
from
Client_Message_GetRead
where
GetRead = @GetRead
and
TypeID = @TypeID
and
MessageID like '%'+@MessageID+'%'
and
UserID = @UserID";
SqlParameter[] parameters={new SqlParameter("@GetRead", SqlDbType.Int,4),new SqlParameter("@TypeID", SqlDbType.Int,4),new SqlParameter("@MessageID", SqlDbType.Char,36),new SqlParameter("@UserID", SqlDbType.Char,36)
};
parameters[0].Value =ThisGRT;
parameters[1].Value =ThisTypeID;
parameters[2].Value =MessageID;
parameters[3].Value =UserID;returnDbHelperSQL.Exists(strSql.ToString(), parameters);
} public DataSet NotExists1(GetReadType GRT, string CompanyID, stringUserID)
{int ThisGRT =Convert.ToInt32(GRT);int ThisTypeID =Convert.ToInt32(ClientMessageGetRead.公益团体消息);string strSql = @"select
*
from
Company_Company_Message
where
CompanyID = @CompanyID
and
(
select
top 1 MessageID
from
Client_Message_GetRead
where
GetRead = @GetRead
and
TypeID = @TypeID
and
UserID = @UserID
)
not like '%'+MessageID +'%'";
SqlParameter[] parameters={new SqlParameter("@GetRead", SqlDbType.Int,4),new SqlParameter("@TypeID", SqlDbType.Int,4),new SqlParameter("@CompanyID", SqlDbType.Char,36),new SqlParameter("@UserID", SqlDbType.Char,36)
};
parameters[0].Value =ThisGRT;
parameters[1].Value =ThisTypeID;
parameters[2].Value =CompanyID;
parameters[3].Value =UserID;returnDbHelperSQL.Query(strSql.ToString(), parameters);
}