protected void Page_Load(object sender, EventArgs e) { this.pagePermissionDefault = new PermissionSet(Permission.CanEditOrg); enteringMode = FormView1.CurrentMode; Controls_v4_WSGeographyTreeDropDown.EmitScripts(this); Controls_v4_WSOrgTreeDropDown.EmitScripts(this); WSOrgTreeDropDownSelectForEdit.tree.SetAuthority(_authority, Permission.CanEditOrg); programmedStyleTag.InnerHtml = programmedStyleTag.InnerHtml .Replace("RadMultiPage1.ClientID", RadMultiPage1.ClientID) .Replace("RadTabStrip1.ClientID", RadTabStrip1.ClientID); WSOrgTreeDropDownSelectForEdit.tree.topSortCountryId = _currentUser.CountryId; //current users country at the top of the dropdown if (!IsPostBack) { FormView1.ChangeMode(FormViewMode.ReadOnly); } //if (Request.Browser.IsBrowser("Firefox")) //{ // RadAjaxManager1.EnableAJAX = false; // ScriptManager.GetCurrent(this).EnablePartialRendering = false; //} }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SetUIState(pageUIState.open); BuildTemplateDropdowns(); } SetEditorToolbar(); Controls_v4_WSOrgTreeDropDown.EmitScripts(this); (WSOrgTreeDropDown1).tree.SetAuthority(_authority, Permission.CanEditMailTemplates); }
private void PrepareEditView(int orgid) { Organization org = Organization.FromIdentity(orgid); FillDefaultCountry(org.DefaultCountry.Code); Controls_v4_WSOrgTreeDropDown WSOrgTreeDropDownParentOrg = FindControlRecursive(FormView1, "WSOrgTreeDropDownParentOrg") as Controls_v4_WSOrgTreeDropDown; if (WSOrgTreeDropDownParentOrg != null) { WSOrgTreeDropDownParentOrg.tree.SetAuthority(_authority, Permission.CanEditOrg); WSOrgTreeDropDownParentOrg.SelectedOrganizationId = org.ParentOrganizationId; } Controls_v4_WSGeographyTreeDropDown ancorDrop = FindControlRecursive(FormView1, "AnchorGeographyDropdown") as Controls_v4_WSGeographyTreeDropDown; if (ancorDrop != null) { ancorDrop.RootId = Geography.RootIdentity; ancorDrop.SelectedGeographyId = org.AnchorGeographyId; } Controls_v4_WSGeographyTree tree = FindControlRecursive(FormView1, "UptakeGeoTree") as Controls_v4_WSGeographyTree; if (tree != null) { BasicUptakeGeography[] uptakes = OrganizationsDataObject.SelectOrgMineUptake(orgid); List <int> uptakeIds = new List <int>(); foreach (BasicUptakeGeography up in uptakes) { uptakeIds.Add(up.GeoId); } tree.tree.CheckBoxes = true; Style s = new Style(); s.BorderColor = Color.Green; s.BorderStyle = BorderStyle.Solid; s.BorderWidth = Unit.Pixel(2); s.BackColor = Color.LightGreen; tree.SetNodeStyles(uptakeIds.ToArray(), s); tree.tree.ClearSelectedNodes(); tree.CheckedValues = uptakeIds.ToArray(); UptakeGeography[] othersUptakes = OrganizationsDataObject.SelectOrgOthersUptake(orgid); List <int> othersUptakeIds = new List <int>(); foreach (UptakeGeography up in othersUptakes) { RadTreeNode node = tree.EnsureGeographyLoaded(up.GeoId, 0); node.BackColor = Color.Silver; node.ToolTip += up.Organization.Name + "\r\n"; node.Style["padding-top"] = "1px"; node.Style["padding-left"] = "2px"; node.Style["padding-bottom"] = "1px"; node.Style["padding-right"] = "2px"; node.Style["margin-top"] = "2px"; node.Style["margin-left"] = "0px"; node.Style["margin-bottom"] = "2px"; node.Style["margin-right"] = "0px"; } } GridView gv = FindControlRecursive(FormView1, "GridViewMailEdit") as GridView; if (gv != null) { List <AddressList> addresses = new List <AddressList>(); if (orgid > 0) { foreach (MailAuthorType ma in Enum.GetValues(typeof(MailAuthorType))) { if (ma != MailAuthorType.Unknown) { AddressList a = new AddressList(); a.maType = ma.ToString(); FunctionalMail.AddressItem aitem = org.GetFunctionalMailAddress(ma); FunctionalMail.AddressItem bitem = org.GetFunctionalMailAddressInh(ma); if (aitem != null) { a.name = aitem.Name; a.email = aitem.Email; } else { a.name = ""; a.email = ""; } if (bitem != null) { addresses.Add(a); } } } } gv.DataSource = addresses; gv.DataBind(); } }