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

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

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

            case "clmDelete":
                if ((MessageBoxEx.Show("确定要删除该记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes))
                {
                    entity.IsDeleted    = 1;
                    entity.DeletionTime = DateTime.Now;
                    CommonDAO.GetInstance().SelfDber.Update <CmcsSetSampler>(entity);
                    BindData();
                }
                break;
            }
        }
コード例 #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FrmSetSampler_Oper frmShow = new FrmSetSampler_Oper(null, Enums.eEditMode.新增);

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