jit推单功能除统计外完成
This commit is contained in:
1 parent
b05de6797e
commit
bbbc12148b
25 files changed
+3130
-1142
No files matched your search
@@ -2,10 +2,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
|
||||
namespace KJD_Web.Utils
|
||||
{
|
||||
@@ -379,6 +381,55 @@ namespace KJD_Web.Utils
|
||||
return null;
|
||||
}
|
||||
|
||||
public int ExecuteRecordsRows(string SqlString)
|
||||
{
|
||||
return ExecuteRecordsRows(SqlString, null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 返回更改、插入或删除的行数
|
||||
/// </summary>
|
||||
/// <param name="SqlString"></param>
|
||||
/// <param name="parms"></param>
|
||||
/// <returns></returns>
|
||||
public int ExecuteRecordsRows(string SqlString, MySqlParameter[] parms)
|
||||
{
|
||||
SleepOrGo();
|
||||
bool frist = true;
|
||||
Retry:
|
||||
if (Conn == null || Conn.State != ConnectionState.Open)
|
||||
ConnTo();
|
||||
try
|
||||
{
|
||||
CmdIni();
|
||||
cmd.CommandText = SqlString;
|
||||
if (parms != null)
|
||||
foreach (MySqlParameter pram in parms)
|
||||
cmd.Parameters.Add(pram);
|
||||
reader = cmd.ExecuteReader();
|
||||
if (reader.Read())
|
||||
return reader.RecordsAffected;
|
||||
return reader.RecordsAffected;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (e.Message.Contains("Illegal mix of collations"))
|
||||
return 0;
|
||||
if (frist)
|
||||
{
|
||||
frist = false;
|
||||
ErrorDoing(e.Message);
|
||||
goto Retry;
|
||||
}
|
||||
AddError(e.Message, SqlString);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseReader();
|
||||
IsRunning = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回插入ID
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user