コード例 #1
0
        private void btnInStore_Click(object sender, EventArgs e)
        {
            FrmSupplyReceive_Oper frm = new FrmSupplyReceive_Oper();

            frm.ShowDialog();

            BindData();
        }
コード例 #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FrmSupplyReceive_Oper frmEdit = new FrmSupplyReceive_Oper(Guid.NewGuid().ToString(), eEditMode.新增);

            if (frmEdit.ShowDialog() == DialogResult.OK)
            {
                BindData();
            }
        }
コード例 #3
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            FrmSupplyReceive_Oper frmEdit = new FrmSupplyReceive_Oper(String.Empty, true);

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

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

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

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

                    BindData();
                }
                break;
            }
        }