コード例 #1
0
        public void DoTransfer()
        {
            int handle = 0;

            Global.BCCInit();
            //make a new bcc handle
            handle         = BCCHelper.NewXpackHandle(@"KSLib\cpack.dat");
            importedAmount = 0.0d;
            importedCnt    = 0;
            errors         = new List <string>();
            DateTime start = DateTime.Now;

            foreach (DataRow dr in dataSource.Rows)
            {
                BCCHelper.ResetPackHandle(handle);
                DoSingleEntryTrans(dr, handle);
            }
            AllEntryCompletedEventArgs e = new AllEntryCompletedEventArgs(dataSource.Rows.Count, "All Completed!");
            StringBuilder summary        = new StringBuilder();

            summary.Append(System.Environment.NewLine + "结果汇总:" + System.Environment.NewLine);
            summary.Append("\t原始记录数:" + dataSource.Rows.Count + System.Environment.NewLine);
            summary.Append("\t导入开始时间:" + start.ToString() + System.Environment.NewLine);
            summary.Append("\t导入结束时间:" + DateTime.Now.ToString() + System.Environment.NewLine);
            summary.AppendFormat("\t成功处理:{0}条,总金额:{1} {2}", importedCnt, importedAmount, System.Environment.NewLine);
            summary.Append("\t未能导入的名单如下:" + System.Environment.NewLine);
            summary.AppendFormat("{0}", FormatListToString(errors));
            e.Errors  = errors;
            e.Summary = summary.ToString();
            OnAllEntryCompleted(e);
        }
コード例 #2
0
 protected virtual void OnAllEntryCompleted(AllEntryCompletedEventArgs e)
 {
     if (AllEntryCompleted != null)
     {
         AllEntryCompleted(this, e);
     }
 }
コード例 #3
0
ファイル: DataTransfer.cs プロジェクト: nykma/ykt4sungard
        public void DoTransfer()
        {
            int handle = 0;
            Global.BCCInit();
            //make a new bcc handle
            handle = BCCHelper.NewXpackHandle(@"KSLib\cpack.dat");
            importedAmount = 0.0d;
            importedCnt = 0;
            errors = new List<string>();
            DateTime start = DateTime.Now;

            foreach (DataRow dr in dataSource.Rows)
            {
                BCCHelper.ResetPackHandle(handle);
                DoSingleEntryTrans(dr, handle);
            }
            AllEntryCompletedEventArgs e = new AllEntryCompletedEventArgs(dataSource.Rows.Count, "All Completed!");
            StringBuilder summary = new StringBuilder();
            summary.Append(System.Environment.NewLine+"结果汇总:" + System.Environment.NewLine);
            summary.Append("\t原始记录数:" + dataSource.Rows.Count + System.Environment.NewLine);
            summary.Append("\t导入开始时间:" + start.ToString() + System.Environment.NewLine);
            summary.Append("\t导入结束时间:" + DateTime.Now.ToString() + System.Environment.NewLine);
            summary.AppendFormat("\t成功处理:{0}条,总金额:{1} {2}", importedCnt, importedAmount,System.Environment.NewLine);
            summary.Append("\t未能导入的名单如下:" + System.Environment.NewLine);
            summary.AppendFormat("{0}",FormatListToString(errors));
            e.Errors = errors;
            e.Summary = summary.ToString();
            OnAllEntryCompleted(e);
        }
コード例 #4
0
ファイル: DataTransfer.cs プロジェクト: nykma/ykt4sungard
 protected virtual void OnAllEntryCompleted(AllEntryCompletedEventArgs e)
 {
     if (AllEntryCompleted != null)
         AllEntryCompleted(this, e);
 }