Ejemplo n.º 1
0
        private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e)
        {
            CmcsNoSampler entity = Dbers.GetInstance().SelfDber.Get <CmcsNoSampler>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

            switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name)
            {
            case "clmShow":
                FrmNoSampler_Oper frmShow = new FrmNoSampler_Oper(entity, Enums.eEditMode.查看);
                if (frmShow.ShowDialog() == DialogResult.OK)
                {
                    BindData();
                }
                break;

            case "clmEdit":
                FrmNoSampler_Oper frmShow2 = new FrmNoSampler_Oper(entity, Enums.eEditMode.修改);
                if (frmShow2.ShowDialog() == DialogResult.OK)
                {
                    BindData();
                }
                break;

            case "clmDelete":
                if ((MessageBoxEx.Show("确定要删除该记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes))
                {
                    CommonDAO.GetInstance().SelfDber.Delete <CmcsNoSampler>(entity.Id);
                    BindData();
                }
                break;
            }
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FrmNoSampler_Oper frmShow = new FrmNoSampler_Oper(null, Enums.eEditMode.新增);

            if (frmShow.ShowDialog() == DialogResult.OK)
            {
                BindData();
            }
        }