コード例 #1
0
        public static void UpdateImportDate(string tradeDate, string tableName, DateTime date)
        {
            ImportRecordTable service = new ImportRecordTable();
            if (!service.Open())
                return;

            ImportRecordRow info = service.GetImportRecordRow(tradeDate, tableName);
            if (info != null)
            {
                service.UpdateImportDate(info.Id, date);
            }
            service.Close();
        }
コード例 #2
0
ファイル: ImportItem.cs プロジェクト: GemHu/ExportManager
        /// <summary>
        /// 将本地的文件导入状态同步到数据库。
        /// </summary>
        public virtual void SyncImportState2Remote()
        {
            if (string.IsNullOrEmpty(this.DateName) || string.IsNullOrEmpty(this.TableName))
                return;

            ImportRecordTable service = new ImportRecordTable();
            if (!service.Open())
                return;

            ImportRecordRow info = service.GetImportRecordRow(this.DateName, this.TableName);
            if (info == null)
            {
                info = new ImportRecordRow();
                info.TradeDate = DateName;
                info.TableName = this.TableName;
                info.SourceType = this.SourceType;
                info.ImportState = this.ImportState;
                info.ImportDate = System.DateTime.Now;
                service.Add(info);
            }
            else
            {
                //service.UpdateImportStatus(info.Id, this.ImportState);
                service.Update(info.Id, this.ImportState, this.CurrentIndex, this.TotalCount);
            }

            service.Close();
        }