Beispiel #1
0
        private void Frm_FileNameFilterEdit_Load(object sender, EventArgs e)
        {
            builder = new FileNameFilterBuilder();
            adapter = new FileNameFilterAdapter();
            adapter.Initial(builder);

            repo_Cmb_Type.Items.Clear();
            repo_Cmb_Type.Items.AddRange(FileNameFilterInvoker.TravelType());
            repo_Cmb_Type.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            repo_Cmb_Location.Items.Clear();
            repo_Cmb_Location.Items.AddRange(FileNameFilterInvoker.TravelLocation());
            repo_Cmb_Location.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;

            gridHelper = new GridControlHelper(this.gridView1, this.gridControl1);
            gridHelper.GridControl.DataSource = builder.CreateDataTable();

            gridHelper.SetCellResposity(builder.Location, repo_Cmb_Location);
            gridHelper.SetCellResposity(builder.Type, repo_Cmb_Type);
            gridHelper.SetCellResposity(builder.Op_Delete, repo_HLE_Delete);
            gridHelper.SetColMaxWidth(builder.Op_Delete, 80);

            invoker = new FileNameFilterInvoker();
            if (string.IsNullOrEmpty(ResultJson) == false)
            {
                invoker.InitialFilter(ResultJson);
                adapter.NotifyfreshDataTable(invoker.Filters);
                gridHelper.GridControl.DataSource = adapter.ResultTable;
            }

            gridHelper.AddNewRowInputCallBack(this);
        }
Beispiel #2
0
        public override void onCreateDataRow(ref System.Data.DataRow tempRow, BaseDataTableBuilder builder, int RowIndex, BaseFileNameFilter t)
        {
            FileNameFilterBuilder targetBuilder = builder as FileNameFilterBuilder;

            tempRow[targetBuilder.Location]  = t.Location;
            tempRow[targetBuilder.Type]      = t.Type;
            tempRow[targetBuilder.KeyWord]   = t.KeyWord;
            tempRow[targetBuilder.Op_Delete] = targetBuilder.Op_Delete;
        }
Beispiel #3
0
        public override BaseFileNameFilter onDesrialize(BaseDataTableBuilder builder, System.Data.DataRow row, params object[] otherParam)
        {
            FileNameFilterBuilder targetBuilder = builder as FileNameFilterBuilder;
            BaseFileNameFilter    tempBean      = new ContainsFileNameFilter();

            tempBean.Location = row[targetBuilder.Location].ToString();
            tempBean.Type     = row[targetBuilder.Type].ToString();
            tempBean.KeyWord  = row[targetBuilder.KeyWord].ToString();
            return(tempBean);
        }