Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            get_totals();

            permissions();

            // check for edit
            if (Page.RouteData.Values["id"] != null)
            {
                btn_process.Text = "Update";
                add_edit         = "Update";
            }
            else
            {
                btn_process.Text = "Add";
            }

            if (!Page.IsPostBack)
            {
                if (Page.RouteData.Values["id"] != null)
                {
                    Event ev = _events.@select(Convert.ToInt32(Page.RouteData.Values["id"] as string));

                    title.Text          = ev.title;
                    description.Text    = ev.description;
                    client.Text         = ev.client;
                    address.Text        = ev.address;
                    address2.Text       = ev.address2;
                    city.Text           = ev.city;
                    state.Text          = ev.state;
                    zip.Text            = ev.zip;
                    country.Text        = ev.country;
                    hdn_latitude.Value  = ev.latitude.ToString();
                    hdn_longitude.Value = ev.longitude.ToString();
                    start_date.Text     = ev.start.ToShortDateString();
                    start_time.Text     = ev.start.ToShortTimeString();
                    end_date.Text       = ev.end.ToShortDateString();
                    end_time.Text       = ev.end.ToShortTimeString();
                    moderate.Checked    = ev.moderate;
                    listenSlider.Value  = ev.interval.ToString();
                    interval            = ev.interval.ToString();

                    if (!string.IsNullOrEmpty(ev.background_1280))
                    {
                        ph_current_1280.Controls.Add(new LiteralControl("<h6>Current 1280 x 720 Background</h6><p><img src=\"/uploads/" + ev.background_1280 + "\" width=\"100%\" /></p>"));
                    }

                    if (!string.IsNullOrEmpty(ev.background_1920))
                    {
                        ph_current_1920.Controls.Add(new LiteralControl("<h6>Current 1920 x 1280 Background</h6><p><img src=\"/uploads/" + ev.background_1920 + "\" width=\"100%\" /></p>"));
                    }

                    pnl_map.Visible     = true;
                    btn_dropbox.Visible = true;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Int32 event_id = Convert.ToInt32(Page.RouteData.Values["id"] as string);

            hdn_event_id.Value = event_id.ToString();

            _events.force_refresh(event_id);

            overrideSocial.Event ev = _events.@select(event_id);

            if (!string.IsNullOrEmpty(ev.background_1280))
            {
                bdy.Attributes.CssStyle.Add("background-image", "/uploads/" + ev.background_1280);
            }

            if (Page.RouteData.Values["display"] != null)
            {
                hdn_interval.Value = "12";//Page.RouteData.Values["delay"].ToString();
                delay = Page.RouteData.Values["display"] as string;
                delay = delay + @"000";

                hdn_interval.Value = delay;
            }

            List <Media> med = _media.get_instagram_reverse(event_id);

            med.AddRange(_media.get_twitter_reverse(event_id));

            hdn_max.Value = (med.Count - 1).ToString();

            Int32 i = 1;

            foreach (Media m in med)
            {
                ph_photos.Controls.Add(new LiteralControl("<div id=\"content" + i + "\" class=\"content\"><div class=\"photo_holder\"><img src=\"" + m.source + "\" style=\"width:100%;max-height:100%;margin: auto auto;\" /></div><div class=\"content_holder\"><div class=\"userinfo\"><span class=\"fullname\">" + m.full_name + "</span><span class=\"username\">" + m.username + "</span><br /><span class=\"postdate\">" + _functions.relative_time(m.createdate) + "</span></div><div class=\"profile-pic\"><img src=\"" + m.profilepic.Replace("_normal", "") + "\" width=\"75\" height=\"75\" /></div><br clear=\"all\"/><br clear=\"all\"/><div class=\"description\">" + m.description + "</div><br clear=\"all\"/><br clear=\"all\"/>"));

                if (!string.IsNullOrEmpty(m.latitude) && m.latitude != "0")
                {
                    // render the map
                    ph_photos.Controls.Add(new LiteralControl("<div id=\"map" + i + "\" class=\"map\"><img src=\"http://maps.googleapis.com/maps/api/staticmap?center=" + m.latitude + "," + m.longitude + "&zoom=13&scale=false&size=250x150&maptype=roadmap&sensor=false&format=png&visual_refresh=true&markers=size:mid%7Ccolor:red%7C" + m.latitude + "," + m.longitude + "\" /><br />" + m.location_name + "</div>"));
                }

                ph_photos.Controls.Add(new LiteralControl("</div></div>"));

                i++;
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            get_totals();

            DropNetClient _client = new DropNetClient(_settings.dropbox_api_key(), _settings.dropbox_api_secret());

            permissions();

            if (Session["request_token"] != null)
            {
                Event ev = _events.@select(Convert.ToInt32(Session["dropbox_event_id"] as string));

                _client.UserLogin = Session["request_token"] as DropNet.Models.UserLogin;

                var access_token = _client.GetAccessToken();

                var account_info = _client.AccountInfo();

                ev.request_token    = access_token.Token.ToString();
                ev.access_token     = access_token.Secret.ToString();
                ev.dropbox_country  = account_info.country;
                ev.dropbox_email    = account_info.email;
                ev.dropbox_quota    = account_info.quota_info.quota.ToString();
                ev.dropbox_referral = account_info.referral_link;
                ev.dropbox_uid      = account_info.uid;
                ev.dropbox_username = account_info.display_name;

                ev = _events.update(ev);

                username.Attributes.Add("placeholder", account_info.display_name);
                email.Attributes.Add("placeholder", ev.dropbox_email);
                quota.Attributes.Add("placeholder", ev.dropbox_quota);
                referral.Attributes.Add("placeholder", ev.dropbox_referral);
                uid.Attributes.Add("placeholder", ev.dropbox_uid.ToString());
                country.Attributes.Add("placeholder", ev.dropbox_country);
            }
            else
            {
                Response.Redirect("/events");
            }
        }