public void AddImportItem(string itemId, string groupId, string operatorUserId, string operatorUserName
            , string fromItemIid, string fromItemTitle, string fromItemPrice, string fromSellerNick, string fromShopTitle, string userId)
        {
            ImportItem itemEntity = new ImportItem();
            itemEntity.Id = itemId;
            itemEntity.OperatorUserId = operatorUserId;
            itemEntity.OperatorUserName = operatorUserName;
            itemEntity.ItsImportGroupId = groupId;
            itemEntity.ImportFormItemIid = fromItemIid;
            itemEntity.ImportFormItemTitle = fromItemTitle;
            itemEntity.ImportFormItemPrice = fromItemPrice;
            itemEntity.ImportFormSellerNick = fromSellerNick;
            itemEntity.ImportFormShopTitle = fromShopTitle;
            itemEntity.ImportState = ImportorEnumerations.ImportState.Waitting;
            itemEntity.ImportResult = ImportorEnumerations.ImportItemResult.Pending;
            itemEntity.ListDateTime = DateTime.Now;
            itemEntity.StartDateTime = null;
            itemEntity.FinishDateTime = null;

            itemEntity.CreateDate = DateTime.Now;
            itemEntity.CreateUserId = userId;
            itemEntity.LastUpdateDate = DateTime.Now;
            itemEntity.LastUpdateUserId = userId;

            ImportItemManager itemManager = new ImportItemManager();
            string sqlCreateItem = itemManager.GetCreateSql(itemEntity);

            using (DbOperator dbOperator = new DbOperator(ConnString))
            {
                try
                {
                    dbOperator.BeginTran();
                    dbOperator.ExecSql(sqlCreateItem);
                    dbOperator.CommintTran();
                }
                catch (Exception ex)
                {
                    dbOperator.RollbackTran();
                    throw new FacadeException("添加导入项发生异常 - ", ex);
                }
            }
        }
        public void StartImportItem(string itemId, int version, string userId)
        {
            ImportItem itemEntity = new ImportItem();
            itemEntity.Id = itemId;
            itemEntity.ImportState = ImportorEnumerations.ImportState.Importing;
            itemEntity.StartDateTime = DateTime.Now;

            itemEntity.LastUpdateDate = DateTime.Now;
            itemEntity.LastUpdateUserId = userId;
            itemEntity.CurrentVersion = version;

            ImportItemManager manager = new ImportItemManager();
            string sqlUpdateItem = manager.GetUpdateSql(itemEntity, "ImportState", "StartDateTime");

            #region 执行SQL以修改对象

            using (DbOperator dbOperator = new DbOperator(ConnString))
            {
                try
                {
                    dbOperator.BeginTran();
                    dbOperator.ExecSql(sqlUpdateItem);
                    dbOperator.CommintTran();
                }
                catch (Exception ex)
                {
                    dbOperator.RollbackTran();
                    throw new FacadeException("启动导入宝贝发生异常 - ", ex);
                }
            }

            #endregion
        }
        public void FinishImportItem(string groupId, int groupVersion, string itemId, int itemVersion
            , ImportorEnumerations.ImportItemResult result
            , string toItemIid, string toItemTitle, string toItemPrice, string toSellerNick, string toShopTitle
            , int successCount, int failCount, string message, string userId)
        {
            ImportGroup groupEntity = new ImportGroup();
            groupEntity.Id = groupId;
            groupEntity.SuccessCount = successCount;
            groupEntity.FailCount = failCount;

            groupEntity.LastUpdateDate = DateTime.Now;
            groupEntity.LastUpdateUserId = userId;
            groupEntity.CurrentVersion = groupVersion;

            ImportGroupManager managerGroup = new ImportGroupManager();
            string sqlUpdateGroup = managerGroup.GetUpdateSql(groupEntity, "SuccessCount", "FailCount");

            ImportItem itemEntity = new ImportItem();
            itemEntity.Id = itemId;
            itemEntity.ImportState = ImportorEnumerations.ImportState.Finished;
            itemEntity.ImportResult = result;
            itemEntity.FinishDateTime = DateTime.Now;
            itemEntity.ImportToItemIid = toItemIid;
            itemEntity.ImportToItemTitle = toItemTitle;
            itemEntity.ImportToItemPrice = toItemPrice;
            itemEntity.ImportToSellerNick = toSellerNick;
            itemEntity.ImportToShopTitle = toShopTitle;
            itemEntity.ResultMessage = message;

            itemEntity.LastUpdateDate = DateTime.Now;
            itemEntity.LastUpdateUserId = userId;
            itemEntity.CurrentVersion = itemVersion;

            ImportItemManager managerItem = new ImportItemManager();
            string sqlUpdateItem = managerItem.GetUpdateSql(itemEntity
                , "ImportState"
                , "ImportResult"
                , "FinishDateTime"
                , "ImportToItemIid"
                , "ImportToItemTitle"
                , "ImportToItemPrice"
                , "ImportToSellerNick"
                , "ImportToShopTitle"
                , "ResultMessage");

            #region 执行SQL以修改对象

            using (DbOperator dbOperator = new DbOperator(ConnString))
            {
                try
                {
                    dbOperator.BeginTran();
                    dbOperator.ExecSql(sqlUpdateGroup);
                    dbOperator.ExecSql(sqlUpdateItem);
                    dbOperator.CommintTran();
                }
                catch (Exception ex)
                {
                    dbOperator.RollbackTran();
                    throw new FacadeException("结束导入宝贝发生异常 - ", ex);
                }
            }

            #endregion
        }