62,074
社区成员
发帖
与我相关
我的任务
分享
DataSet ds = GetTankDelivery();
int UpdateRecords = ds.Tables[0].Rows.Count;
if (UpdateRecords == 0)
{...}
else
{
string StartID = ds.Tables[0].Rows[0][0].ToString();
long EndID = Int64.Parse(ds.Tables[0].Rows[UpdateRecords - 1][0].ToString());
OnlineWebService.WebService oWebService = new OnlineWebService.WebService();
// Import data to BI
if (oWebService.ProcessTankDelivery(ds))
{
string Result = UpdateTankProductVolumeHistory_Flag(EndID);
if (Result == "Success")
{ ...}
else
{
log.Error("[" + state.ToString() + "]--Update table flag fail, return: " + Result);
}
}
else
{...}
}
private static string runStoredProcedure(string spName, List<SqlParameter> parameters)
{
SqlConnection conn;
SqlCommand myCmd;
using (conn = new SqlConnection(Properties.Settings.Default.ConnectionString))
{
try
{
conn.Open();
myCmd = new SqlCommand(spName, conn);
myCmd.CommandType = CommandType.StoredProcedure;
myCmd.CommandTimeout = Int32.Parse(Properties.Settings.Default.GlobalDatabaseTimeout);
// Set up parameters
foreach (SqlParameter param in parameters)
{
myCmd.Parameters.Add(param);
}
myCmd.ExecuteNonQuery();
}
catch (SqlException oe)
{...
return (oe.Message);
}
catch (Exception e)
{...}
conn.Close();
conn.Dispose();
conn = null;
GC.Collect();
}
return ("Success");
}
private List<SqlParameter> parameters = new List<SqlParameter>();
...
public string UpdateTankProductVolumeHistory_Flag(long HistoryID)
{
parameters.Clear();
parameters.Add(new SqlParameter("@intHistory", HistoryID));
return runStoredProcedure("usp_eFUEL_UpdateTankProductVolumeHistory_Flag", parameters);
}
DataSet ds = GetTankDelivery();
int UpdateRecords = ds.Tables[0].Rows.Count;
if (UpdateRecords == 0)
{...}
else
{
string StartID = ds.Tables[0].Rows[0][0].ToString();
long EndID = Int64.Parse(ds.Tables[0].Rows[UpdateRecords - 1][0].ToString());
OnlineWebService.WebService oWebService = new OnlineWebService.WebService();
// Import data to BI
if (oWebService.ProcessTankDelivery(ds))
{
string Result = UpdateTankProductVolumeHistory_Flag(EndID);
if (Result == "Success")
{...}
else
{
log.Error("[" + state.ToString() + "]--Update table flag fail, return: " + Result);
}
}
else
{...}
}