Esempio n. 1
0
        private void Frm_TechniqueStateUpdate_Load(object sender, EventArgs e)
        {
            controller = new TechniqueController();
            controller.CurrentObjectID = TechniqueID;
            controller.LoadEntry();

            tv_MissionName.Text = controller.Entry.Name;
            tv_State.Text       = controller.Entry.Status;

            gridHelper = new GridControlHelper(this.gridView1, this.gridControl1);

            adapter = new TB_TechniqueMissionStateAdapter();
            builder = new TB_TechniqueMissionStateBuilder();
            adapter.Initial(builder);
            adapter.NotifyfreshDataTable(new TechniqueMissionController().FindMissionByTechniqueID(controller.CurrentObjectID));

            gridHelper.GridControl.DataSource = adapter.ResultTable;
            gridHelper.SetAllColumnEditable(false);
            gridHelper.SetAllColumnVisible(false);
            gridHelper.SetColunmOption(builder.Cal_IsFinish, false, true);
            gridHelper.SetColunmOption(builder.FinishDate, false, true);
            gridHelper.SetColunmOption(builder.CreateDate, false, true);
            gridHelper.SetColunmOption(builder.Name, false, true);
            gridHelper.Group(builder.Cal_IsFinish);
            gridHelper.GridView.ExpandAllGroups();
            gridHelper.GridView.GroupFormat = "{1}";
        }
Esempio n. 2
0
        public void onCreateComponet()
        {
            builder_Mission = new TB_TechniqueMissionStateBuilder();
            adapter_Mission = new TB_TechniqueMissionStateAdapter();
            adapter_Mission.Initial(builder_Mission);
            gridHelper_Mission = new GridControlHelper(this.gridView1, this.gridControl1);

            adapter_Log = new TB_TechniqueLogAdapter();
            builder_Log = new TB_TechniqueLogBuilder();
            adapter_Log.Initial(builder_Log);

            this.gridControl2.DataSource = builder_Log.CreateDataTable();

            GridBand band_Date = new GridBand()
            {
                Caption = "日期"
            };
            GridBand band_Info = new GridBand()
            {
                Caption = "信息"
            };
            GridBand band_Op = new GridBand()
            {
                Caption = "操作"
            };
            GridBand band_ID = new GridBand()
            {
                Caption = "ID", Visible = false
            };

            this.advBandedGridView1.Bands.Clear();
            this.advBandedGridView1.Bands.AddRange(new GridBand[] { band_ID, band_Date, band_Info, band_Op });


            BandedGridColumn col_Date = new BandedGridColumn {
                FieldName = builder_Log.Date, Visible = true
            };
            BandedGridColumn col_Context = new BandedGridColumn {
                FieldName = builder_Log.Context, Visible = true
            };
            BandedGridColumn col_Url = new BandedGridColumn {
                FieldName = builder_Log.LogUrl, Visible = true
            };
            BandedGridColumn col_OpDelete = new BandedGridColumn {
                FieldName = builder_Log.Op_Delete, Visible = true
            };
            BandedGridColumn col_OpEdit = new BandedGridColumn {
                FieldName = builder_Log.Op_Edit, Visible = true
            };
            BandedGridColumn col_ID = new BandedGridColumn {
                FieldName = builder_Log.ID, Visible = false
            };

            UpdateColumnOption(col_Date, band_Date, false, true, 0);
            UpdateColumnOption(col_Context, band_Info, false, false, 0);
            UpdateColumnOption(col_Url, band_Info, false, false, 1);
            UpdateColumnOption(col_OpDelete, band_Op, false, true, 0);
            UpdateColumnOption(col_OpEdit, band_Op, false, true, 1);
            UpdateColumnOption(col_ID, band_ID, false, true, 0);

            advBandedGridView1.OptionsView.ColumnAutoWidth = true;
            advBandedGridView1.OptionsView.ShowBands       = false;
            advBandedGridView1.RowHeight = 35;
            advBandedGridView1.OptionsView.ShowColumnHeaders = false;
            band_Date.OptionsBand.FixedWidth = true;
            band_Op.OptionsBand.FixedWidth   = true;

            this.advBandedGridView1.Columns[builder_Log.Op_Delete].ColumnEdit = repo_HLE_delete;
            this.advBandedGridView1.Columns[builder_Log.Op_Delete].OptionsColumn.AllowEdit = true;

            this.advBandedGridView1.Columns[builder_Log.LogUrl].ColumnEdit = repo_HLE_gotoURL;
            this.advBandedGridView1.Columns[builder_Log.LogUrl].OptionsColumn.AllowEdit = true;

            this.advBandedGridView1.Columns[builder_Log.Op_Edit].ColumnEdit = repo_HLE_edit;
            this.advBandedGridView1.Columns[builder_Log.Op_Edit].OptionsColumn.AllowEdit = true;
        }