Exemplo n.º 1
0
        protected override void BtnAdd_Click(object sender, EventArgs e)
        {
            StaffClassVo depVo = new StaffClassVo();

            classList.Add(depVo);
            this.gridControl1.RefreshDataSource();
        }
Exemplo n.º 2
0
        protected override void BtnDel_Click(object sender, EventArgs e)
        {
            StaffClassVo vo = (StaffClassVo)this.gridView1.GetRow(this.gridView1.FocusedRowHandle);

            if (vo == null)
            {
                return;
            }
            classList.Remove(vo);
            if (DeleteDao.DeleteByID(vo.StaffClassID, typeof(StaffClassVo)) > 0)
            {
                XtraMessageBox.Show("删除成功");
                RefreshClass();
            }
            this.gridControl1.DataSource = classList;
            this.gridControl1.RefreshDataSource();
        }