Exemplo n.º 1
0
        /// <summary>
        /// 是否激活后续活动
        /// </summary>
        /// <param name="p_atvSync">同步活动</param>
        /// <returns></returns>
        async Task <bool> IsActive(WfdAtv p_atvSync)
        {
            Dict dt = new Dict();

            dt["prciid"] = _info.PrcInst.ID;
            dt["atvdid"] = p_atvSync.ID;
            int cnt = await AtCm.GetScalar <int>("流程-同步活动实例数", dt);

            // 已产生同步实例
            if (cnt > 0)
            {
                return(false);
            }

            // 获得同步前所有活动
            dt             = new Dict();
            dt["TgtAtvID"] = p_atvSync.ID;
            var trss = await AtCm.Query <WfdTrs>("流程-活动前的迁移", dt);

            // 聚合方式
            // 全部
            if (p_atvSync.JoinKind == 0)
            {
                return(await GetAllFinish(trss));
            }

            // 任一
            if (p_atvSync.JoinKind == WfdAtvJoinKind.任一任务)
            {
                return(true);
            }

            // 即时
            return(await GetExistFinish(trss));
        }
Exemplo n.º 2
0
 async void OnEditUser(object sender, Mi e)
 {
     if (await new EditUserDlg().Show(e.Row.ID))
     {
         _lvUser.Data = await AtCm.Query <User>("用户-最近修改");
     }
 }
Exemplo n.º 3
0
        async void LoadCategory()
        {
            var data = await AtCm.Query("选项-所有分类");

            _lvCate.Data = data;
            _fv["Category"].To <CList>().Data = data;
        }
Exemplo n.º 4
0
        public async Task <bool> Show(RoleRelations p_relation, string p_tgtID, FrameworkElement p_target)
        {
            switch (p_relation)
            {
            case RoleRelations.Prv:
                _lv.Data = await AtCm.Query("权限-未关联的角色", new { prvid = p_tgtID });

                break;

            case RoleRelations.User:
                _lv.Data = await AtCm.Query("用户-未关联的角色", new { userid = p_tgtID });

                break;

            case RoleRelations.Menu:
                _lv.Data = await AtCm.Query("菜单-未关联的角色", new { menuid = p_tgtID });

                break;

            case RoleRelations.WfAtv:
                _lv.Data = await AtCm.Query("流程-活动未关联的角色", new { atvid = p_tgtID });

                break;
            }
            if (!Kit.IsPhoneUI)
            {
                WinPlacement    = DlgPlacement.TargetBottomLeft;
                PlacementTarget = p_target;
                ClipElement     = p_target;
                MaxHeight       = 400;
                MaxWidth        = 300;
            }
            return(await ShowAsync());
        }
Exemplo n.º 5
0
 async void OnAtvClick(object sender, ItemClickArgs e)
 {
     if (e.IsChanged)
     {
         _lvItem.Data = await AtCm.Query("流程-活动实例的工作项", new { atviID = e.Row.ID });
     }
 }
Exemplo n.º 6
0
 async void OnItemClick(object sender, ItemClickArgs e)
 {
     if (e.IsChanged)
     {
         _lvAtv.Data = await AtCm.Query("流程-流程实例的活动实例", new { prciID = e.Row.ID });
     }
 }
Exemplo n.º 7
0
 async void OnLoadTreeGroup(object sender, AsyncEventArgs e)
 {
     using (e.Wait())
     {
         ((CTree)sender).Data = await AtCm.Query <Menu>("菜单-分组树");
     }
 }
Exemplo n.º 8
0
        Task <Table> GetLimitUsers(long p_atvdid, WfdAtvExecLimit p_execLimit)
        {
            string key;

            switch (p_execLimit)
            {
            case WfdAtvExecLimit.前一活动的执行者:
                // 前一活动执行者
                key = "流程-前一活动执行者";
                break;

            case WfdAtvExecLimit.前一活动的同部门执行者:
                // 前一活动的同部门执行者
                key = "流程-前一活动的同部门执行者";
                break;

            case WfdAtvExecLimit.已完成活动的执行者:
                // 已完成活动执行者
                key = "流程-已完成活动执行者";
                break;

            default:
                // 已完成活动同部门执行者
                key = "流程-已完成活动同部门执行者";
                break;
            }
            return(AtCm.Query(key, new { prciId = _info.PrcInst.ID, atvdid = p_atvdid }));
        }
Exemplo n.º 9
0
 public Task <Table> GetChildrenByType(string p_typeFilter)
 {
     if (FolderID == -1)
     {
         return(AtCm.Query("个人文件-扩展名过滤根目录", new { userid = Kit.UserID, extname = p_typeFilter }));
     }
     return(AtCm.Query("个人文件-扩展名过滤子级", new { parentid = FolderID, extname = p_typeFilter }));
 }
Exemplo n.º 10
0
 public Task <Table> GetChildren()
 {
     if (FolderID == -1)
     {
         return(AtCm.Query("个人文件-根目录", new { userid = Kit.UserID }));
     }
     return(AtCm.Query("个人文件-所有子级", new { parentid = FolderID }));
 }
