123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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
- {
- /// <summary>
- /// 基础资料下载(直接sql插入)
- /// </summary>
- public abstract class BaseDataDownLoad : BaseDownLoad
- {
- /// <summary>
- /// 插入用友系统
- /// </summary>
- /// <param name="sql"></param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 构造检查重复值语句
- /// </summary>
- /// <param name="dr"></param>
- /// <returns></returns>
- 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;
- }
-
- }
- }
|