using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using cuidian.Sql;
using OperationLog;
namespace TempDbToUfida.Sql
{
///
/// 基础资料下载(直接sql插入)
///
public abstract class BaseDataDownLoad : BaseDownLoad
{
///
/// 插入用友系统
///
///
///
protected virtual bool _InsertData(string sql)
{
bool flag = false;
try
{
DbUtils.ExecuteNonQuery(sql, _tragetCon);
flag = true;
}
catch (Exception ex)
{
Utils.WriteErrorLog(_operType,ex.Message);
}
return flag;
}
///
/// 构造检查重复值语句
///
///
///
protected virtual string _buildCheckSql(DataRow dr)
{
return string.Empty;
}
protected override void _Process(DataRow dr)
{
if (_CheckDup(_buildCheckSql(dr))) return;
if (_InsertData(_buildInsertSql(dr)))
{
Utils.UpdateTempRecord(_buildUpdSql(dr));
}
}
protected virtual string _buildInsertSql(DataRow dr)
{
return string.Empty;
}
}
}