private int AddNewstoDB(NewsModels newsModels, string dateTimeStr, string jsonStr, string cid, string cName, string type)
{
bool flag = false;
string errorMessage = string.Empty;
int num = 0;
int num2 = 0;
int num3 = 1;
foreach (NewsModel model in newsModels.news)
{
model.title = HttpHelper.GetHtmlTxt(model.title).Replace("br", ",");
if (string.IsNullOrEmpty(model.title))
{
base.BeginInvoke(this.logInvoke, new object[] {"<img src="{model.photo}" title="{model.url}" />";
num3 = 3;
}
else
{
this.ParseImage(model);
}
if (string.IsNullOrEmpty(model.content))
{
if (string.IsNullOrEmpty(model.url))
{
goto Label_042F;
}
model.content ="更新数据库出现异常:{exception.Message}" });
this.WriteException(exception);
this.WriteErrorNewsJsonFile(exception.Message, dateTimeStr, jsonStr, cid, cName);
goto Label_042F;
}
}
try
{
SqlHelper.ExecuteNonQuery(str4, CommandType.Text, new SqlParameter[] { new SqlParameter("@articleTitle", model.title), new SqlParameter("@articleContent", model.content), new SqlParameter("@articleType", num3), new SqlParameter("@cid", cid), new SqlParameter("@articleTime", Convert.ToDateTime(model.date)), new SqlParameter("@articleAuthor", model.author), new SqlParameter("@uid", 0x3e8), new SqlParameter("@articleSource", model.from), new SqlParameter("@sid", model.id) });
num++;
}
catch (Exception exception2)
{
base.BeginInvoke(this.logInvoke, new object[] {"[ {cid}.{cName} ] 新增 {num} 条 , 更新 {num2} 条" });
return num;
}

"<img src="{model.photo}" title="{model.url}" />";








网友评论