1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Collections;
- using System.Data;
- using WdtUtils;
- namespace TempDbToWang
- {
- /// <summary>
- /// 中间库上传旺店通基类
- /// </summary>
- public abstract class BaseUpload : IUploadToWang
- {
- #region 变量定义
- protected DataTable _data = new DataTable();
- #endregion
- /// <summary>
- /// 上传数据至旺店通
- /// </summary>
- /// <param name="args"></param>
- public void UploadToWang(Hashtable args)
- {
- _PrepareData(args);
- foreach (DataRow item in _data.Rows)
- {
- _WriteLog(_Upload(item),item);
- }
- }
- /// <summary>
- /// 数据准备
- /// </summary>
- /// <param name="args"></param>
- protected abstract void _PrepareData(Hashtable args);
- /// <summary>
- /// 导入单据
- /// </summary>
- /// <param name="dr"></param>
- /// <returns></returns>
- protected abstract AddResult _Upload(DataRow dr);
- /// <summary>
- /// 写日志
- /// </summary>
- /// <param name="flag"></param>
- /// <param name="dr"></param>
- protected abstract void _WriteLog(AddResult result,DataRow dr);
- protected abstract string _GetData(DataRow dr);
- }
- }
|