Example #1
0
        public virtual void MoveOUObjects(HttpContext context)
        {
            YZRequest request = new YZRequest(context);
            string    src     = request.GetString("src");
            string    tag     = request.GetString("tag");
            bool      copy    = request.GetBool("copy");

            JObject post = request.GetPostData <JObject>();
            BPMObjectNameCollection roles   = post["roles"].ToObject <BPMObjectNameCollection>();
            BPMObjectNameCollection members = post["members"].ToObject <BPMObjectNameCollection>();

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();

                if (copy)
                {
                    OU.CopyRoleAndMembers(cn, src, tag, roles, members);
                }
                else
                {
                    OU.MoveRoleAndMembers(cn, src, tag, roles, members);
                }
            }
        }