/// <summary>
        /// Load multiple events
        /// </summary>
        public void load_multiple_events()
        {
            int           pageID    = Convert.ToInt32(Request.Form["page"]);
            string        filename  = string.Empty;
            StringBuilder strstring = new StringBuilder();
            List <string> li        = new List <string>();

            using (NewGettyAPIclasses.Getimagedata d = new NewGettyAPIclasses.Getimagedata())
            {
                strstring   = d.Getimagesbytoken_events("", "", pageID);;
                lttext.Text = Convert.ToString(strstring);
            }
        }
        /// <summary>
        /// Download multiple images for sites
        /// </summary>
        public async void Download_multiple_image_ForSite()
        {
            string                   strID         = Request.Form["ID"];
            string                   strsiteIdID   = Request.Form["SiteID"];
            string                   strnetworkdID = Request.Form["NetworkID"];
            string                   strjson       = Request.Form["Strjson"];
            string                   filename      = string.Empty;
            string                   strstring     = string.Empty;
            int                      ID            = 0;
            string                   cap           = string.Empty;
            List <string>            li            = new List <string>();
            Dictionary <int, string> l             = new Dictionary <int, string>();

            if (!string.IsNullOrEmpty(strjson))
            {
                dynamic array = JsonConvert.DeserializeObject(strjson);
                foreach (var d in array)
                {
                    var data = d.Value;
                    foreach (var innerd in data)
                    {
                        if (innerd.Name == "ID")
                        {
                            ID = Convert.ToInt32(innerd.Value);
                        }
                        if (innerd.Name == "caption")
                        {
                            cap = Convert.ToString(innerd.Value);
                        }
                    }
                    l.Add(ID, cap);
                    ID = 0; cap = string.Empty;
                }
            }
            using (NewGettyAPIclasses.Getimagedata d = new NewGettyAPIclasses.Getimagedata())
            {
                d.strnetworkid = strnetworkdID;
                d.SiteID       = Convert.ToInt32(strsiteIdID);
                if (l.Count() > 0)
                {
                    strstring = await d.AccessTheWebAsync_download_multiple_imagewithcaption(l);

                    if (!string.IsNullOrEmpty(strstring))
                    {
                        lttext.Text = strstring;
                    }
                }
            }
        }
        /// <summary>
        /// Download images
        /// </summary>
        public async void Downloadimage()
        {
            string strID     = Request.Form["ID"];
            string filename  = string.Empty;
            string strstring = string.Empty;

            using (NewGettyAPIclasses.Getimagedata d = new NewGettyAPIclasses.Getimagedata())
            {
                strstring = await NewGettyAPIclasses.Getimagedata.AccessTheWebAsync_downloadimage(strID);

                if (!string.IsNullOrEmpty(strstring))
                {
                    filename = GoWebshot(strstring, strID);
                    if (!string.IsNullOrEmpty(filename))
                    {
                        lttext.Text = "download successfully....";
                    }
                }
            }
        }
        /// <summary>
        /// Download gettyimages for sites
        /// </summary>
        public async void Downloadimage_ForSite()
        {
            string strID         = Request.Form["ID"];
            string strsiteIdID   = Request.Form["SiteID"];
            string strnetworkdID = Request.Form["NetworkID"];
            string strcaption    = Request.Form["caption"];
            string strlive       = Request.Form["liveup"];
            string filename      = string.Empty;
            string strstring     = string.Empty;

            using (NewGettyAPIclasses.Getimagedata d = new NewGettyAPIclasses.Getimagedata())
            {
                d.strnetworkid = strnetworkdID;
                d.SiteID       = Convert.ToInt32(strsiteIdID);
                strstring      = await d.AccessTheWebAsync_downloadimage_fromID(strID, strcaption, strlive);

                if (!string.IsNullOrEmpty(strstring))
                {
                    lttext.Text = strstring;
                }
            }
        }
Example #5
0
 /// <summary>
 /// On page load bind getty image events
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected async void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (null != Request.QueryString["NwtID"])
         {
             strnetwork = Convert.ToString(Request.QueryString["NwtID"]);
         }
         if (null != Request.QueryString["SiteId"])
         {
             intsiteId = Convert.ToInt32(Request.QueryString["SiteId"].ToString());
         }
         if (null != Request.QueryString["multiple"])
         {
             strmultiple = Convert.ToString(Request.QueryString["multiple"]);
         }
         else
         {
             strmultiple = "N";
         }
         using (NewGettyAPIclasses.Getimagedata d = new NewGettyAPIclasses.Getimagedata())
         {
             if (Request.QueryString["eventId"] == null)
             {
                 strtext = d.Getimagesbytoken_events("", "", 1);
             }
             else
             {
                 inteventid = Convert.ToInt32(Request.QueryString["eventId"]);
                 strtext    = d.Getimagesbytoken_events("", "", 1, inteventid, "N");
             }
         }
     }
     catch (Exception ex)
     {
         ex.ToString();
     }
 }
Example #6
0
        protected async void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (null != Request.QueryString["NwtID"])
                {
                    strnetwork = Convert.ToString(Request.QueryString["NwtID"]);
                }

                if (null != Request.QueryString["SiteId"])
                {
                    intsiteId = Convert.ToInt32(Request.QueryString["SiteId"].ToString());
                }

                using (NewGettyAPIclasses.Getimagedata d = new NewGettyAPIclasses.Getimagedata())
                {
                    strtext = await NewGettyAPIclasses.Getimagedata.AccessTheWebAsync("", 1, "N");
                }
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
        /// <summary>
        /// Search images
        /// </summary>
        public async void Getserchimages()
        {
            string        strsearch   = Request.Form["search"];
            int           page        = Convert.ToInt32(Request.Form["page"]);
            string        strmultiple = Request.Form["_muptilpe"];
            string        strsort     = Request.Form["sort"];
            string        strorient   = Request.Form["orient"];
            string        strdate     = Request.Form["date"];
            StringBuilder strstring   = new StringBuilder();

            using (NewGettyAPIclasses.Getimagedata d = new NewGettyAPIclasses.Getimagedata())
            {
                if (string.IsNullOrEmpty(strmultiple))
                {
                    strmultiple = "N";
                }
                strstring = await NewGettyAPIclasses.Getimagedata.AccessTheWebAsync(strsearch, page, strmultiple, strsort, strorient, strdate);

                if (strstring.Length > 0)
                {
                    lttext.Text = strstring.ToString();
                }
            }
        }