Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FrmGoodsPlan_Oper frmEdit = new FrmGoodsPlan_Oper(Guid.NewGuid().ToString(), eEditMode.新增);

            if (frmEdit.ShowDialog() == DialogResult.OK)
            {
                BindData();
            }
        }
Пример #2
0
        private void superGridControl1_CellMouseDown(object sender, GridCellMouseEventArgs e)
        {
            CmcsGoodsPlan entity = Dbers.GetInstance().SelfDber.Get <CmcsGoodsPlan>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

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

            case "clmEdit":
                FrmGoodsPlan_Oper frmEdit = new FrmGoodsPlan_Oper(entity.Id, eEditMode.修改);
                if (frmEdit.ShowDialog() == DialogResult.OK)
                {
                    BindData();
                }
                break;

            case "clmDelete":
                // 查询正在使用该供应商的车数
                if (MessageBoxEx.Show("确定要删除该配置信息?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    try
                    {
                        Dbers.GetInstance().SelfDber.Delete <CmcsGoodsPlan>(entity.Id);
                    }
                    catch (Exception)
                    {
                        MessageBoxEx.Show("该配置信息正在使用中,禁止删除!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    BindData();
                }
                break;
            }
        }