public void Read(CommunitySettings information) { if (information.Type != GroupType.Event) { this.Visibility = Visibility.Collapsed; } else { List <CustomListPickerItem> list = information.event_available_organizers.Where <Group>((Func <Group, bool>)(o => o.type != "event")).Select <Group, CustomListPickerItem>((Func <Group, CustomListPickerItem>)(o => new CustomListPickerItem() { Id = -o.id, Name = o.name })).ToList <CustomListPickerItem>(); list.Insert(0, new CustomListPickerItem() { Id = information.event_creator.id, Name = information.event_creator.Name }); this.AvailableOrganizers = list; this.Organizer = this.AvailableOrganizers.First <CustomListPickerItem>((Func <CustomListPickerItem, bool>)(o => { if (information.event_group_id != 0L) { return(information.event_group_id == -o.Id); } return(true); })); this.Phone = information.phone; this.Email = information.email; this.ContactsFieldsVisibility = (!string.IsNullOrWhiteSpace(information.phone) || !string.IsNullOrWhiteSpace(information.email)).ToVisiblity(); } }
public LinksAndResources() { RefreshControl(); CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); Links = cdo.Links == null || cdo.Links.Count.Equals(0) ? new Dictionary <string, Dictionary <string, string> >() : cdo.Links.ContainsKey(EncompassHelper.LastPersona) ? cdo.Links[EncompassHelper.LastPersona] : cdo.Links["Default"]; }
public override void Load(Action <ResultCode> callback) { GroupsService.Current.GetCommunitySettings(this.CommunityId, (Action <BackendResult <CommunitySettings, ResultCode> >)(result => Execute.ExecuteOnUIThread((Action)(() => { ResultCode resultCode = result.ResultCode; if (resultCode == ResultCode.Succeeded) { this._information = result.ResultData; this.CommonFieldsViewModel.Read(this._information); this.FoundationDateViewModel.Read(this._information); this.AgeLimitsViewModel.Read(this._information); this.CommunityTypeSelectionViewModel.Read(this._information); this.EventOrganizerViewModel.Read(this._information); this.EventDatesViewModel.Read(this._information); this.CommunityPlacementViewModel.Read(this._information); } Action <ResultCode> action = callback; if (action == null) { return; } int num = (int)resultCode; action((ResultCode)num); })))); }
public LoanInformation() { InitializeComponent(); CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); Fields = cdo.LoanInformation == null || cdo.LoanInformation.Count.Equals(0) ? new Dictionary <string, string>() : cdo.LoanInformation.ContainsKey(EncompassHelper.LastPersona) ? cdo.LoanInformation[EncompassHelper.LastPersona] : cdo.LoanInformation["Default"]; RefreshInfo(); }
public PluginManagement_Form() { InitializeComponent(); CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); chkAdmin.Checked = cdo.SuperAdminRun; chkSide.Checked = cdo.SideMenuOpenByDefault.Contains("True"); txtTest.Text = cdo.TestServer; flwPlugins.Controls.Add(new AccessControl()); }
private void btnSave_Click(object sender, System.EventArgs e) { CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); cdo.SideMenuOpenByDefault = chkSide.Checked ? "True" : "False"; cdo.SuperAdminRun = chkAdmin.Checked; cdo.TestServer = txtTest.Text; CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, cdo); MessageBox.Show($" Saved"); }
public void Read(CommunitySettings information) { if (information.Type == GroupType.PublicPage) { this.Visibility = Visibility.Collapsed; } else { this.SetPlacement(information.place); } }
public void Read(CommunitySettings information) { if (information.Type == GroupType.PublicPage) { this.Visibility = Visibility.Collapsed; } else if (information.Type == GroupType.Group) { this.Title = CommonResources.GroupType.ToUpper(); this.PrivateVisibility = Visibility.Visible; this.OpenedTitle = CommonResources.GroupType_Opened; this.ClosedTitle = CommonResources.GroupType_Closed; this.OpenedDescription = CommonResources.GroupType_Opened_Description; this.ClosedDescription = CommonResources.GroupType_Closed_Description; switch (information.access) { case 0: this.IsOpenedSelected = new bool?(true); break; case 1: this.IsClosedSelected = new bool?(true); break; case 2: this.IsPrivateSelected = new bool?(true); break; } } else { this.Title = CommonResources.EventType.ToUpper(); this.PrivateVisibility = Visibility.Collapsed; this.OpenedTitle = CommonResources.EventType_Opened; this.ClosedTitle = CommonResources.EventType_Closed; this.OpenedDescription = CommonResources.EventType_Opened_Description; this.ClosedDescription = CommonResources.EventType_Closed_Description; if (information.access == 0) { this.IsOpenedSelected = new bool?(true); } else { this.IsClosedSelected = new bool?(true); } } }
public void Read(CommunitySettings information) { if (information.Type != GroupType.Event) { this.Visibility = Visibility.Collapsed; } else { this.StartDate = this.StartTime = Extensions.UnixTimeStampToDateTime((double)information.start_date.Value, false); this.FinishDate = this.FinishTime = Extensions.UnixTimeStampToDateTime((double)information.finish_date.Value, false); if (this.FinishTime.Second != 1) { return; } this.FinishDate = this.FinishTime = this.StartDate.AddHours(4.0); this.FinishFieldsVisibility = Visibility.Collapsed; } }
public void Read(CommunitySettings information) { switch (information.age_limits) { case 1: this.IsNoLimits = new bool?(true); break; case 2: this.From16Only = new bool?(true); break; case 3: this.From18Only = new bool?(true); break; } this.FullFormVisibility = (information.age_limits != 1).ToVisiblity(); }
public void Read(CommunitySettings information) { if (information.Type != GroupType.PublicPage) { this.Visibility = Visibility.Collapsed; } else { this.Title = information.public_date_label; if (this.Title.EndsWith(":")) { this.Title = this.Title.Substring(0, this.Title.Length - 1); } List <CustomListPickerItem> customListPickerItemList = new List <CustomListPickerItem>(); CustomListPickerItem customListPickerItem = new CustomListPickerItem(); customListPickerItem.Name = CommonResources.NotDefined; customListPickerItem.IsUnknown = true; long num = 0; customListPickerItem.Id = num; customListPickerItemList.Add(customListPickerItem); this.AvailableYears = customListPickerItemList; for (int year = DateTime.Now.Year; year >= 1800; --year) { this.AvailableYears.Add(new CustomListPickerItem() { Name = year.ToString(), Id = (long)year }); } string[] date = information.public_date.Split('.'); this.Month = this.AvailableMonths[int.Parse(date[1])]; if (date.Length > 2) { this.Year = this.AvailableYears.FirstOrDefault <CustomListPickerItem>((Func <CustomListPickerItem, bool>)(y => y.Id == (long)int.Parse(date[2]))); } if (this.Year == null) { this.Year = this.AvailableYears.First <CustomListPickerItem>(); } this.UpdateAvailableDays(); this.Day = this.AvailableDays[int.Parse(date[0])]; } }
public static bool CheckAccess(string pluginName) { CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); List <PluginAccessRight> rights = cdo.Rights; if (rights.Count.Equals(0)) { rights.Add(new PluginAccessRight() { PluginName = nameof(TopMenuBase), AllAccess = true }); rights.Add(new PluginAccessRight() { PluginName = nameof(PluginManagement), AllAccess = true }); CustomDataObject.Save <CommunitySettings>(CommunitySettings.Key, cdo); } PluginAccessRight right = rights.Where(x => x.PluginName.Equals(pluginName)).FirstOrDefault(); if (right == null) { return(false); } bool isAllowedToRun = right.AllAccess; if (!isAllowedToRun && right.Personas != null) { isAllowedToRun = EncompassHelper.ContainsPersona(right.Personas); } if (!isAllowedToRun && right.UserIDs != null) { isAllowedToRun = right.UserIDs.Contains(EncompassHelper.User.ID); } return(isAllowedToRun); }
public override void Load(Action <ResultCode> callback) { GroupsService.Current.GetCommunitySettings(this._communityId, (Action <BackendResult <CommunitySettings, ResultCode> >)(result => Execute.ExecuteOnUIThread((Action)(() => { ResultCode resultCode = result.ResultCode; if (resultCode == ResultCode.Succeeded) { this._information = result.ResultData; this.WallOrComments = (CommunityServiceState)this._information.wall; if (this._information.Type != GroupType.PublicPage) { this.Documents = (CommunityServiceState)this._information.docs; } else { this.Links = this._information.links == 1; this.Events = this._information.events == 1; this.Contacts = this._information.contacts == 1; } this.Photos = (CommunityServiceState)this._information.photos; this.Videos = (CommunityServiceState)this._information.video; this.Audios = (CommunityServiceState)this._information.audio; this.Discussions = (CommunityServiceState)this._information.topics; this.NotifyPropertyChanged <Visibility>((() => this.DetailedFormVisibility)); this.NotifyPropertyChanged <Visibility>((() => this.SimpleFormVisibility)); this.IsStrongLanguageFilterEnabled = this._information.obscene_filter == 1; this.IsKeyWordsFilterEnabled = this._information.obscene_stopwords == 1; if (this._information.obscene_words != null) { foreach (string obsceneWord in this._information.obscene_words) { this.KeyWords = !(this.KeyWords == "") ? this.KeyWords + ", " + obsceneWord : obsceneWord; } } } callback(resultCode); })))); }
public static bool IsTest() { CommunitySettings cdo = CustomDataObject.Get <CommunitySettings>(CommunitySettings.Key); return(EncompassApplication.Session.ServerURI.Contains(cdo.TestServer)); }
public void Read(CommunitySettings information) { this.Name = Extensions.ForUI(information.title); this.Description = Extensions.ForUI(information.description); this.Domain = this.CurrentDomain = information.address; this.Site = Extensions.ForUI(information.website); if (information.Type != GroupType.PublicPage) { this.CategoryTitle = CommonResources.CommunitySubject; this.CategoryPlaceholder = CommonResources.SelectSubject; information.subject_list.Insert(0, new Section() { id = 0, name = CommonResources.NoneSelected }); this.AvailableCategories = information.subject_list.Select <Section, CustomListPickerItem>((Func <Section, CustomListPickerItem>)(c => { CustomListPickerItem customListPickerItem = new CustomListPickerItem(); customListPickerItem.Name = c.name; customListPickerItem.Id = c.id; int num = c.id == 0L ? 1 : 0; customListPickerItem.IsUnknown = num != 0; return(customListPickerItem); })).ToList <CustomListPickerItem>(); this.Category = this.AvailableCategories.First <CustomListPickerItem>((Func <CustomListPickerItem, bool>)(c => c.Id == information.subject)); } else { this.CategoryTitle = CommonResources.PublicPageCategory; this.CategoryPlaceholder = CommonResources.SelectCategory; for (int index = 1; index < information.public_category_list.Count; ++index) { List <Section> subtypesList = information.public_category_list[index].subtypes_list; if (subtypesList != null && subtypesList.Any <Section>()) { subtypesList.First <Section>().name = CommonResources.NoneSelected; } } information.public_category_list.First <Section>().name = CommonResources.NoneSelected; this._publicPageCategories = information.public_category_list; this.AvailableCategories = information.public_category_list.Select <Section, CustomListPickerItem>((Func <Section, CustomListPickerItem>)(c => { CustomListPickerItem customListPickerItem = new CustomListPickerItem(); customListPickerItem.Name = c.name; customListPickerItem.Id = c.id; int num = c.id == 0L ? 1 : 0; customListPickerItem.IsUnknown = num != 0; return(customListPickerItem); })).ToList <CustomListPickerItem>(); this.Category = this.AvailableCategories.First <CustomListPickerItem>((Func <CustomListPickerItem, bool>)(c => c.Id == information.public_category)); if (this.Category.Id == 0L) { return; } List <CustomListPickerItem> availableSubcategories = this.AvailableSubcategories; CustomListPickerItem customListPickerItem1; if (availableSubcategories == null) { customListPickerItem1 = (CustomListPickerItem)null; } else { Func <CustomListPickerItem, bool> predicate = (Func <CustomListPickerItem, bool>)(s => s.Id == information.public_subcategory); customListPickerItem1 = availableSubcategories.First <CustomListPickerItem>(predicate); } this.Subcategory = customListPickerItem1; } }