public static void OnLoad1Step(IEditSecurityProfile form, EventArgs args)
        {
            // child is the member of a team or department
            // parent is the team or department
            IOwner child = form.CurrentEntity as IOwner;

            form.HiddenChildId.Value   = child.Id.ToString();
            form.NameTextBox.Text      = child.OwnerDescription;
            form.OwnerTypeTextBox.Text = child.Type.ToString();

            IWebDialogService dialogService = form.Services.Get <IWebDialogService>();

            string parentId = dialogService.DialogParameters["parentId"].ToString();

            form.HiddenParentId.Value = parentId;
            IOwner parent = EntityFactory.GetById <IOwner>(parentId);

            form.ParentTextBox.Text = parent.OwnerDescription;

            string profileId = dialogService.DialogParameters["profileId"].ToString();

            form.HiddenProfileId.Value = profileId;
            IOwnerSecurityProfile profile = EntityFactory.GetById <IOwnerSecurityProfile>(profileId);

            form.SecurityProfileLookup.LookupResultValue = profile;
        }
 public static void OkButton_OnClickStep( IEditSecurityProfile form,  EventArgs args)
 {
     // child is the member of a team or department
     if(!string.IsNullOrEmpty(form.HiddenChildId.Value))
     {
         IOwner child = EntityFactory.GetById<IOwner>(form.HiddenChildId.Value);
         IOwner parent = EntityFactory.GetById<IOwner>(form.HiddenParentId.Value);
         IOwnerSecurityProfile selProfile = form.SecurityProfileLookup.LookupResultValue as IOwnerSecurityProfile;
         if(selProfile != null && selProfile.Id.ToString() != form.HiddenProfileId.Value)
         {
             parent.UpdateOwnerSecurityProfile(child, selProfile);
             child.Save();
         }
     }
 }
 public static void OkButton_OnClickStep(IEditSecurityProfile form, EventArgs args)
 {
     // child is the member of a team or department
     if (!string.IsNullOrEmpty(form.HiddenChildId.Value))
     {
         IOwner child  = EntityFactory.GetById <IOwner>(form.HiddenChildId.Value);
         IOwner parent = EntityFactory.GetById <IOwner>(form.HiddenParentId.Value);
         IOwnerSecurityProfile selProfile = form.SecurityProfileLookup.LookupResultValue as IOwnerSecurityProfile;
         if (selProfile != null && selProfile.Id.ToString() != form.HiddenProfileId.Value)
         {
             parent.UpdateOwnerSecurityProfile(child, selProfile);
             child.Save();
         }
     }
 }
        public static void OnLoad1Step( IEditSecurityProfile form,  EventArgs args)
        {
            // child is the member of a team or department
            // parent is the team or department
            IOwner child = form.CurrentEntity as IOwner;
            form.HiddenChildId.Value = child.Id.ToString();
            form.NameTextBox.Text = child.OwnerDescription;
            form.OwnerTypeTextBox.Text = child.Type.ToString();

            IWebDialogService dialogService = form.Services.Get<IWebDialogService>();

            string parentId = dialogService.DialogParameters["parentId"].ToString();
            form.HiddenParentId.Value = parentId;
            IOwner parent = EntityFactory.GetById<IOwner>(parentId);
            form.ParentTextBox.Text = parent.OwnerDescription;

            string profileId = dialogService.DialogParameters["profileId"].ToString();
            form.HiddenProfileId.Value = profileId;
            IOwnerSecurityProfile profile = EntityFactory.GetById<IOwnerSecurityProfile>(profileId);
            form.SecurityProfileLookup.LookupResultValue = profile;
        }