コード例 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            DataListRefreshDevEditorAdapter adapter = this.HostAdapter as DataListRefreshDevEditorAdapter;

            using (FormEventDataItemDataSet formEventDataItemDataSet =
                       new FormEventDataItemDataSet(this.HostAdapter.HostFormEntity))
            {
                formEventDataItemDataSet.DataEntityId                = adapter.ParameterPanels.General.DataEntityId;
                formEventDataItemDataSet.AllowDataSourceType         = DataListRefreshDev.AllowWhereSetDataSourceType;
                formEventDataItemDataSet.AllowFormElementControlType = DataListRefreshDev.AllowWhereSetFormElementControlType;
                if (formEventDataItemDataSet.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                DataListRefreshEvent.WhereItem where = new DataListRefreshEvent.WhereItem()
                {
                    DataItem     = formEventDataItemDataSet.SelectedDataItemId,
                    DataItemName = formEventDataItemDataSet.SelectedDataItemName,
                    Source       = new DataSource(formEventDataItemDataSet.SelectedDataSourceString),
                    SourceName   = formEventDataItemDataSet.SelectedDataSourceVisibleString,
                    MatchType    = EnumMatchType.Equal
                };
                this._wheres.Add(where);
            }
        }
コード例 #2
0
        /// <summary>
        /// 添加条件设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddWhere_Click(object sender, EventArgs e)
        {
            using (FormEventDataItemDataSet formEventDataItemDataSet =
                       new FormEventDataItemDataSet(this.HostAdapter.HostFormEntity))
            {
                formEventDataItemDataSet.DataEntityId = this.DataEntityId;

                formEventDataItemDataSet.AllowDataSourceType = DeleteDataDev.AllowDataSourceType;

                formEventDataItemDataSet.AllowFormElementControlType = DeleteDataDev.AllowFormElementControlType;

                if (formEventDataItemDataSet.ShowDialog() == DialogResult.OK)
                {
                    DeleteDataEvent.WhereItem where = new DeleteDataEvent.WhereItem()
                    {
                        DataItem     = formEventDataItemDataSet.SelectedDataItemId,
                        DataItemName = formEventDataItemDataSet.SelectedDataItemName,
                        Source       = new DataSource(formEventDataItemDataSet.SelectedDataSourceString),
                        SourceName   = formEventDataItemDataSet.SelectedDataSourceVisibleString,
                        MatchType    = EnumMatchType.Equal
                    };

                    this._wheres.Add(where);
                }
            }
        }
        /// <summary>
        /// 添加加载数据设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddLoad_Click(object sender, EventArgs e)
        {
            LoadDataToFormDevEditorAdapter adapter = this.HostAdapter as LoadDataToFormDevEditorAdapter;

            if (adapter.ParameterPanels.General.Mode == LoadDataToFormEvent.EnumLoadDataToFormMode.DataEntity &&
                adapter.ParameterPanels.DataEntity.DataEntityId == String.Empty)
            {
                MessageBox.Show(
                    Language.Current.UserControlEventEditorPanel_LoadDataToForm_Load_MessageChooseDataEntityFirst,
                    CommonLanguage.Current.MessageCaption_Notice,
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            using (FormEventDataItemDataSet formEventDataItemDataSet = new FormEventDataItemDataSet(this.HostAdapter.HostFormEntity))
            {
                formEventDataItemDataSet.DataSourceLabel             = Language.Current.FormEventDataItemDataSet_LabelDataSource_LoadTo;
                formEventDataItemDataSet.AllowDataSourceType         = LoadDataToFormDev.AllowLoadDataDataSourceType;
                formEventDataItemDataSet.AllowFormElementControlType = LoadDataToFormDev.AllowFormElementControlType;

                if (adapter.ParameterPanels.General.Mode == LoadDataToFormEvent.EnumLoadDataToFormMode.DataEntity)
                {
                    formEventDataItemDataSet.DataEntityId = adapter.ParameterPanels.DataEntity.DataEntityId;
                }
                else
                {
                    formEventDataItemDataSet.DataEntityId = null;
                }

                if (formEventDataItemDataSet.ShowDialog() == DialogResult.OK)
                {
                    LoadDataToFormEvent.LoadItem load = new LoadDataToFormEvent.LoadItem()
                    {
                        DataItem     = formEventDataItemDataSet.SelectedDataItemId,
                        DataItemName = formEventDataItemDataSet.SelectedDataItemName,
                        Source       = new DataSource(formEventDataItemDataSet.SelectedDataSourceString),
                        SourceName   = formEventDataItemDataSet.SelectedDataSourceVisibleString
                    };

                    this._loads.Add(load);
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// 添加更新数据设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddUpdate_Click(object sender, EventArgs e)
        {
            using (FormEventDataItemDataSet formEventDataItemDataSet =
                       new FormEventDataItemDataSet(this.HostAdapter.HostFormEntity))
            {
                formEventDataItemDataSet.DataEntityId                = this._formDataEntityTreeChoose.SelectedId;
                formEventDataItemDataSet.AllowDataSourceType         = UpdateFormDataDev.AllowDataSourceType;
                formEventDataItemDataSet.AllowFormElementControlType = UpdateFormDataDev.AllowFormElementControlType;

                if (formEventDataItemDataSet.ShowDialog() == DialogResult.OK)
                {
                    UpdateFormDataEvent.UpdateItem update = new UpdateFormDataEvent.UpdateItem()
                    {
                        DataItem     = formEventDataItemDataSet.SelectedDataItemId,
                        DataItemName = formEventDataItemDataSet.SelectedDataItemName,
                        Source       = new DataSource(formEventDataItemDataSet.SelectedDataSourceString),
                        SourceName   = formEventDataItemDataSet.SelectedDataSourceVisibleString,
                    };

                    this._updates.Add(update);
                }
            }
        }