日期:2014-05-17 浏览次数:21004 次
public static List<CardListModel> UpdateCardStateAndPermitList(List<CardListModel> cardList, int cardState)
{
List<CardListModel> resultList = new List<CardListModel>();
foreach (CardListModel item in cardList)
{
int result = UpdateCardStateAndPermit(item.CardData, cardState);
if (result < 1)
{
resultList.Add(item);
}
}
return resultList;
}
private static int UpdateCardStateAndPermit(int CardData, int CardState)
{
//string strSQL = "UPDATE CARDLIST SET CARDSTATE=@CARDSTATE WHERE CARDID=@CARDID";
SqlParameter[] spr = {
new SqlParameter("@CARDSTATE",CardState),
new SqlParameter("@CARDDATA",CardData),
new SqlParameter("@ReturnValue",SqlDbType.Int)
};