Example #1
0
        public ActionResult CopyBUAUnit()
        {
            JsonReturnMessages data = new JsonReturnMessages()
            {
                IsSuccess = true, Msg = "操作成功"
            };

            Beyondbit.BUA.Client.IOrgService svc = Beyondbit.BUA.Client.ServiceFactory.Instance().GetOrgService();
            Org[] orgs = svc.QueryUnits("");
            return(Json(data));
        }
Example #2
0
        public Beyondbit.BUA.Client.User[] GetBUAUsersByOrgCode(string orgCode, int pageSize, int pageIndex)
        {
            Beyondbit.BUA.Client.IOrgService  os = Beyondbit.BUA.Client.ServiceFactory.Instance().GetOrgService();
            Beyondbit.BUA.Client.IUserService us = Beyondbit.BUA.Client.ServiceFactory.Instance().GetUserService();
            string      orgTree = os.QueryOrgTree(orgCode);
            XmlDocument doc     = new XmlDocument();

            doc.LoadXml(orgTree);
            XmlNodeList nodes = doc.DocumentElement.SelectNodes("//root/node");

            Beyondbit.BUA.Client.User[]      users = us.QueryUsersByObjectCode(ObjectType.Org, orgCode, "", orgCode, true, UserLockedType.UnLocked, pageSize + 10000, pageIndex);
            List <Beyondbit.BUA.Client.User> ulist = users.ToList <Beyondbit.BUA.Client.User>();

            if (nodes != null && nodes.Count > 0)
            {
                foreach (XmlNode node in nodes)
                {
                    string _orgCode = node.Attributes["id"].Value;
                    Beyondbit.BUA.Client.User[] ul = us.QueryUsersByObjectCode(ObjectType.Org, _orgCode, "", _orgCode, true, UserLockedType.UnLocked, 5000, 1);
                    ulist.AddRange(ul);
                }
            }
            return(ulist.ToArray());
        }