Exemplo n.º 11
0
        async void OnSave(object sender, Mi e)
        {
            if (await AtCm.Save(_fv.Data.To <Rpt>()))
            {
                _lv.Data = await AtCm.Query <Rpt>("报表-最近修改");

                AtCm.PromptForUpdateModel();
            }
        }
Exemplo n.º 12
0
 async void Load()
 {
     if (!Kit.IsPhoneUI)
     {
         Height = 600;
         Width  = 400;
     }
     _lv.Data = await AtCm.Query("流程-可启动流程", new { userid = Kit.UserID });
 }
Exemplo n.º 13
0
 async void OnSearch(object sender, string e)
 {
     if (string.IsNullOrEmpty(_owner.TypeFilter))
     {
         _lv.Data = await AtCm.Query("文件-搜索所有文件", new { name = $"%{e}%", userid = Kit.UserID });
     }
     else
     {
         _lv.Data = await AtCm.Query("文件-搜索扩展名文件", new { name = $"%{e}%", userid = Kit.UserID, extname = _owner.TypeFilter });
     }
 }
Exemplo n.º 14
0
        async void RemoveRole(IEnumerable <Row> p_rows)
        {
            var         userID = _lvUser.SelectedRow.ID;
            List <long> roles  = (from r in p_rows
                                  select r.Long("roleid")).ToList();

            if (roles.Count > 0 && await AtCm.RemoveUserRoles(userID, roles))
            {
                _lvRole.Data = await AtCm.Query("用户-关联角色", new { userid = userID });
            }
        }
Exemplo n.º 15
0
        async void RemoveUser(IEnumerable <Row> p_rows)
        {
            var         roleID = _lvRole.SelectedRow.ID;
            List <long> users  = (from r in p_rows
                                  select r.Long("userid")).ToList();

            if (users.Count > 0 && await AtCm.RemoveRoleUsers(roleID, users))
            {
                _lvUser.Data = await AtCm.Query("角色-关联用户", new { roleid = roleID });
            }
        }
Exemplo n.º 16
0
        public async void Show(long p_prciID, long p_prcID)
        {
            _prciID = p_prciID;

            // 查询流程模板id
            if (p_prcID <= 0)
            {
                p_prcID = await AtCm.GetScalar <long>("流程-实例id获取模板id", new { id = p_prciID });
            }

            var def = await WfFormInfo.GetPrcDef(p_prcID);

            if (string.IsNullOrEmpty(def.Diagram))
            {
                Kit.Warn("流程图模板内容为空!");
                return;
            }

            _sketch.ReadXml(def.Diagram);
            var atvs = await AtCm.Query("流程-活动实例状态", new { prciid = p_prciID });

            if (atvs.Count > 0)
            {
                foreach (var node in _sketch.Container.Children.OfType <SNode>())
                {
                    var dr = (from c in atvs
                              where c.Long("atvdid") == node.ID
                              select c).LastOrDefault();
                    if (dr != null)
                    {
                        switch (dr.Str("status"))
                        {
                        //活动
                        case "0":
                            node.BorderBrush = Res.醒目红色;
                            break;

                        //结束
                        case "1":
                            node.BorderBrush = Res.GreenBrush;
                            break;
                        }
                        node.Click += OnNodeClick;
                    }
                }
            }

            if (!Kit.IsPhoneUI)
            {
                Height = 700;
                Width  = 500;
            }
            Show();
        }
Exemplo n.º 17
0
        public async void Show(string p_paramid)
        {
            Title    = p_paramid;
            _lv.Data = await AtCm.Query("参数-用户设置", new { paramid = p_paramid });

            if (!Kit.IsPhoneUI)
            {
                Width  = 500;
                Height = 400;
            }
            await ShowAsync();
        }
Exemplo n.º 18
0
        async void OnSave(object sender, Mi e)
        {
            var op = _fv.Data.To <Option>();

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

                AtCm.PromptForUpdateModel();
            }
        }
Exemplo n.º 19
0
 async void OnSearch(object sender, string e)
 {
     if (e == "#全部")
     {
         LoadAll();
     }
     else if (!string.IsNullOrEmpty(e))
     {
         _lvPrv.Data = await AtCm.Query <Prv>("权限-模糊查询", new { id = $"%{e}%" });
     }
     NaviTo("权限列表");
 }
Exemplo n.º 20
0
        /// <summary>
        /// 获取活动的所有可执行用户
        /// </summary>
        /// <param name="p_atvid"></param>
        /// <returns></returns>
        async Task <Table> GetAtvUsers(long p_atvid)
        {
            Dict dt = new Dict {
                { "atvid", p_atvid }
            };

            if (await AtCm.GetScalar <int>("流程-是否活动授权任何人", dt) == 0)
            {
                return(await AtCm.Query("流程-活动的所有执行者", dt));
            }
            return(await AtCm.Query("流程-所有未过期用户"));
        }
