Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ChongGuanSafetySupervisionQZ.DAL.AreasDAL areasDAL = new DAL.AreasDAL();
            var t = areasDAL.Query(DateTime.Now.Second % 2);
            BindingList <QZ_Areas> tt = new BindingList <QZ_Areas>(t.Data.ToList());

            gridControl1.DataSource = tt;
            gridControl1.RefreshDataSource();
        }
Exemple #2
0
        private async void simpleButton1_Click(object sender, EventArgs e)
        {
            ChongGuanSafetySupervisionQZ.DAL.AreasDAL areasDAL = new DAL.AreasDAL();

            QZ_Areas qZ_Areas = new QZ_Areas {
                AreaId = "1", AreaLevel = 1, AreaName = "f**k", AreaPid = "1"
            };
            var t = await areasDAL.Add(qZ_Areas);


            BindingList <QZ_Areas> tt = new BindingList <QZ_Areas>();

            tt.Add(t);

            gridControl1.DataSource = tt;
            gridControl1.RefreshDataSource();
        }
Exemple #3
0
        private void button4_Click(object sender, EventArgs e)
        {
            ChongGuanSafetySupervisionQZ.DAL.AreasDAL areasDAL = new DAL.AreasDAL();
            var areaList = areasDAL.Query();

            BindingList <QZ_Areas> tt = new BindingList <QZ_Areas>(areaList.Data.ToList());

            //this.treeListLookUpEdit1.

            //this.treeListLookUpEdit1.DataBindings.Clear();
            this.treeListLookUpEdit1.Properties.DataSource               = tt;
            this.treeListLookUpEdit1.Properties.TreeList.KeyFieldName    = "AreaId";
            this.treeListLookUpEdit1.Properties.TreeList.ParentFieldName = "AreaPid";
            this.treeListLookUpEdit1.Properties.DisplayMember            = "AreaName";
            this.treeListLookUpEdit1.Properties.ValueMember              = "AreaId";
            this.treeListLookUpEdit1.EditValue = tt[0].AreaId;

            this.treeListLookUpEdit1.Properties.TreeList.Columns[0].Caption = "部门所在地";
            this.treeListLookUpEdit1.Properties.TreeList.Columns[1].Visible = false;
        }