Ejemplo n.º 1
0
        void ucToolBar_OnAddClick(object sender, EventArgs e)
        {
            EditTestFrm editFrm = new EditTestFrm();

            editFrm.FormClosed += new FormClosedEventHandler(editFrm_FormClosed);
            editFrm.ShowDialog();
        }
Ejemplo n.º 2
0
        private void dgvDataSource_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (DataGridViewActionButtonCell.IsModifyButtonClick(sender, e))
            {
                string objectId = dgvDataSource["ColAction", e.RowIndex].Value.ToString(); // 获取所要修改关联对象的主键
                DASP.Domain.Entitys.TBTestDataEntity entity = testDataManager.Get(Guid.Parse(objectId));
                EditTestFrm editFrm = new EditTestFrm(entity);
                editFrm.FormClosed += new FormClosedEventHandler(editFrm_FormClosed);
                editFrm.ShowDialog();
            }

            if (DataGridViewActionButtonCell.IsDeleteButtonClick(sender, e))
            {
                string objectId = dgvDataSource["ColAction", e.RowIndex].Value.ToString(); // 获取所要删除关联对象的主键
            }
        }