コード例 #1
0
 public static void CheckWarning(SaveDataDev entity)
 {
     entity.Warning.Clear();
     if (entity.SaveMode == SaveDataEvent.EnumSaveDataMode.DataEntity)
     {
         DataEntity dataEntity = _dataEntityComponentService.GetDataEntity(entity.DataEntityId);
         if (dataEntity == null)
         {
             entity.Warning.AddWarningSign(entity, Language.Current.EventDev_SaveFormDataDev_DataEntityNotExist);
         }
         DataSourceProvideArgs args = new DataSourceProvideArgs()
         {
             WindowEntity = entity.HostFormEntity
         };
         foreach (SaveDataEvent.SaveItem save in entity.Save)
         {
             if (dataEntity != null)
             {
                 if (dataEntity.Items.Contains(save.DataItem) == false)
                 {
                     entity.Warning.AddWarningSign(entity, Language.Current.EventDev_SaveFormDataDev_DataItemEntityNotExist);
                 }
             }
             if (_dataSourceProvideFactory.Validate(save.Source, args) == false)
             {
                 entity.Warning.AddWarningSign(entity, Language.Current.EventDev_SaveFormDataDev_FormElementNotExist);
             }
         }
     }
 }
        public override void SetParameter(EventBase even)
        {
            SaveDataDev _event = even as SaveDataDev;

            this.txtName.Text = _event.Name;
            this.txtCode.Text = _event.Code;
        }
コード例 #3
0
        public override void SetParameter(EventBase even)
        {
            SaveDataDev _event = even as SaveDataDev;

            this.DataEntityId = _event.DataEntityId;
            this._formDataEntityTreeChoose.SelectedId = this.DataEntityId;

            DataEntity dataEntity = _dataEntityComponentService.GetDataEntity(this.DataEntityId);

            this._saves = new BindingList <SaveDataEvent.SaveItem>(_event.Save);
            this._warningTable.Clear();

            //为用于显示的DataColumnName和SourceName赋值
            bool warningRow            = false;
            DataSourceProvideArgs args = new DataSourceProvideArgs()
            {
                WindowEntity = this.HostAdapter.HostFormEntity
            };

            foreach (SaveDataEvent.SaveItem save in _saves)
            {
                save.SourceName = DataSourceProvideFactory.Instance.GetDisplayString(save.Source, args);
                if (String.IsNullOrEmpty(save.SourceName))
                {
                    warningRow = true;
                }

                DataItemEntity dataItemEntity = dataEntity.Items.GetEntityById(save.DataItem);
                if (dataItemEntity == null)
                {
                    save.DataItemName = String.Empty;
                    warningRow        = true;
                }
                else
                {
                    save.DataItemName = dataItemEntity.Name;
                }

                _warningTable.Add(save, warningRow);
            }

            this.dataGridViewSaveData.DataSource = this._saves;
        }
        public override void SetParameter(EventBase even)
        {
            SaveDataDev _event = even as SaveDataDev;

            this.txtSqlRegex.Text = _event.SqlRegex;
        }