Exemplo n.º 1
0
        async Task Delete()
        {
            if (_info.Usage == WfFormUsage.Read)
            {
                Kit.Warn("禁止删除表单!");
                return;
            }

            // 管理时始终可删除
            if (_info.Usage == WfFormUsage.Edit &&
                (_info.AtvDef == null || (!_info.AtvDef.CanDelete && _info.AtvDef.Type != WfdAtvType.Start)))
            {
                Kit.Warn("您无权删除当前表单!请回退或发送到其他用户进行删除。");
                return;
            }

            if (!await Kit.Confirm("确认要删除当前表单吗?删除后表单将不可恢复!"))
            {
                return;
            }

            if (await _info.FormWin.Delete())
            {
                if (!_info.PrcInst.IsAdded)
                {
                    if (!await AtCm.Delete(_info.PrcInst, false))
                    {
                        Kit.Warn("表单已删除,未找到待删除的流程实例!");
                    }
                }
                _info.CloseWin();
            }
        }
Exemplo n.º 2
0
        async void DelParams(Params p_par)
        {
            if (!await Kit.Confirm("确认要删除吗?"))
            {
                Kit.Msg("已取消删除!");
                return;
            }


            if (p_par.IsAdded)
            {
                _fv.Data = null;
                return;
            }

            int cnt = await AtCm.GetScalar <int>("参数-用户设置数", new { ParamID = p_par.ID });

            if (cnt > 0)
            {
                if (!await Kit.Confirm("该参数已存在用户设置,确认要删除吗?"))
                {
                    return;
                }
            }

            if (await AtCm.Delete(p_par))
            {
                LoadLast();
                _fv.Data = null;
                DeleteDataVer();
            }
        }
Exemplo n.º 3
0
        async void DelMenuRow(Menu p_row)
        {
            if (!await Kit.Confirm("确认要删除吗?"))
            {
                Kit.Msg("已取消删除!");
                return;
            }

            if (p_row.IsAdded)
            {
                _fv.Data = _tv.SelectedItem;
                return;
            }

            if (await AtCm.Delete(p_row))
            {
                long id    = p_row.ID;
                Row  tvRow = (from tr in (Table)_tv.Data
                              where tr.ID == id
                              select tr).FirstOrDefault();
                if (tvRow != null)
                {
                    _tv.DeleteItem(tvRow);
                }
                _fv.Data = _tv.SelectedItem;
                AtCm.PromptForUpdateModel();
            }
        }
Exemplo n.º 4
0
        async void OnDelContext(object sender, Mi e)
        {
            var p_prc = e.Data.To <WfdPrc>();

            if (!await Kit.Confirm($"确认要删除流程模板[{p_prc.Name}]吗?"))
            {
                Kit.Msg("已取消删除!");
                return;
            }

            if (await AtCm.Delete(p_prc))
            {
                LoadAll();
            }
        }
Exemplo n.º 5
0
        async void OnDelPrv(object sender, Mi e)
        {
            var prv = e.Data.To <Prv>();

            if (!await Kit.Confirm($"确认要删除[{prv.ID}]吗?"))
            {
                Kit.Msg("已取消删除!");
                return;
            }

            if (await AtCm.Delete(prv))
            {
                LoadAll();
            }
        }
Exemplo n.º 6
0
        async void DelOption(Option p_option)
        {
            if (!await Kit.Confirm("确认要删除吗?"))
            {
                Kit.Msg("已取消删除!");
                return;
            }

            if (p_option.IsAdded)
            {
                _fv.Data = null;
                return;
            }

            if (await AtCm.Delete(p_option))
            {
                LoadCategory();
                _lv.Data = await AtCm.Query <Option>("选项-分类选项", new { Category = p_option.Category });

                _fv.Data = null;
                AtCm.PromptForUpdateModel();
            }
        }