protected void btnDefault_Click(object sender, EventArgs e)
    {
        ResetFilter();

        // Load default selection
        ImportTypeEnum importType = ImportTypeEnum.Default;

        if (Settings.IsWebTemplate)
        {
            if (SiteInfoProvider.GetSitesCount() == 0)
            {
                // No site exists, overwrite all
                importType = ImportTypeEnum.AllNonConflicting;
            }
            else
            {
                // Some site exists, only new objects
                importType = ImportTypeEnum.New;
            }
        }

        DefaultSelectionParameters parameters = new DefaultSelectionParameters()
        {
            ObjectType       = base.ObjectType,
            SiteObjects      = base.SiteObject,
            ImportType       = importType,
            LoadTasks        = false,
            ClearProgressLog = true
        };

        Settings.LoadDefaultSelection(parameters);

        RaiseButtonPressed(sender, e);
    }
Ejemplo n.º 2
0
        public async Task <JsonResult> Import(ImportTypeEnum importType)
        {
            IFormFile file = Request.Form.Files[0];

            if (file == null)
            {
                throw new Abp.UI.UserFriendlyException("请选择文件!");
            }

            switch (importType)
            {
            case ImportTypeEnum.User:
                await ImportAdpter(file, ImportUserSample);

                break;

            case ImportTypeEnum.Role:
                await ImportAdpter(file, ImportRoleSample);

                break;

            default:
                throw new Abp.UI.UserFriendlyException("导入类型错误!");
            }

            return(Json(true));
        }
Ejemplo n.º 3
0
    protected void lnkSelectNew_Click(object sender, EventArgs e)
    {
        ImportTypeEnum importType = ImportSettings.ImportType;

        ImportSettings.ImportType = ImportTypeEnum.New;
        ImportSettings.LoadDefaultSelection(false);

        SaveSettings();

        ImportSettings.ImportType = importType;

        lblInfo.Text = GetString("ImportObjects.NewSelected");
    }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates the import object.
        /// </summary>
        /// <returns></returns>
        private IImportProcess CreateImportObject()
        {
            // Get the import type enum from the Transform Definition Options.
            ImportTypeEnum importType = Converter.ConvertTo <ImportTypeEnum>(_transformDef.Options.GetProperty <string>(GlobalResources.SYS_CONNECT_TRAN_TYPE_OPT));

            switch (importType)
            {
            case ImportTypeEnum.Authorize:
                return(new PushDataAuthorize());

            case ImportTypeEnum.Capture:
                return(new PushDataCapture());

            default:
                return(null);
            }
        }
Ejemplo n.º 5
0
    protected void btnDefault_Click(object sender, EventArgs e)
    {
        // Load default selection
        ImportTypeEnum importType = ImportTypeEnum.Default;

        if (Settings.IsWebTemplate)
        {
            if (SiteInfoProvider.GetSitesCount() == 0)
            {
                // No site exists, overwrite all
                importType = ImportTypeEnum.All;
            }
            else
            {
                // Some site exists, only new objects
                importType = ImportTypeEnum.New;
            }
        }

        Settings.LoadDefaultSelection(ObjectType, SiteObject, importType, true, false);
    }
        /// <summary>
        /// Creates a TransformDefinition object for a Push Style Connector.
        /// </summary>
        /// <param name="systemConnectorId">The id for the System Connector used to retrieve the connection properties.</param>
        /// <param name="impType">The import type.</param>
        /// <param name="updateOp">The update operation.</param>
        /// <returns></returns>
        protected TransformDefinition CreatePushStyleTransformDef(string systemConnectorId, ImportTypeEnum impType, eERPUpdateOperation updateOp)
        {
            TransformDefinition tfmDef   = _jobDef.CreateTransform();
            ITransformSetup     tfmSetup = new CustomConnectorTransformSetup();

            tfmSetup.InitialiseTransform(tfmDef);

            // Set the options for the connector.
            tfmDef.Options.SetProperty(GlobalResources.SYS_CONNECT_TRAN_TYPE_OPT, Convert.ToInt32(impType).ToString(), false);
            tfmDef.Options.SetProperty(GlobalResources.SYS_CONNECT_SYSID_OPT, systemConnectorId, false);
            tfmDef.Options.SetProperty(GlobalResources.SYS_CONNECT_UPDATE_OP_OPT, Convert.ToInt32(updateOp).ToString(), false);
            tfmDef.Options.SetProperty(GlobalResources.CUS_CONNECT_ASSEMBLY_NAME_OPT, TestConstants.ASSEMBLY_NAME, false);

            tfmDef.AuditDefinition.ErrorAction = eTransformErrorAction.eTransformErrorActionAbort;

            return(tfmDef);
        }