Esempio n. 1
0
        public void Update(long id, EImportStatus importState, int importCount, int totalCount)
        {
            string sql = string.Format("update {0} set {1} = @{1}, {2} = @{2}, {3} = @{3} where {4} = @{4}", T_TableName,
                C_ImportState, C_ImportCount, C_TotalCount, C_Id);

            DbParameter[] parameters = new DbParameter[]{
                new MySqlParameter(string.Format("@{0}", C_ImportState), importState),
                new MySqlParameter(string.Format("@{0}", C_ImportCount), importCount),
                new MySqlParameter(string.Format("@{0}", C_TotalCount), totalCount),
                new MySqlParameter(string.Format("@{0}", C_Id), id)
            };

            this.ExecuteNonQuery(sql, parameters);
        }
 public string GetExportStateInfo(EImportStatus state)
 {
     switch (state)
     {
         default:
         case EImportStatus.Init:
             return "未启动!";
         case EImportStatus.NotDetected:
             return "未检测到数据!";
         case EImportStatus.WaitForImport:
             return "待导入";
         case EImportStatus.Importing:
             return "正在导入。。。";
         case EImportStatus.Interrupt:
             return "已中断!";
         case EImportStatus.Imported:
             return "已导入!";
     }
 }
Esempio n. 3
0
        /// <summary>
        /// 更新文件处理进度。
        /// </summary>
        public void UpdateImportStatus(long id, EImportStatus importState)
        {
            string sql = string.Format("update {0} set {1} = @{1} where {2} = @{2}", T_TableName,
                C_ImportState, C_Id);

            DbParameter[] parameters = new DbParameter[]{
                new MySqlParameter(string.Format("@{0}", C_ImportState), importState),
                new MySqlParameter(string.Format("@{0}", C_Id), id)
            };

            this.ExecuteNonQuery(sql, parameters);
        }