示例#1
0
        /// <summary>
        /// 点击添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            DataListDataItemEditView view = new DataListDataItemEditView();

            view.WindowEntity   = this.HostAdapter.HostFormEntity;
            view.DataListEntity = this.HostAdapter.HostFormEntity.FindFormElementById(this.DataListId) as UIElementDataListEntity;
            if (view.ShowDialog() == DialogResult.OK)
            {
                DataListDeleteRowEvent.WhereItem data = new DataListDeleteRowEvent.WhereItem()
                {
                    DataColumn     = view.DataColumn,
                    DataColumnName = view.DataColumnName,
                    Source         = view.DataSource,
                    SourceName     = view.DataSourceName
                };

                this._wheres.Add(data);
            }
            view.Dispose();


            //using (FormEventDataListDataSet formEventDataListOperatorDataSetSet =
            //    new FormEventDataListDataSet(this.HostAdapter.HostFormEntity))
            //{

            //    formEventDataListOperatorDataSetSet.AllowDataSourceType = DataListDeleteRowDev.AllowDataDataSourceType;
            //    formEventDataListOperatorDataSetSet.AllowFormElementControlType = DataListDeleteRowDev.AllowFormElementControlType;

            //    if (this.TargetForm == EnumTargetWindow.Current)
            //        formEventDataListOperatorDataSetSet.DataListId = this.DataListId;

            //    if (formEventDataListOperatorDataSetSet.ShowDialog() == DialogResult.OK)
            //    {
            //        DataListDeleteRowEvent.WhereItem where = new DataListDeleteRowEvent.WhereItem()
            //        {
            //            DataColumn = formEventDataListOperatorDataSetSet.DataColumn,
            //            DataColumnName = formEventDataListOperatorDataSetSet.DataColumnName,
            //            Source = new DataSource(formEventDataListOperatorDataSetSet.SelectedDataSourceString),
            //            SourceName = formEventDataListOperatorDataSetSet.SelectedDataSourceVisibleString
            //        };

            //        this._wheres.Add(where);
            //    }
            //}
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            DataListDataItemEditView view = new DataListDataItemEditView();

            view.WindowEntity   = this.HostAdapter.HostFormEntity;
            view.DataListEntity = this.HostAdapter.HostFormEntity.FindFormElementById(this.DataListId) as UIElementDataListEntity;
            if (view.ShowDialog() == DialogResult.OK)
            {
                DataListAddRowEvent.DataItem data = new DataListAddRowEvent.DataItem()
                {
                    DataColumn     = view.DataColumn,
                    DataColumnName = view.DataColumnName,
                    Source         = view.DataSource,
                    SourceName     = view.DataSourceName
                };
                this._datas.Add(data);
            }
            view.Dispose();
        }