private void Reload(bool ignoreCache) { udc = UserDataContext.GetUserDataContext(); GetCommentedDataObject(); phResult.Controls.Clear(); string template = "SmallOutputComment.ascx"; string repeater = "comments.ascx"; if (WidgetHost.OutputTemplate != null) { if (!string.IsNullOrEmpty(WidgetHost.OutputTemplate.OutputTemplateControl)) { template = WidgetHost.OutputTemplate.OutputTemplateControl; } if (!string.IsNullOrEmpty(WidgetHost.OutputTemplate.RepeaterControl)) { repeater = WidgetHost.OutputTemplate.RepeaterControl; } } Control control = LoadControl("~/UserControls/Repeaters/" + repeater); ISettings objectComments = (ISettings)control; Dictionary <string, object> settings = new Dictionary <string, object>(); settings.Add("CommentedObject", commentedDataObject); settings.Add("OutputTemplateControl", template); settings.Add("IgnoreCache", ignoreCache); objectComments.Settings = settings; phResult.Controls.Add(control); hasContent = true; }
protected void Page_Load(object sender, EventArgs e) { DataObject dataObject = (DataObject)Settings["DataObject"]; DataObjectForumTopicItem post = DataObject.Load <DataObjectForumTopicItem>(dataObject.ObjectID); List <DataObjectForumTopic> forumTopics = DataObjects.Load <DataObjectForumTopic>(new QuickParameters() { Udc = UserDataContext.GetUserDataContext(), Amount = 1, DisablePaging = true, RelationParams = new RelationParams() { ChildObjectID = dataObject.ObjectID } }); if (forumTopics.Count == 1 && post.ItemStatus != CommentStatus.Deleted) { LnkTitle.Text = string.Format(GuiLanguage.GetGuiLanguage("UserControls.Templates.WebUI.Base").GetString("MessageForumSearchResult"), dataObject.Nickname, dataObject.Inserted.ToString("dd. MMM yyyy"), forumTopics[0].Title); LnkTitle.NavigateUrl = Helper.GetDetailLink(forumTopics[0].objectType, forumTopics[0].ObjectID.ToString()); LnkDesc.Text = dataObject.Description.StripHTMLTags().CropString(400); LnkDesc.NavigateUrl = LnkTitle.NavigateUrl; LnkTitle.ID = null; LnkDesc.ID = null; } else { this.Parent.Parent.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { udc = UserDataContext.GetUserDataContext(UserProfile.Current.UserName); SiteObjectType siteObjectType = Helper.GetObjectType("ForumTopicItem"); isRoleAllowed = Array.Exists(siteObjectType.AllowedRoles.Split(','), y => UserDataContext.GetUserDataContext().UserRoles.Contains(y)); PnlInputAnonymous.Visible = isRoleAllowed && !udc.IsAuthenticated; RfvName.ErrorMessage = language.GetString("MessageUsernameRequired"); RevName.ErrorMessage = language.GetString("MessageUsernameWrongChar"); RfvEmail.ErrorMessage = language.GetString("MessageValidEmail"); RevEmail.ErrorMessage = language.GetString("MessageValidEmail"); RevEmail.ValidationExpression = Constants.REGEX_EMAIL; RevName.ValidationExpression = Constants.REGEX_USERNAME; RevCom.ErrorMessage = language.GetString("MessageForumTopicItemTextRequired"); if (Request.QueryString["ObjId"] != null) { objectId = Request.QueryString["ObjId"].ToGuid(); } if (Request.QueryString["ObjIdRef"] != null) { referencedItemId = Request.QueryString["ObjIdRef"].ToGuid(); } objectType = Request.QueryString["ObjType"] ?? string.Empty; TrackingManager.TrackEventPage(null, null, IsPostBack, LogSitePageType.Detail); COMTIT.Text = language.GetString("LableAnswer") + ":"; }
protected void ibtnS_Click(object sender, EventArgs e) { string controlId = string.IsNullOrEmpty(Request.QueryString["CtrlID"]) ? string.Empty : Request.QueryString["CtrlID"]; string geoInfoString = string.Format("{0},{1},{2},{3},{4},{5},{6}", controlId, txtLatH.Value.Replace(',', ' '), txtLongH.Value.Replace(',', ' '), txtPlz.Text.Replace(',', ' '), txtOrt.Text.Replace(',', ' '), txtStreet.Text.Replace(',', ' '), ddlLand.SelectedValue.Replace(',', ' ')); if (!string.IsNullOrEmpty(Request.QueryString["OID"])) { string objectId = Request.QueryString["OID"]; DataObject dataObject = DataObject.Load <DataObject>(objectId.ToGuid(), null, false); if (dataObject.State != ObjectState.Added) { dataObject.City = txtOrt.Text; dataObject.Street = txtStreet.Text; dataObject.CountryCode = ddlLand.SelectedValue; try { dataObject.Geo_Lat = Convert.ToDouble(txtLatH.Value.Replace(',', '.')); dataObject.Geo_Long = Convert.ToDouble(txtLongH.Value.Replace(',', '.')); } catch { } dataObject.Zip = txtPlz.Text; dataObject.Update(UserDataContext.GetUserDataContext()); litScript.Text = string.Format("<script language='Javascript'>$telerik.$(function() {{ GetRadWindow().Close('{0}'); }} );</script>", geoInfoString); } } else { litScript.Text = string.Format("<script language='Javascript'>$telerik.$(function() {{ GetRadWindow().Close('{0}'); }} );</script>", geoInfoString); } }
public string LoadMarkers(Dictionary <string, string> objectTypesAndTags) { StringBuilder sb = new StringBuilder(); foreach (var objectTypeAndTags in objectTypesAndTags) { QuickParameters quickParameters = new QuickParameters(); quickParameters.Udc = UserDataContext.GetUserDataContext(); quickParameters.ObjectType = Common.Helper.GetObjectTypeNumericID(objectTypeAndTags.Key); quickParameters.Tags1 = QuickParameters.GetDelimitedTagIds(objectTypeAndTags.Value, ','); quickParameters.Amount = 500; quickParameters.DisablePaging = true; quickParameters.OnlyGeoTagged = true; quickParameters.ShowState = ObjectShowState.Published; quickParameters.QuerySourceType = QuerySourceType.Page; var dataObjects = DataObjects.Load <DataObject>(quickParameters); foreach (var dataObject in dataObjects.DistinctBy((x, y) => x.Geo_Lat + x.Geo_Long == y.Geo_Lat + y.Geo_Long)) { string tag = string.Empty; foreach (var currentTag in objectTypeAndTags.Value.Split(',')) { if (!string.IsNullOrEmpty(currentTag) && dataObject.TagList.ToLower().Contains(currentTag.ToLower())) { tag = "_" + currentTag.ToLower(); } } sb.AppendLine(string.Format("AddMapMarker({0}, {1}, '{2}', '{3}', '{4}');", dataObject.Geo_Lat, dataObject.Geo_Long, tag, dataObject.ObjectID, dataObject.ObjectType)); } } return(sb.ToString()); }
// Interface IReloadable public void Reload() { if (!Helper.IsObjectTypeEnabled(QuickParameters.ObjectType)) { return; } UserDataContext udc = UserDataContext.GetUserDataContext(); QuickParameters.Udc = udc; QuickParameters.WithCopy = false; QuickParameters.OnlyConverted = true; QuickParameters.ShowState = ObjectShowState.Published; QuickParameters.ToStartDate = DateTime.Now; QuickParameters.FromEndDate = DateTime.Now; QuickParameters.DateQueryMethode = QuickDateQueryMethode.BetweenStartRangeEndRange; this.OBJOVW.DataSource = DataObjects.Load <Business.DataObjectHTMLContent>(QuickParameters); numberItems = ((DataObjectList <Business.DataObjectHTMLContent>) this.OBJOVW.DataSource).ItemTotal; this.OBJOVW.DataBind(); this.PAGTOP.InitPager(QuickParameters.PageNumber, numberItems); this.PAGBOT.InitPager(QuickParameters.PageNumber, numberItems); if (numberItems > 0) { HasContent = true; this.NOITEMPH.Visible = false; } else { HasContent = false; } }
// Interface IReloadable public void Reload() { if (!Helper.IsObjectTypeEnabled(QuickParameters.ObjectType)) { return; } if (!string.IsNullOrEmpty(Request.QueryString["Tag"])) { currentTagSrch = Request.QueryString["Tag"]; } UserDataContext udc = UserDataContext.GetUserDataContext(); QuickParameters.Udc = udc; QuickParameters.WithCopy = false; QuickParameters.OnlyConverted = true; QuickParameters.ShowState = ObjectShowState.Published; QuickParameters.TagID = DataObjectTag.GetTagID(currentTagSrch); this.OBJOVW.DataSource = DataObjects.Load <Business.DataObjectProduct>(QuickParameters); numberItems = ((DataObjectList <Business.DataObjectProduct>) this.OBJOVW.DataSource).ItemTotal; this.OBJOVW.DataBind(); this.PAGTOP.InitPager(QuickParameters.PageNumber, numberItems); this.PAGBOT.InitPager(QuickParameters.PageNumber, numberItems); if (numberItems > 0) { HasContent = true; this.NOITEMPH.Visible = false; } else { HasContent = false; } }
public void Save() { user = DataObject.Load <DataObjectUser>(UserProfile.Current.UserId, null, true); int iRptItemCount = 0; List <InterestTopic> interestTopics = rptTopics.DataSource as List <InterestTopic>; foreach (InterestTopic interestTopic in interestTopics) { CheckBoxList cblSubTopic = rptTopics.Items[iRptItemCount].FindControl(string.Format("ST{0}", interestTopic.ID)) as CheckBoxList; CheckBox cbxGrp1 = rptTopics.Items[iRptItemCount].FindControl(string.Format("GRP{0}", interestTopic.ID)) as CheckBox; if (cblSubTopic != null && cbxGrp1 != null) { PropertyInfo propertyInfo = typeof(DataObjectUser).GetProperty(interestTopic.DBField); propertyInfo.SetValue(user, GetComaSeparatetdValues(cblSubTopic.Items), null); PropertyInfo propertyInfo2 = typeof(DataObjectUser).GetProperty(interestTopic.DBField + "Show"); propertyInfo2.SetValue(user, cbxGrp1.Checked, null); /*if (!string.IsNullOrEmpty(GetComaSeparatetdValues(cblSubTopic.Items))) * { * _4screen.CSB.Extensions.Business.IncentivePointsManager.AddIncentivePointEvent(string.Format("PROFILE_{0}", interestTopic.DBField.ToUpper()), UserDataContext.GetUserDataContext()); * }*/ } iRptItemCount++; } user.Update(UserDataContext.GetUserDataContext()); }
protected void OnLayoutChangeClick(object sender, EventArgs e) { DataObject dataObject = DataObject.Load <DataObject>(CommunityID, null, false); if ((dataObject.GetUserAccess(UserDataContext.GetUserDataContext()) & ObjectAccessRight.Update) != ObjectAccessRight.Update) { throw new Exception("Access rights missing"); } hitblCommunity.CtyLayout = rblLayouts.SelectedValue; hitblCommunity.Save(); int previousColumnCount = Layouts.GetLayout(originalLayout).NumberDropZones; int newColumnCount = Layouts.GetLayout(rblLayouts.SelectedValue).NumberDropZones; if (previousColumnCount > newColumnCount) { SPs.HispWidgetInstanceReorderColumns(hitblCommunity.CtyId, newColumnCount).Execute(); } originalLayout = rblLayouts.SelectedValue; string filteredQueryString = Helper.GetFilteredQueryString(Request.QueryString, new List <string> { "tab" }, false); Response.Redirect(string.Format("{0}?tab=layout{1}", Request.GetRawPath(), filteredQueryString)); }
protected void LbtAnswer_Click(object sender, EventArgs e) { List <int> answers = new List <int>(); foreach (string key in Request.Form.AllKeys) { if (!string.IsNullOrEmpty(key)) { if (key.IndexOf("RblAnswer") > 1) { answers.Add(Convert.ToInt32(Request.Form[key])); } else if (key.IndexOf("CblAnswer") > 1) { int last = key.LastIndexOf("$"); answers.Add(Convert.ToInt32(key.Substring(last + 1))); } } } if (answers.Count > 0) { pollQuestion = DataObjectPollQuestion.Load <DataObjectPollQuestion>(pollQuestion.ObjectID, null, true); RenderPoll(DataObjectPollQuestion.AddPollAnswer(UserDataContext.GetUserDataContext(), pollQuestion, answers)); } }
public static DataObjectNews CreateNews(DataObjectNews receivedDataObject) { WebServiceLogEntry log = new WebServiceLogEntry() { ServiceType = WebServiceType.REST, ServiceName = "IDataService", Method = "CreateNews", Parameters = "DataObjectNews" }; try { DataServiceHelper.Create(log, receivedDataObject, Common.Helper.GetObjectType("News").NumericId); Helper.GetImages(log, receivedDataObject, null); receivedDataObject.Update(UserDataContext.GetUserDataContext(OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name)); if (receivedDataObject.State == ObjectState.Saved) { log.Write(HttpStatusCode.OK.ToString()); return(receivedDataObject); } throw new RESTException(HttpStatusCode.NotFound, "Not Updated (specific)"); } catch (RESTException e) { log.Message = e.StatusDescription; log.Write(e.StatusCode.ToString()); return(null); } catch (Exception e) { Helper.SetResponseStatus(log, HttpStatusCode.InternalServerError, string.Format("Not Created -> {0}", e.Message)); log.ExtendedMessage = e.StackTrace; log.Write(); return(null); } }
protected override void OnInit(EventArgs e) { base.OnInit(e); doComment = this.DataObject as DataObjectComment; Control ctrl = this.LoadControl("/UserControls/Templates/SmallOutputUser2.ascx"); SmallOutputUser2 userOutput = ctrl as SmallOutputUser2; SetUserOutput(userOutput, doComment.UserID.Value, doComment.Nickname); phUserOutput.Controls.Add(userOutput); if (doComment.CommentStatus == 0) { CommentPreview commentPreview = (CommentPreview)LoadControl("/UserControls/Dashboard/CommentPreview.ascx"); commentPreview.Comment = doComment; commentPreview.StripHtml = false; commentPreview.Type = "Comment"; phCommentOuput.Controls.Add(commentPreview); LbtnDel.Visible = false; if (UserDataContext.GetUserDataContext().IsAdmin&& doComment.CommentStatus != 1) { LbtnDel.Visible = true; LbtnDel.ID = "del_" + doComment.ObjectID.ToString().Replace("-", ""); LbtnDel.CommandArgument = doComment.ObjectID.ToString(); } } else { phCommentOuput.Controls.Add(new LiteralControl(languageShared.GetString("MessageCommentDeletedByAdmin"))); LbtnDel.Visible = false; } }
public void Save() { user = DataObject.Load <DataObjectUser>(UserProfile.Current.UserId, null, true); StringBuilder userInput = new StringBuilder(); user.Beruf = txtBeruf.Text; user.BerufShow = cbxGrp1.Checked; user.Lebensmoto = txtMotto.Text; user.LebensmotoShow = cbxGrp1.Checked; for (int i = 0; i < talentTextboxes.Count; i++) { PropertyInfo propertyInfo = typeof(DataObjectUser).GetProperty(profileDataGeneralItems[i].DBField); propertyInfo.SetValue(user, talentTextboxes[i].Text, null); PropertyInfo propertyInfo2 = typeof(DataObjectUser).GetProperty(profileDataGeneralItems[i].DBField + "Show"); propertyInfo2.SetValue(user, cbxGrp1.Checked, null); userInput.Append(talentTextboxes[i].Text); } user.Update(UserDataContext.GetUserDataContext()); if (user.State == ObjectState.Saved) { if (userInput.Length > 0) { _4screen.CSB.Extensions.Business.IncentivePointsManager.AddIncentivePointEvent("PROFILE_WHO_AM_I", UserDataContext.GetUserDataContext()); } } }
protected void rep_ItemDataBound(object sender, RepeaterItemEventArgs e) { Member item = e.Item.DataItem as Member; Literal li = e.Item.FindControl("liNam") as Literal; li.Text = item.UserName; PlaceHolder ph = e.Item.FindControl("phMem") as PlaceHolder; if (!UserDataContext.GetUserDataContext(item.UserName).IsAdmin) { LinkButton btn = new LinkButton(); btn.Text = language.GetString("CommandRemoveMember"); btn.CssClass = "inputButton"; btn.ID = string.Concat("del", item.UserId.ToString()); btn.CommandArgument = item.UserId.ToString(); btn.Click += new EventHandler(OnRemoveMemberClick); if (intCount < 2 && item.IsOwner) { btn.Enabled = false; } ph.Controls.Add(btn); ph = e.Item.FindControl("phOwn") as PlaceHolder; CheckBox cbx = new CheckBox(); cbx.ID = string.Concat("own", item.UserId.ToString()); cbx.Text = language.GetString("LableOwner"); cbx.Checked = item.IsOwner; ph.Controls.Add(cbx); } }
public void Reset() { DataObject dataObject = DataObject.Load <DataObject>(CommunityID); if ((dataObject.GetUserAccess(UserDataContext.GetUserDataContext()) & ObjectAccessRight.Update) != ObjectAccessRight.Update) { throw new Exception("Access rights missing"); } HitblCommunityCty comm = HitblCommunityCty.FetchByID(CommunityID); if (Section == StyleSection.Header) { comm.CtyHeaderStyle = string.Empty; } else if (Section == StyleSection.Body) { comm.CtyBodyStyle = string.Empty; } else if (Section == StyleSection.Footer) { comm.CtyFooterStyle = string.Empty; } comm.Save(); }
protected void OnCancelClick(object sender, EventArgs e) { if (wizard.AccessMode == AccessMode.Insert) { if (objectId.HasValue) { DataObject dataObject = DataObject.Load <DataObject>(objectId, null, true); if (dataObject.State != ObjectState.Added) { dataObject.Delete(); } } else if (!string.IsNullOrEmpty(Request.QueryString["UploadSession"])) { DataObjectList <DataObject> dataObjectsByUploadSession = DataObjects.Load <DataObject>(new QuickParameters { Udc = UserDataContext.GetUserDataContext(), ObjectType = Helper.GetObjectType(wizard.ObjectType).NumericId, SortBy = QuickSort.InsertedDate, Direction = QuickSortDirection.Asc, GroupID = Request.QueryString["UploadSession"].ToGuid(), DisablePaging = true, IgnoreCache = true, QuerySourceType = QuerySourceType.MyContent }); foreach (var dataObject in dataObjectsByUploadSession) { dataObject.Delete(); } } } ScriptManager.RegisterStartupScript(this, this.GetType(), "closeWindow", "$telerik.$(function() { GetRadWindow().Close(); } );", true); }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["UploadSession"])) { uploadSession = Request.QueryString["UploadSession"].ToGuid(); } string uploadFolder = string.Format(@"{0}\{1}\{2}", System.Configuration.ConfigurationManager.AppSettings["ConverterRootPathUpload"], UserProfile.Current.UserId, Helper.GetMediaFolder(ObjectType)); DataObjectList <DataObject> dataObjectsByUploadSession = DataObjects.Load <DataObject>(new QuickParameters { Udc = UserDataContext.GetUserDataContext(UserProfile.Current.UserName), ObjectType = ObjectType, SortBy = QuickSort.InsertedDate, Direction = QuickSortDirection.Asc, GroupID = uploadSession, DisablePaging = true, IgnoreCache = true, QuerySourceType = QuerySourceType.MyContent }); if (dataObjectsByUploadSession.Count == 0) // No objects found for groupId=uploadSession { string[] uploadedFiles = Directory.GetFiles(uploadFolder, string.Format("{0}*.*", uploadSession.ToString().Replace("-", ""))); Array.Sort(uploadedFiles); for (int i = 0; i < uploadedFiles.Length; i++) { FileInfo uploadedFileInfo = new FileInfo(uploadedFiles[i]); StepsASCX subStep = InitSubStep(uploadedFileInfo, null, i, uploadedFiles.Length); } } else { for (int i = 0; i < dataObjectsByUploadSession.Count; i++) { StepsASCX subStep = InitSubStep(null, dataObjectsByUploadSession[i].ObjectID, i, dataObjectsByUploadSession.Count); } } }
private bool Save() { try { if (string.IsNullOrEmpty(TxtTitle.Text.StripHTMLTags())) { pnlStatus.Visible = true; litStatus.Text = language.GetString("MessageTitleRequired"); } else { forumTopic.Title = Common.Extensions.StripHTMLTags(this.TxtTitle.Text); forumTopic.Description = Common.Extensions.StripHTMLTags(this.TxtDesc.Text).CropString(20000); if (objectExisting) { forumTopic.Update(UserDataContext.GetUserDataContext()); } else { forumTopic.Insert(UserDataContext.GetUserDataContext(), Request.QueryString["FID"].ToGuid(), Helper.GetObjectTypeNumericID("Forum")); } return(true); } } catch (Exception e) { pnlStatus.Visible = true; litStatus.Text = "Forum Topic konnte nicht gespeichert werden: " + e.Message; } return(false); }
protected override void OnInit(EventArgs e) { base.OnInit(e); string currentTab = Request.Form[hfCT.UniqueID]; if (!string.IsNullOrEmpty(currentTab)) { currentPageTabIndex = int.Parse(currentTab); } survey = DataObject.Load <DataObjectSurvey>(ObjectID, null, true); surveyDataClassDataContext = new SurveyDataClassDataContext(); if (survey.State == ObjectState.Added) { survey.ObjectID = ObjectID; survey.Title = GuiLanguage.GetGuiLanguage("Shared").GetString("LabelUnnamed"); survey.CommunityID = CommunityID; survey.ShowState = ObjectShowState.InProgress; survey.PunkteGelb = 0; survey.PunkteGruen = 0; survey.PunkteRot = 0; survey.Insert(UserDataContext.GetUserDataContext()); survey.Title = string.Empty; } survey.SetValuesFromQuerySting(); FillEditForm(); }
protected void Page_Load(object sender, EventArgs e) { Guid?containerId = null; if (PageInfo.UserId.HasValue) { containerId = PageInfo.UserId; } else if (PageInfo.CommunityId.HasValue) { containerId = PageInfo.CommunityId; } isAdmin = UserDataContext.GetUserDataContext().IsAdmin; if (containerId.HasValue && (isAdmin || CustomizationSection.CachedInstance.CustomizationBar.Enabled)) { DataObject dataObj = DataObject.Load <DataObject>(containerId.Value, null, false); if (dataObj.State != ObjectState.Added) { if ((dataObj.GetUserAccess(UserDataContext.GetUserDataContext()) & ObjectAccessRight.Update) == ObjectAccessRight.Update) { functions.Visible = true; RenderControls(functionsPlaceHolder, dataObj); } } } functions.ID = null; }
protected void Page_Load(object sender, EventArgs e) { udc = UserDataContext.GetUserDataContext(); _4screen.CSB.Extensions.Business.TrackingManager.TrackEventPage(null, null, IsPostBack, LogSitePageType.MyContent); int objectType = Convert.ToInt32(Request.QueryString["type"]); DataObject dataObject = DataObject.Load <DataObject>(Request.QueryString["Id"].ToGuid(), null, true); if (dataObject.State != ObjectState.Added) { if (CustomizationSection.CachedInstance.MyContent.DeleteEvent == DeleteEvents.Delete) { dataObject.Delete(udc); } else if (CustomizationSection.CachedInstance.MyContent.DeleteEvent == DeleteEvents.StatusDeleted) { dataObject.MarkAsDeleted(udc); } _4screen.CSB.Extensions.Business.IncentivePointsManager.AddIncentivePointEvent(string.Format("{0}_DELETE", objectType.ToString().ToUpper()), udc, dataObject.ObjectID.Value.ToString()); TrackingManager.TrackObjectEvent(dataObject.ObjectType, dataObject.ObjectID, TrackRule.Deleted, string.Empty); } litScript.Text = "<script type ='text/javascript'>$telerik.$(function() { CloseWindow(); } );</script>"; }
public void LbtnOpenIDRemoveClick(object sender, EventArgs e) { user.OpenID = string.Empty; user.Update(UserDataContext.GetUserDataContext()); this.LitOpenIDMsg.Text = language.GetString("MessageOpenIdRemoved"); this.LitOpenIDCur.Text = ""; }
protected void Page_Load(object sender, EventArgs e) { udc = UserDataContext.GetUserDataContext(); if (Settings.ContainsKey("ParentObjectType") && !string.IsNullOrEmpty(Settings["ParentObjectType"].ToString())) { objectType = (int)Settings["ParentObjectType"]; } if (objectType == Helper.GetObjectTypeNumericID("Community")) { if (Settings.ContainsKey("ParentCommunityID") && !string.IsNullOrEmpty(Settings["ParentCommunityID"].ToString())) { communityID = Settings["ParentCommunityID"].ToString(); uploadWhereMsg = language.GetString("MsgUploadToCommunity"); } else { communityID = UserProfile.Current.ProfileCommunityID.ToString(); uploadWhereMsg = language.GetString("MsgUploadToProfil"); } } else { communityID = UserProfile.Current.ProfileCommunityID.ToString(); uploadWhereMsg = language.GetString("MsgUploadToProfil"); } community = new Community(communityID); }
protected void Page_Load(object sender, EventArgs e) { bool isAdmin = UserDataContext.GetUserDataContext().IsAdmin; string filteredQueryString = Helper.GetFilteredQueryString(Request.QueryString, new List <string> { "tab" }, false); LnkWidgetSelect.CssClass = "cBarTabInactive"; LnkWidgetSelect.Visible = isAdmin || CustomizationSection.CachedInstance.CustomizationBar["Widgets"].Enabled; LnkWidgetSelect.NavigateUrl = string.Format("{0}?tab=widgets{1}", Request.GetRawPath(), filteredQueryString); LnkContent.CssClass = "cBarTabInactive"; LnkContent.Visible = isAdmin || CustomizationSection.CachedInstance.CustomizationBar["Content"].Enabled; LnkContent.NavigateUrl = string.Format("{0}?tab=content{1}", Request.GetRawPath(), filteredQueryString); if (Request.QueryString["tab"] == "content" && LnkContent.Visible) { MVCustBar.ActiveViewIndex = 1; LnkContent.CssClass = "cBarTab"; } else if (LnkWidgetSelect.Visible) { MVCustBar.ActiveViewIndex = 0; LnkWidgetSelect.CssClass = "cBarTab"; } WT.CommunityID = CommunityID; WT.Visible = isAdmin || CustomizationSection.CachedInstance.CustomizationBar["Widgets"].Enabled; CH.CommunityID = CommunityID; CH.Visible = isAdmin || CustomizationSection.CachedInstance.CustomizationBar["Content"].Enabled; LnkContent.ID = null; LnkWidgetSelect.ID = null; }
protected void Page_Load(object sender, EventArgs e) { udc = UserDataContext.GetUserDataContext(); if (!string.IsNullOrEmpty(Request.QueryString["PN"])) { currentPage = Convert.ToInt32(Request.QueryString["PN"]); } pager.PageSize = pageSize; forum = (DataObjectForum)dataObject; LitDesc.Text = forum.Description; bool isMember; bool isOwner = Community.GetIsUserOwner(UserProfile.Current.UserId, forum.CommunityID.Value, out isMember); if ((forum.ThreadCreationUsers == CommunityUsersType.Owners && isOwner) || (forum.ThreadCreationUsers == CommunityUsersType.Members && isMember) || (forum.ThreadCreationUsers == CommunityUsersType.Authenticated && udc.IsAuthenticated) || udc.IsAdmin) { lnkCreate.NavigateUrl = string.Format("/M/Admin/EditForumTopic.aspx?FID={0}", forum.ObjectID); } else { lnkCreate.Enabled = false; } lnkCreate.ID = null; Reload(); }
protected void Page_Load(object sender, EventArgs e) { UserDataContext udc = UserDataContext.GetUserDataContext(); DataObjectCommunity myProfile = DataObject.Load <DataObjectCommunity>(UserProfile.Current.ProfileCommunityID); QuickParameters quickParameters = new QuickParameters() { Udc = udc, UserID = UserProfile.Current.UserId, IgnoreCache = true, MembershipParams = new MembershipParams { UserID = UserProfile.Current.UserId } }; List <DataObjectCommunity> involvedCommunities = DataObjects.Load <DataObjectCommunity>(quickParameters); involvedCommunities.Insert(0, myProfile); this.CTYS.DataSource = involvedCommunities; this.CTYS.DataBind(); if (!string.IsNullOrEmpty(CloseWindowJavaScript)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "CloseWindowJavaScript", CloseWindowJavaScript, false); } }
public override bool ShowObject(string settingsXml) { string template = "LoginSSO.ascx"; if (WidgetHost.OutputTemplate != null) { if (!string.IsNullOrEmpty(WidgetHost.OutputTemplate.OutputTemplateControl)) { template = WidgetHost.OutputTemplate.OutputTemplateControl; } } Control control = this.LoadControl("~/UserControls/Templates/" + template); IMinimalControl minimal = control as IMinimalControl; control.ID = "LoginSSO"; PnlCnt.Controls.Add(control); if (Request.IsAuthenticated && !UserDataContext.GetUserDataContext().IsAdmin) { //hide the widget Control wgt = WidgetHelper.GetWidgetHost(this, 0, 6); if (wgt != null) { wgt.Visible = false; return(false); } } return(minimal.HasContent); }
private void FillFormData() { UserDataContext udc = UserDataContext.GetUserDataContext(); if (udc.IsAuthenticated) { DataObjectUser user = DataObjectUser.Load <DataObjectUser>(udc.UserID, null, true); if (user.Sex.IndexOf("-1") > -1) { Helper.Ddl_SelectItem(this.Sex, 1); } else if (user.Sex.IndexOf("0") > -1) { Helper.Ddl_SelectItem(this.Sex, 0); } else if (user.Sex.IndexOf("1") > -1) { Helper.Ddl_SelectItem(this.Sex, 1); } else { Helper.Ddl_SelectItem(this.Sex, -1); } this.Name.Text = user.Name; this.Vorname.Text = user.Vorname; this.AddressStreet.Text = user.AddressStreet; this.AddressZip.Text = user.AddressZip; this.AddressCity.Text = user.AddressCity; this.EMail.Text = Membership.GetUser(udc.UserID).Email; this.Phone.Text = user.Phone; } }
public int SetEmphasis() { int intTotal = 0; XmlDocument xmlConfig = new XmlDocument(); xmlConfig.Load(string.Format(@"{0}\configurations\dataAccess.config", WebRootPath.Instance.ToString())); UserDataContext udc = UserDataContext.GetUserDataContext(); Dictionary<int, int> dicThreshold = new Dictionary<int, int>(); foreach (XmlElement xmlItem in xmlConfig.SelectNodes("//EmphasisPercent/Threshold")) { int enuObjectType = Helper.GetObjectTypeNumericID(xmlItem.GetAttribute("ObjectType")); int intCount = Convert.ToInt32(xmlItem.InnerText); if (!dicThreshold.ContainsKey(enuObjectType)) dicThreshold.Add(enuObjectType, intCount); } SqlDataReader sqlReader = null; try { // User sqlReader = GetEmphasisReader(Helper.GetObjectType("User").NumericId); while (sqlReader.Read()) { if (blnCancel) break; if (SetEmphasisUser(sqlReader["OBJ_ID"].ToString().ToGuid(), dicThreshold, udc)) intTotal++; } if (sqlReader != null) sqlReader.Close(); sqlReader = null; if (blnCancel) return intTotal; // Community sqlReader = GetEmphasisReader(Helper.GetObjectType("Community").NumericId); while (sqlReader.Read()) { if (blnCancel) break; if (SetEmphasisCommunity(sqlReader["OBJ_ID"].ToString().ToGuid(), dicThreshold, udc)) intTotal++; } if (sqlReader != null) sqlReader.Close(); sqlReader = null; } finally { if (sqlReader != null) sqlReader.Close(); sqlReader = null; } return intTotal; }
protected void Page_Load(object sender, EventArgs e) { LnkTitle.Text = DataObject.Title; LnkTitle.NavigateUrl = Helper.GetDetailLink(DataObject.ObjectType, DataObject.ObjectID.Value.ToString()); LnkTitle.ID = null; List <DataObjectForumTopicItem> forumTopicItem = DataObjects.Load <DataObjectForumTopicItem>(new QuickParameters() { RelationParams = new RelationParams { ParentObjectID = DataObject.ObjectID, ParentObjectType = Helper.GetObjectTypeNumericID("ForumTopic") }, Udc = UserDataContext.GetUserDataContext(), PageNumber = 1, PageSize = 1, IgnoreCache = false, SortBy = QuickSort.InsertedDate, Direction = QuickSortDirection.Desc }); if (forumTopicItem.Count == 1) { pnlInfo2.Visible = true; LitDesc.Text = string.Format("{0} / {1} {2}", forumTopicItem[0].Nickname, forumTopicItem[0].Inserted.ToShortDateString(), forumTopicItem[0].Inserted.ToShortTimeString()); LitDesc2.Text = forumTopicItem[0].Description.StripHTMLTags().CropString(80); } else { pnlInfo.Visible = true; } }