private void InitUserInput(Control container)
        {
            userInput.ID                 = "userInput";
            userInput.SelectMask         = UserControlObjectMask.User | UserControlObjectMask.Sideline;
            userInput.ShowCirculateUsers = this.ShowCirculateUsers;

            if (CurrentActivityDescriptor != null)
            {
                userInput.MultiSelect = AllowMultiUsers;
            }

            if (this.Operation == "update")
            {
                OguDataCollection <IUser> users = CurrentActivityDescriptor.Resources.ToUsers();

                OguDataCollection <IOguObject> selectedObjs = new OguDataCollection <IOguObject>();

                users.ForEach(u => selectedObjs.Add(u));

                userInput.ConsignUsers = selectedObjs;

                OguDataCollection <IUser> circulators = WfVariableDefine.GetCirculateUsers(CurrentActivityDescriptor);

                selectedObjs = new OguDataCollection <IOguObject>();

                circulators.ForEach(u => selectedObjs.Add(u));

                userInput.Circulators = selectedObjs;
            }

            container.Controls.Add(userInput);
        }
Beispiel #2
0
        private void RenderOneActivityEditor(Control parent, IWfActivityDescriptor actDesp, ActivityEditMode editMode)
        {
            if ((editMode & ActivityEditMode.Add) != ActivityEditMode.None)
            {
                HtmlAnchor addAnchor = CreateEditActivityAnchor(Translator.Translate(Define.DefaultCulture, "增加"), "add", false, actDesp);
                parent.Controls.Add(addAnchor);
            }

            if ((editMode & ActivityEditMode.Edit) != ActivityEditMode.None)
            {
                HtmlAnchor editAnchor = CreateEditActivityAnchor(Translator.Translate(Define.DefaultCulture, "修改"), "update",
                                                                 WfVariableDefine.UseSmallEditModeDescriptor(actDesp), actDesp);
                parent.Controls.Add(editAnchor);
            }

            if ((editMode & ActivityEditMode.Delete) != ActivityEditMode.None)
            {
                HtmlAnchor deleteAnchor = CreateEditActivityAnchor(Translator.Translate(Define.DefaultCulture, "删除"), "delete", false, actDesp);
                parent.Controls.Add(deleteAnchor);
            }
        }
        private void InitCirculateUserInput(Control container)
        {
            circulateUserInput.ID         = "circulateUserInput";
            circulateUserInput.SelectMask = UserControlObjectMask.User;

            if (CurrentActivityDescriptor != null)
            {
                circulateUserInput.MultiSelect = AllowMultiUsers;
            }

            if (this.Operation == "update")
            {
                OguDataCollection <IUser> users = WfVariableDefine.GetCirculateUsers(CurrentActivityDescriptor);

                OguDataCollection <IOguObject> selectedObjs = new OguDataCollection <IOguObject>();

                users.ForEach(u => selectedObjs.Add(u));

                circulateUserInput.SelectedOuUserData = selectedObjs;
            }

            container.Controls.Add(circulateUserInput);
        }
        private void InitUserInput(Control container)
        {
            groupControl.ID                       = "groupInput";
            groupControl.Width                    = Unit.Percentage(100);
            groupControl.Height                   = Unit.Percentage(100);
            groupControl.ShowingMode              = ControlShowingMode.Normal;
            groupControl.RootPath                 = WfVariableDefine.GroupSelectorRootPath(CurrentActivityDescriptor);
            groupControl.ListMask                 = UserControlObjectMask.All;
            groupControl.SelectMask               = UserControlObjectMask.Group | UserControlObjectMask.User;
            groupControl.MultiSelect              = true;
            groupControl.MergeSelectResult        = true;
            groupControl.LoadingObjectToTreeNode += new LoadingObjectToTreeNodeDelegate(groupControl_LoadingObjectToTreeNode);
            groupControl.GetChildren             += new GetChildrenDelegate(groupControl_GetChildren);

            if (this.Operation == "update")
            {
                OguDataCollection <IUser> users = CurrentActivityDescriptor.Resources.ToUsers();

                users.ForEach(u => groupControl.SelectedOuUserData.Add(u));
            }

            container.Controls.Add(groupControl);
        }