private void FillEditForm() { this.Img.Src = string.Format("{0}/{1}", _4screen.CSB.Common.SiteConfig.MediaDomainName, dataObjectEvent.GetImage(PictureVersion.S)); this.LnkImage.Attributes.Add("onClick", string.Format("radWinOpen('/Pages/Popups/SinglePictureUpload.aspx?OID={0}&ParentRadWin=wizardWin', 'Bild hochladen', 400, 100, false, null, 'imageWin')", dataObjectEvent.ObjectID)); RevWebsite.ValidationExpression = Constants.REGEX_URL; this.TxtTitle.Text = dataObjectEvent.Title; this.TxtDesc.Text = dataObjectEvent.Description; this.TxtEvent.Content = dataObjectEvent.Content; this.TxtWebsite.Text = dataObjectEvent.Website != null?dataObjectEvent.Website.ToString() : string.Empty; this.HFTagWords.Value = dataObjectEvent.TagList.Replace(Constants.TAG_DELIMITER, ','); this.HFStatus.Value = ((int)dataObjectEvent.Status).ToString(); this.HFShowState.Value = ((int)dataObjectEvent.ShowState).ToString(); this.HFCopyright.Value = dataObjectEvent.Copyright.ToString(); if (dataObjectEvent.Geo_Lat != double.MinValue && dataObjectEvent.Geo_Long != double.MinValue) { this.HFGeoLat.Value = dataObjectEvent.Geo_Lat.ToString(); this.HFGeoLong.Value = dataObjectEvent.Geo_Long.ToString(); } this.HFZip.Value = dataObjectEvent.Zip; this.HFCity.Value = dataObjectEvent.City; this.HFStreet.Value = dataObjectEvent.Street; this.HFCountry.Value = dataObjectEvent.CountryCode; this.RDPFromDate.SelectedDate = dataObjectEvent.StartDate; this.RDPToDate.SelectedDate = dataObjectEvent.EndDate == DateTime.MaxValue ? dataObjectEvent.StartDate : dataObjectEvent.EndDate; this.TxtTime.Text = dataObjectEvent.Time; this.TxtPrice.Text = dataObjectEvent.Price; this.TxtAge.Text = dataObjectEvent.Age; DataObjectLocation currentLocation = DataObjects.Load <DataObjectLocation>(new QuickParameters() { Udc = UserDataContext.GetUserDataContext(), DisablePaging = true, IgnoreCache = true, RelationParams = new RelationParams() { ChildObjectID = dataObjectEvent.ObjectID } }).SingleOrDefault(); DDLocations.EmptyMessage = "Location suchen"; DDLocations.DataTextField = "Title"; DDLocations.DataValueField = "ObjectID"; DDLocations.DataSource = DataObjects.Load <DataObjectLocation>(new QuickParameters() { Udc = UserDataContext.GetUserDataContext(), SortBy = QuickSort.Title, Direction = QuickSortDirection.Asc, DisablePaging = true, IgnoreCache = true }); DDLocations.DataBind(); if (currentLocation != null) { DDLocations.SelectedValue = currentLocation.ObjectID.ToString(); } LbtnAddLoc.Attributes.Add("onClick", string.Format("radWinOpen('/Pages/Popups/AddLocation.aspx?OID={0}&CN={1}&ParentRadWin=wizardWin', 'Location hinzufügen', 400, 400, false, 'OnLocationAdded', 'locationWin');", Guid.NewGuid(), dataObjectEvent.CommunityID)); foreach (string i in Enum.GetNames(typeof(EventType))) { string key = string.Format("Text{0}", i); string text = languageShared.GetString(key); if (!string.IsNullOrEmpty(text)) { ListItem item = new ListItem(text, i); item.Selected = dataObjectEvent.TagList.Contains(i); CblType.Items.Add(item); } } }
private void PrintEvent() { if (Request.IsAuthenticated) { string initQuerySegment = "&XCN=" + UserProfile.Current.ProfileCommunityID + "&OID=" + DataObject.ObjectID; if (!SiteConfig.UsePopupWindows) { initQuerySegment += "&ReturnUrl=" + System.Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(Request.RawUrl)); } LnkRelCnt.NavigateUrl = string.Format("javascript:radWinOpen('{0}{1}', '{2}', 800, 500, true, null, 'wizardWin')", Helper.GetWizardLink("AddPicturesAndVideos", SiteConfig.UsePopupWindows), initQuerySegment, GuiLanguage.GetGuiLanguage("UserControls.Templates.WebUI.Base").GetString("CommandAddPicturesAndVideos")); } else { LnkRelCnt.Enabled = false; LnkRelCnt.ToolTip = (new TextControl() { LanguageFile = "UserControls.Templates.WebUI.Base", TextKey = "TooltipLoginToAddPhotosAndVideos" }).Text; } LnkRelCnt.ID = null; if (!string.IsNullOrEmpty(dataObjectEvent.Image)) { Img.ImageUrl = _4screen.CSB.Common.SiteConfig.MediaDomainName + dataObjectEvent.GetImage(PictureVersion.M); } else { Img.Visible = false; } DataObjectLocation currentLocation = DataObjects.Load <DataObjectLocation>(new QuickParameters() { Udc = UserDataContext.GetUserDataContext(), DisablePaging = true, IgnoreCache = true, RelationParams = new RelationParams() { ChildObjectID = dataObjectEvent.ObjectID } }).SingleOrDefault(); if (currentLocation != null) { LnkLocation.Text = currentLocation.Title; LnkLocation.NavigateUrl = Helper.GetDetailLink(currentLocation.ObjectType, currentLocation.ObjectID.ToString()); LnkLocation.ID = null; if (!string.IsNullOrEmpty(currentLocation.Street)) { LitAddress.Text += currentLocation.Street + "<br/>"; } if (!string.IsNullOrEmpty(currentLocation.City)) { if (!string.IsNullOrEmpty(currentLocation.Zip)) { LitAddress.Text += currentLocation.Zip + " " + currentLocation.City + "<br/>"; } else { LitAddress.Text += currentLocation.City + "<br/>"; } } } LitWhen.Text = dataObjectEvent.StartDate.ToShortDateString(); if (dataObjectEvent.EndDate != DateTime.MaxValue && dataObjectEvent.EndDate != dataObjectEvent.StartDate) { LitWhen.Text += " - " + dataObjectEvent.EndDate.ToShortDateString(); } if (!string.IsNullOrEmpty(dataObjectEvent.Time)) { LitWhen.Text += "<br/>" + dataObjectEvent.Time; } if (!string.IsNullOrEmpty(dataObjectEvent.TagList)) { LitType.Text = string.Join(", ", Helper.GetMappedTagWords(dataObjectEvent.TagList).ToArray()); } if (dataObjectEvent.Website != null) { TrWebsite.Visible = true; LnkWebsite.Text = dataObjectEvent.Website.ToString(); LnkWebsite.NavigateUrl = dataObjectEvent.Website.ToString(); } LnkWebsite.ID = null; if (!string.IsNullOrEmpty(dataObjectEvent.Age)) { TrAge.Visible = true; LitAge.Text = dataObjectEvent.Age; } if (!string.IsNullOrEmpty(dataObjectEvent.Price)) { TrPrice.Visible = true; LitPrice.Text = dataObjectEvent.Price; } if (!string.IsNullOrEmpty(dataObjectEvent.DescriptionLinked)) { TrDesc.Visible = true; LitDesc.Text = dataObjectEvent.DescriptionLinked; } if (!string.IsNullOrEmpty(dataObjectEvent.Content)) { TrEvent.Visible = true; LitEvent.Text = dataObjectEvent.Content; } TrWebsite.ID = null; TrAge.ID = null; TrPrice.ID = null; TrDesc.ID = null; LitDesc.ID = null; }
private void PrintEvent() { LitTitle.Text = dataObjectEvent.Title.EscapeForXHTML(); if (!string.IsNullOrEmpty(dataObjectEvent.Image)) { Img.ImageUrl = _4screen.CSB.Common.SiteConfig.MediaDomainName + dataObjectEvent.GetImage(PictureVersion.S); } else { Img.Visible = false; } DataObjectLocation currentLocation = DataObjects.Load <DataObjectLocation>(new QuickParameters() { Udc = UserDataContext.GetUserDataContext(), DisablePaging = true, IgnoreCache = true, RelationParams = new RelationParams() { ChildObjectID = dataObjectEvent.ObjectID } }).SingleOrDefault(); if (currentLocation != null) { LnkLocation.Text = currentLocation.Title; LnkLocation.NavigateUrl = Helper.GetMobileDetailLink(currentLocation.ObjectType, currentLocation.ObjectID.ToString()); LnkLocation.ID = null; if (!string.IsNullOrEmpty(currentLocation.Street)) { LitAddress.Text += currentLocation.Street + "<br/>"; } if (!string.IsNullOrEmpty(currentLocation.City)) { if (!string.IsNullOrEmpty(currentLocation.Zip)) { LitAddress.Text += currentLocation.Zip + " " + currentLocation.City + "<br/>"; } else { LitAddress.Text += currentLocation.City + "<br/>"; } } } if (DataObject.Geo_Lat != Double.MinValue) { pnlGeoTag.Visible = true; pnlGeoTag.ID = null; lnkGeoTag.NavigateUrl = "http://maps.google.com/?q=" + DataObject.Geo_Lat + "," + DataObject.Geo_Long + "&z=14"; lnkGeoTag.ID = null; } LitWhen.Text = dataObjectEvent.StartDate.ToShortDateString(); if (dataObjectEvent.EndDate != DateTime.MaxValue && dataObjectEvent.EndDate != dataObjectEvent.StartDate) { LitWhen.Text += " - " + dataObjectEvent.EndDate.ToShortDateString(); } if (!string.IsNullOrEmpty(dataObjectEvent.Time)) { LitWhen.Text += "<br/>" + dataObjectEvent.Time.EscapeForXHTML(); } if (!string.IsNullOrEmpty(dataObjectEvent.TagList)) { LitType.Text = string.Join(", ", Helper.GetMappedTagWords(dataObjectEvent.TagList).ToArray()); } if (dataObjectEvent.Website != null) { TrWebsite.Visible = true; LnkWebsite.Text = dataObjectEvent.Website.ToString().EscapeForXHTML(); LnkWebsite.NavigateUrl = dataObjectEvent.Website.ToString(); } LnkWebsite.ID = null; if (!string.IsNullOrEmpty(dataObjectEvent.Age)) { TrAge.Visible = true; LitAge.Text = dataObjectEvent.Age.EscapeForXHTML(); } if (!string.IsNullOrEmpty(dataObjectEvent.Price)) { TrPrice.Visible = true; LitPrice.Text = dataObjectEvent.Price.EscapeForXHTML(); } if (!string.IsNullOrEmpty(dataObjectEvent.Description)) { TrDesc.Visible = true; LitDesc.Text = dataObjectEvent.Description.EscapeForXHTML(); } if (!string.IsNullOrEmpty(dataObjectEvent.Content)) { TrDesc.Visible = true; LitEvent.Text = dataObjectEvent.Content.EscapeForXHTML(); } TrWebsite.ID = null; TrAge.ID = null; TrPrice.ID = null; LitDesc.ID = null; }