示例#1
0
        public override void SetParameter(EventBase even)
        {
            DataListRefreshDev _event = even as DataListRefreshDev;
            DataListRefreshDevEditorAdapter adapter = this.HostAdapter as DataListRefreshDevEditorAdapter;
            string     dataEntityId = adapter.ParameterPanels.General.DataEntityId;
            DataEntity dataEntity   = _dataEntityComponentService.GetDataEntity(dataEntityId);

            this._wheres = new BindingList <DataListRefreshEvent.WhereItem>(_event.Where);
            this._warningTable.Clear();
            bool warningRow;

            foreach (DataListRefreshEvent.WhereItem where in _event.Where)
            {
                warningRow = false;
                DataItemEntity dataItemEntityDev = dataEntity.Items.GetEntityById(where.DataItem);
                if (dataItemEntityDev == null)
                {
                    where.DataItemName = String.Empty;
                    warningRow         = true;
                }
                else
                {
                    where.DataItemName = dataItemEntityDev.Name;
                }
                where.SourceName =
                    StringParserLogic.DataSourceVisibleString(this.HostAdapter.HostFormEntity, where.Source.ToString(), out warningRow);
                this._warningTable.Add(where, warningRow);
            }
            this.dataGridViewWhere.DataSource = this._wheres;
        }
示例#2
0
        public override void SetParameter(EventBase even)
        {
            DataListRefreshDev _event = even as DataListRefreshDev;

            if (_event.RefreshMode == DataListRefreshEvent.EnumRefreshMode.DataEntity)
            {
                this.radioButtonDataEntity.Checked = true;
            }
            else
            {
                this.radioButtonSql.Checked = true;
            }
            this.DataListId = _event.DataListId;
        }
        public static void CheckWarning(DataListRefreshDev entity)
        {
            entity.Warning.Clear();
            UIElementDataListEntity dataListEntity =
                entity.HostFormEntity.Elements.GetFormElementById(entity.DataListId) as UIElementDataListEntity;

            if (dataListEntity == null)
            {
                entity.Warning.AddWarningSign(entity, Language.Current.EventDev_RefreshListDev_DataListNotExist);
            }
            DataEntity dataEntity = null;

            if (dataListEntity != null)
            {
                dataEntity = _dataEntityComponentService.GetDataEntity(dataListEntity.DataEntityId);
                if (dataEntity == null)
                {
                    entity.Warning.AddWarningSign(entity, Language.Current.EventDev_RefreshListDev_DataEntityNotExist);
                }
            }
            foreach (DataListRefreshDev.WhereItem where in entity.Where)
            {
                if (dataEntity != null)
                {
                    if (dataEntity.Items.Contains(where.DataItem) == false)
                    {
                        entity.Warning.AddWarningSign(entity, Language.Current.EventDev_RefreshListDev_DataItemEntityNotExist);
                    }
                }
                if (where.Source.Type == EnumEventDataSource.FormElement)
                {
                    if (entity.HostFormEntity.Elements.Contains(where.Source.Source) == false)
                    {
                        entity.Warning.AddWarningSign(entity, Language.Current.EventDev_RefreshListDev_FormElementNotExist);
                    }
                }
            }
        }
        public override void SetParameter(EventBase even)
        {
            DataListRefreshDev _event = even as DataListRefreshDev;

            this.txtSqlRegex.Text = _event.SqlRegex;
        }