Exemplo n.º 21
0
        async void OnSearch(object sender, Mi e)
        {
            var row = _fv.Row;

            if (row.Str("prcdid") == "")
            {
                Kit.Warn("未选择流程模板!");
            }
            else
            {
                _lv.Data = await AtCm.Query("流程-查找实例", row.ToDict());
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// 构造当前数据的下一步骤
        /// </summary>
        /// <param name="p_row"></param>
        /// <returns></returns>
        async Task <string> BuildNext(Row p_row)
        {
            // 指派方式 0普通指派 1起始指派 2回退 3跳转 4追回 5回退指派
            var tbl = await AtCm.Query("流程-日志目标项", new { prciid = p_row.Long("prciid"), atviid = p_row.Long("atviid") });

            string nexttext = "";

            foreach (var row in tbl)
            {
                nexttext += $"\n提交给{row.Str("accpname")},进行{row.Str("atvdname")} 📨";
            }
            return(nexttext);
        }
Exemplo n.º 23
0
        async void OnItemClick(object sender, ItemClickArgs e)
        {
            if (e.IsChanged)
            {
                long id = e.Row.ID;
                _lvRole.Data = await AtCm.Query("用户-关联角色", new { userid = id });

                _lvMenu.Data = await AtCm.Query("用户-可访问的菜单", new { userid = id });

                _lvPrv.Data = await AtCm.Query("用户-具有的权限", new { userid = id });
            }
            NaviTo("关联角色,拥有菜单,授予权限");
        }
Exemplo n.º 24
0
        async void OnItemClick(object sender, ItemClickArgs e)
        {
            if (e.IsChanged)
            {
                long id = e.Row.ID;
                _lvUser.Data = await AtCm.Query("角色-关联用户", new { roleid = id });

                _lvMenu.Data = await AtCm.Query("角色-关联的菜单", new { roleid = id });

                _lvPrv.Data = await AtCm.Query("角色-关联的权限", new { roleid = id });
            }
            NaviTo("关联用户,拥有菜单,授予权限");
        }
Exemplo n.º 25
0
        public async Task <bool> Show(long p_id, FrameworkElement p_target)
        {
            _lv.Data = await AtCm.Query("角色-未关联的菜单", new { roleid = p_id });

            if (!Kit.IsPhoneUI)
            {
                WinPlacement    = DlgPlacement.TargetBottomLeft;
                PlacementTarget = p_target;
                ClipElement     = p_target;
                MaxHeight       = 400;
                MaxWidth        = 300;
            }
            return(await ShowAsync());
        }
Exemplo n.º 26
0
        async void LoadSearchData()
        {
            _fv["prcdname"].To <CList>().Data = await AtCm.Query("流程-所有流程模板名称");

            Row row = new Row();

            row.AddCell <string>("prcdid");
            row.AddCell <string>("prcdname");
            row.AddCell <long>("status", 3);
            row.AddCell("statusname", "全部");
            row.AddCell <string>("title");
            row.AddCell <DateTime>("start");
            row.AddCell <DateTime>("end");
            _fv.Data = row;
        }
Exemplo n.º 27
0
        async void OnSearch(object sender, Mi e)
        {
            var row = _fv.Row;

            if (row.Bool("type"))
            {
                // 用户在一个流程实例中参与的所有任务
                _lv.Data = await AtCm.Query("流程-所有经办历史任务", row.ToDict());
            }
            else
            {
                // 用户只能看到一个流程实例的最后完成的任务
                _lv.Data = await AtCm.Query("流程-历史任务", row.ToDict());
            }
        }
Exemplo n.º 28
0
        async void RemovePrv(IEnumerable <Row> p_rows)
        {
            long           roleID = _lvRole.SelectedRow.ID;
            List <RolePrv> ls     = new List <RolePrv>();

            foreach (var row in p_rows)
            {
                ls.Add(new RolePrv(roleID, row.Str("prvid")));
            }
            if (ls.Count > 0 && await AtCm.BatchDelete(ls))
            {
                _lvPrv.Data = await AtCm.Query("角色-关联的权限", new { roleid = roleID });

                await AtCm.DeleteDataVer(ls.Select(rm => rm.RoleID).ToList(), "privilege");
            }
        }
Exemplo n.º 29
0
 async void OnSearch(object sender, string e)
 {
     if (e == "#全部")
     {
         LoadAll();
     }
     else if (e == "#系统角色")
     {
         _lvRole.Data = await AtCm.Query("角色-系统角色");
     }
     else if (!string.IsNullOrEmpty(e))
     {
         _lvRole.Data = await AtCm.Query("角色-模糊查询", new { name = $"%{e}%" });
     }
     NaviTo("角色列表");
 }
Exemplo n.º 30
0
 async void OnSearch(object sender, string e)
 {
     if (e == "#全部")
     {
         LoadAll();
     }
     else if (e == "#最近修改")
     {
         _lvUser.Data = await AtCm.Query <User>("用户-最近修改");
     }
     else if (!string.IsNullOrEmpty(e))
     {
         _lvUser.Data = await AtCm.Query <User>("用户-模糊查询", new { input = $"%{e}%" });
     }
     NaviTo("用户列表");
 }