Ejemplo n.º 1
0
        /// <summary>
        /// Binds the value.
        /// </summary>
        private void BindValue()
        {
            EntityObject eo = BusinessManager.Load(WorkflowDefinitionEntity.ClassName, PrimaryKeyId.Parse(WorkflowId));
            SequentialWorkflowActivity root = McWorkflowSerializer.GetObject <SequentialWorkflowActivity>(((WorkflowDefinitionEntity)eo).Xaml);
            Activity ac = root.GetActivityByName(ActivityName);

            if (ac is CreateAssignmentAndWaitResultActivity)
            {
                AssignmentPrototypePropertyEntityCollection props = ((CreateAssignmentAndWaitResultActivity)ac).PrototypeUserProperties;
                if (props.Contains("Assignment.Properties.Subject"))
                {
                    tbSubject.Text = props.GetValue("Assignment.Properties.Subject").ToString();
                }
                else
                {
                    props.SetValue("Assignment.Properties.Subject", string.Empty);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the Click event of the btnOk control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnOk_Click(object sender, EventArgs e)
        {
            EntityObject eo = BusinessManager.Load(WorkflowDefinitionEntity.ClassName, PrimaryKeyId.Parse(WorkflowId));
            SequentialWorkflowActivity root = McWorkflowSerializer.GetObject <SequentialWorkflowActivity>(((WorkflowDefinitionEntity)eo).Xaml);
            Activity ac = root.GetActivityByName(ActivityName);

            if (ac is CreateAssignmentAndWaitResultActivity)
            {
                AssignmentPrototypePropertyEntityCollection props = ((CreateAssignmentAndWaitResultActivity)ac).PrototypeUserProperties;
                props.SetValue("Assignment.Properties.Subject", tbSubject.Text);
            }

            string xaml = McWorkflowSerializer.GetString <SequentialWorkflowActivity>(root);

            ((WorkflowDefinitionEntity)eo).Xaml = xaml;
            BusinessManager.Update(eo);

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "window.opener.__doPostBack('', ''); window.close();", true);
            //BusinessManager.Update(((CreateAssignmentAndWaitResultActivity)ac);
        }