Exemple #1
0
        /// <summary>
        /// Gets or sets the workflow activity.
        /// </summary>
        /// <param name="activity">The activity.</param>
        /// <param name="expandInvalid">if set to <c>true</c> [expand invalid].</param>
        /// <value>
        /// The workflow activity.
        /// </value>
        public void GetWorkflowActivity(WorkflowActivity activity, bool expandInvalid)
        {
            EnsureChildControls();

            if (!activity.CompletedDateTime.HasValue && _cbActivityIsComplete.Checked)
            {
                activity.CompletedDateTime = RockDateTime.Now;
            }
            else if (activity.CompletedDateTime.HasValue && !_cbActivityIsComplete.Checked)
            {
                activity.CompletedDateTime = null;
            }

            if (_ppAssignedToPerson.SelectedValue.HasValue)
            {
                activity.AssignedPersonAliasId = _ppAssignedToPerson.PersonAliasId;
            }
            else
            {
                activity.AssignedPersonAliasId = null;
            }


            if (_gpAssignedToGroup.SelectedValueAsInt().HasValue)
            {
                activity.AssignedGroupId = _gpAssignedToGroup.SelectedValueAsInt();
            }
            else if (_ddlAssignedToRole.SelectedValueAsInt().HasValue)
            {
                activity.AssignedGroupId = _ddlAssignedToRole.SelectedValueAsInt();
            }
            else
            {
                activity.AssignedGroupId = null;
            }

            Attribute.Helper.GetEditValues(_phAttributes, activity);

            foreach (WorkflowActionEditor actionEditor in this.Controls.OfType <WorkflowActionEditor>())
            {
                var action = activity.Actions.Where(a => a.Guid.Equals(actionEditor.ActionGuid)).FirstOrDefault();
                if (action != null)
                {
                    actionEditor.GetWorkflowAction(action);
                }
            }

            if (expandInvalid && !Expanded && !activity.IsValid)
            {
                Expanded = true;
            }
        }
Exemple #2
0
 /// <summary>
 /// Handles the SelectItem event of the gp control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 void gp_SelectItem( object sender, EventArgs e )
 {
     if ( GroupPickerSelect != null  )
     {
         GroupPicker gp = sender as GroupPicker;
         if ( gp != null )
         {
             GridViewRow row = (GridViewRow)( (LinkButton)sender ).Parent.Parent;
             GroupPickerRowEventArgs args = new GroupPickerRowEventArgs( row, gp.SelectedValueAsInt() );
             GroupPickerSelect( sender, args );
         }
     }
 }