public static void OnLoad1Step(IUserSecurity form, EventArgs args) { IUser user = form.CurrentEntity as IUser; IOwnerSecurityProfile profile = user.GetDefaultSecurityProfile(); form.lupFLSProfile.LookupResultValue = profile; }
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; }
/// <summary> /// Saves the new team entity and adds the owner to the team. Optionally will /// add the owner's manager to the team is the add owner's manager checkbox is checked. /// </summary> /// <param name="form"></param> /// <param name="args"></param> public static void SaveButton_OnClickStep(IInsertTeam form, EventArgs args) { IWebDialogService dialogService = form.Services.Get <IWebDialogService>(); // create the new team IOwner ownerTeam = EntityFactory.Create <IOwner>(); ownerTeam.OwnerDescription = form.OwnerDescription.Text; ownerTeam.Type = OwnerType.Team; if (!ownerTeam.IsValidName(form.OwnerDescription.Text)) { string msg = form.GetResource("InvalidNameMessage").ToString(); if (dialogService != null && !string.IsNullOrEmpty(msg)) { dialogService.ShowMessage(msg, form.GetResource("InvalidNameMessageTitle").ToString()); } return; } if (ownerTeam.OwnerNameExists(form.OwnerDescription.Text)) { string msg = form.GetResource("DuplicateOwnerMessage").ToString(); if (dialogService != null && !string.IsNullOrEmpty(msg)) { dialogService.ShowMessage(msg, form.GetResource("DuplicateOwnerTitle").ToString()); } return; } ownerTeam.Save(); // set a default profile IOwnerSecurityProfile securityProfile = EntityFactory.GetById <IOwnerSecurityProfile>("PROF00000001"); if (form.securityProfileLookup.LookupResultValue != null) { securityProfile = form.securityProfileLookup.LookupResultValue as IOwnerSecurityProfile; } // get a team object. This is a view of the owner object ITeam team = EntityFactory.GetById <ITeam>(ownerTeam.Id); // add an ownerJoin record for the new team. Both the parent and the // child ids will point to the team team.AddMemberWithSecurityProfile(ownerTeam, securityProfile); // get the selected owner of the team. This will be a user IUser teamOwnerUser = form.DefaultOwner.LookupResultValue as IUser; if (teamOwnerUser != null) { // add the team owner as a member of the team IOwnerSecurityProfile ownerSecurityProfile = EntityFactory.GetById <IOwnerSecurityProfile>("PROF00000003"); team.AddMemberWithSecurityProfile(teamOwnerUser.DefaultOwner, ownerSecurityProfile); } MySlx.MainView.Show <ITeam>(ownerTeam.Id.ToString()); }
public static void btnSave_OnClickStep(IUserSecurity form, EventArgs args) { IUser user = form.CurrentEntity as IUser; IOwnerSecurityProfile securityProfile = form.lupFLSProfile.LookupResultValue as IOwnerSecurityProfile; user.UpdateDefaultSecurityProfile(securityProfile); user.Save(); }
public static void OnLoad1Step(IInsertTeam form, EventArgs args) { ITeam team = EntityFactory.Create <ITeam>(); form.addManagerCheckBox.Checked = team.GetAddManagerWithMemberOption(); IOwnerSecurityProfile securityProfile = EntityFactory.GetById <IOwnerSecurityProfile>("PROF00000001"); // read/write default form.securityProfileLookup.LookupResultValue = securityProfile; }
public static void saveButton_OnClickStep(ITeamDetails form, EventArgs args) { ITeam team = form.CurrentEntity as ITeam; team.Save(); // do this extra save since team is a view representing owner team.Owner.Save(); IOwnerSecurityProfile profile = form.securityProfileLookup.LookupResultValue as IOwnerSecurityProfile; team.Owner.UpdateOwnerSecurityProfile(team.Owner, profile); }
public static void OnLoad1Step(IDepartmentDetails form, EventArgs args) { IDepartment department = form.CurrentEntity as IDepartment; if (department != null) { IOwnerSecurityProfile securityProfile = department.Owner.GetOwnerSecurityProfile(department.Owner); if (securityProfile != null) { form.securityProfileLookup.LookupResultValue = securityProfile; } } }
public static void SaveDepartmentStep(IDepartmentDetails form, EventArgs args) { IDepartment department = form.CurrentEntity as IDepartment; department.Save(); // do this extra save since team is a view representing owner department.Owner.Save(); IOwnerSecurityProfile profile = form.securityProfileLookup.LookupResultValue as IOwnerSecurityProfile; department.Owner.UpdateOwnerSecurityProfile(department.Owner, profile); }
public static void OnLoad1Step(ITeamDetails form, EventArgs args) { ITeam team = form.CurrentEntity as ITeam; if (team != null) { IOwnerSecurityProfile securityProfile = team.GetSecurityProfile(team.Owner); if (securityProfile != null) { form.securityProfileLookup.LookupResultValue = securityProfile; } } }
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 SaveButton_OnClickStep(IInsertDepartment form, EventArgs args) { IWebDialogService dialogService = form.Services.Get <IWebDialogService>(); IOwner owner = EntityFactory.Create <IOwner>(); owner.OwnerDescription = form.OwnerDescription.Text; owner.Type = OwnerType.Department; if (!owner.IsValidName(form.OwnerDescription.Text)) { string msg = form.GetResource("InvalidNameMessage").ToString(); if (dialogService != null && !string.IsNullOrEmpty(msg)) { dialogService.ShowMessage(msg, form.GetResource("InvalidNameMessageTitle").ToString()); } return; } if (owner.OwnerNameExists(form.OwnerDescription.Text)) { string msg = form.GetResource("DuplicateOwnerMessage").ToString(); if (dialogService != null && !string.IsNullOrEmpty(msg)) { dialogService.ShowMessage(msg, form.GetResource("DuplicateOwnerTitle").ToString()); } return; } owner.Save(); IOwnerSecurityProfile securityProfile = EntityFactory.GetById <IOwnerSecurityProfile>("PROF00000001"); if (form.securityProfileLookup.LookupResultValue != null) { securityProfile = form.securityProfileLookup.LookupResultValue as IOwnerSecurityProfile; } // get a department object. This is a view of the owner object IDepartment department = EntityFactory.GetById <IDepartment>(owner.Id); // add an ownerJoin record for the new team. Both the parent and the // child ids will point to the team department.AddMemberWithSecurityProfile(owner, securityProfile); HttpContext.Current.Response.Redirect(string.Format("~/Department.aspx?entityId={0}", owner.Id.ToString()), false); }
public static void OnLoad1Step(IInsertDepartment form, EventArgs args) { IOwnerSecurityProfile securityProfile = EntityFactory.GetById <IOwnerSecurityProfile>("PROF00000001"); // read/write default form.securityProfileLookup.LookupResultValue = securityProfile; }