Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Disable tooltip managers by default -> tooltip managers without targets don't work
            this.RTTM.Visible    = false;
            this.RTTMIMG.Visible = false;
            this.article         = (DataObjectArticle)dataObject;

            if (article != null)
            {
                foreach (string tooltipId in _4screen.CSB.DataAccess.Business.AdWordHelper.GetCampaignObjectIds(article.ObjectID.Value))
                {
                    this.RTTM.TargetControls.Add(tooltipId, true);
                    this.RTTM.Visible = true;
                }
            }

            this.DETSUBTITLE.Text = article.DescriptionLinked;
            this.ARTTXTLIT.Text   = article.ArticleTextLinked;

            string idPrefix;

            articlePictures = _4screen.CSB.DataAccess.Business.Utils.GetPicturesFromContent(article.ArticleText, out idPrefix);
            foreach (var pictureId in articlePictures.Keys)
            {
                string imageId = string.Format("Img_{0}", pictureId);
                this.RTTMIMG.TargetControls.Add(imageId, true);
                this.RTTMIMG.Visible = true;
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            article = DataObject.Load <DataObjectArticle>(ObjectID, null, true);
            if (article.State == ObjectState.Added)
            {
                article.ObjectID    = ObjectID;
                article.Title       = GuiLanguage.GetGuiLanguage("Shared").GetString("LabelUnnamed");
                article.CommunityID = CommunityID;
                article.ShowState   = ObjectShowState.Draft;
                article.Insert(UserDataContext.GetUserDataContext());
                article.Title = string.Empty;
            }

            if (!string.IsNullOrEmpty(Request.QueryString["TG"]))
            {
                article.TagList = Server.UrlDecode(Request.QueryString["TG"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["OS"]))
            {
                article.Status = (ObjectStatus)int.Parse(Request.QueryString["OS"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["SS"]))
            {
                article.ShowState = (ObjectShowState)int.Parse(Request.QueryString["SS"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["CR"]))
            {
                article.Copyright = int.Parse(Request.QueryString["CR"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["GC"]))
            {
                string[] geoLatLong = Request.QueryString["GC"].Split(',');
                double   geoLat, geoLong = double.MinValue;
                if (geoLatLong.Length == 2)
                {
                    if (double.TryParse(geoLatLong[0], out geoLat) && double.TryParse(geoLatLong[1], out geoLong))
                    {
                        article.Geo_Lat  = geoLat;
                        article.Geo_Long = geoLong;
                    }
                }
            }
            if (!string.IsNullOrEmpty(Request.QueryString["ZP"]))
            {
                article.Zip = Server.UrlDecode(Request.QueryString["ZP"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["CI"]))
            {
                article.City = Server.UrlDecode(Request.QueryString["CI"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["RE"]))
            {
                article.Street = Server.UrlDecode(Request.QueryString["RE"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["CO"]))
            {
                article.CountryCode = Server.UrlDecode(Request.QueryString["CO"]);
            }

            FillEditForm();
        }