Пример #1
0
        private void btnInStore_Click(object sender, EventArgs e)
        {
            FrmJDYMake_Oper frm = new FrmJDYMake_Oper();

            frm.ShowDialog();

            BindData();
        }
Пример #2
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            FrmJDYMake_Oper frmEdit = new FrmJDYMake_Oper(String.Empty, true);

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

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

            case "clmEdit":
                FrmJDYMake_Oper frmEdit = new FrmJDYMake_Oper(entity.Id, true);
                if (frmEdit.ShowDialog() == DialogResult.OK)
                {
                    BindData();
                }
                break;

            case "clmDelete":
                if (MessageBoxEx.Show("确定要删除该记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        CommonDAO.GetInstance().SaveAppletLog(eAppletLogLevel.Warn, "删除监督样记录:", string.Format("送样单位:{0};接样人:{1};制样人:{2};制样码:{3};操作人:{4}", entity.SendUnit, entity.GetPle, entity.MakePle, entity.MakeCode, SelfVars.LoginUser.UserName));
                        Dbers.GetInstance().SelfDber.DeleteBySQL <CmcsRCMakeDetail>("where MakeId=:MakeId", new { MakeId = entity.Id });
                        Dbers.GetInstance().SelfDber.Delete <CmcsRCMake>(entity.Id);
                    }
                    catch (Exception)
                    {
                        MessageBoxEx.Show("该记录正在使用中,禁止删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    BindData();
                }
                break;
            }
        }