public void Cancel(int LotteryId, string title, int state) { using (SqlConnection sqlConnection = new SqlConnection(ComData.connectionString)) { sqlConnection.Open(); SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = sqlConnection; SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(); sqlDataAdapter.SelectCommand = sqlCommand; try { string str = LotteryUtils.LotteryTitle(LotteryId); if (state == 0) { sqlDataAdapter.SelectCommand.CommandType = CommandType.Text; sqlDataAdapter.SelectCommand.CommandText = "select * From N_UserBet with(nolock) where state=0 and LotteryId='" + LotteryId.ToString() + "' and IssueNum='" + title + "' order by id asc"; } else { sqlDataAdapter.SelectCommand.CommandType = CommandType.Text; sqlDataAdapter.SelectCommand.CommandText = "select * From N_UserBet with(nolock) where (state<>0 and state<>1) and LotteryId='" + LotteryId.ToString() + "' and IssueNum='" + title + "' order by id asc"; } DataTable dataTable = new DataTable(); sqlDataAdapter.Fill(dataTable); foreach (DataRow row in (InternalDataCollectionBase)dataTable.Rows) { int int32 = Convert.ToInt32(row["id"].ToString()); Convert.ToInt32(row["UserId"].ToString()); if (!CheckOperation.AdminCancel(int32, sqlCommand)) { new LogExceptionDAL().Save("派奖异常", str + " 投注ID:" + (object)int32 + "撤单"); } } } catch (Exception ex) { new LogExceptionDAL().Save("程序异常", ex.Message); } finally { if (sqlConnection != null) { sqlConnection.Close(); } } } }
public void CancelOfBetId(string betId) { using (SqlConnection sqlConnection = new SqlConnection(ComData.connectionString)) { sqlConnection.Open(); SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = sqlConnection; try { CheckOperation.AdminCancel(Convert.ToInt32(betId), sqlCommand); } catch (Exception ex) { new LogExceptionDAL().Save("程序异常", ex.Message); } finally { if (sqlConnection != null) { sqlConnection.Close(); } } } }
public void Cancel(int LotteryId, string title, int state) { using (SqlConnection sqlConnection = new SqlConnection(ComData.connectionString)) { sqlConnection.Open(); SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = sqlConnection; SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(); sqlDataAdapter.SelectCommand = sqlCommand; try { string text = LotteryUtils.LotteryTitle(LotteryId); if (state == 0) { sqlDataAdapter.SelectCommand.CommandType = CommandType.Text; sqlDataAdapter.SelectCommand.CommandText = string.Concat(new string[] { "select * From N_UserBet with(nolock) where state=0 and LotteryId='", LotteryId.ToString(), "' and IssueNum='", title, "' order by id asc" }); } else { sqlDataAdapter.SelectCommand.CommandType = CommandType.Text; sqlDataAdapter.SelectCommand.CommandText = string.Concat(new string[] { "select * From N_UserBet with(nolock) where (state<>0 and state<>1) and LotteryId='", LotteryId.ToString(), "' and IssueNum='", title, "' order by id asc" }); } DataTable dataTable = new DataTable(); sqlDataAdapter.Fill(dataTable); foreach (DataRow dataRow in dataTable.Rows) { int num = Convert.ToInt32(dataRow["id"].ToString()); Convert.ToInt32(dataRow["UserId"].ToString()); if (!CheckOperation.AdminCancel(num, sqlCommand)) { new LogExceptionDAL().Save("派奖异常", string.Concat(new object[] { text, " 投注ID:", num, "撤单" })); } } } catch (Exception ex) { new LogExceptionDAL().Save("程序异常", ex.Message); } finally { if (sqlConnection != null) { sqlConnection.Close(); } } } }