Example #1
0
        protected void btnprev_Click(object sender, EventArgs e)
        {
            try
            {
                GetGettyImageData _objdata = new GetGettyImageData();
                if (txtsearch.Text != "")
                {
                    _objdata._strserachterm = txtsearch.Text.Trim();
                }
                _intstartval = _intstartval - 75;
                //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert(" + _intstartval + ");", true);
                //Response.Write("_intstartval " + _intstartval+"</br>");
                _objdata._intstartcnt    = _intstartval;
                _objdata._strorientation = RDchkbox.SelectedValue;
                if (_intstartval == 1)
                {
                    prev.Visible = false;
                }

                //var _data = _objdata.GetimageDatalist();
                var _data = _objdata.GetimageDatalist_withdaterange();
                if (_data.Count > 0)
                {
                    gettydata.DataSource = _data;
                    gettydata.DataBind();
                    commonfn _objfn = new commonfn();
                    commonfn.setSession("token", _objdata._strtoken);
                    commonfn.setSession("securetoken", _objdata._strsecuretoken);
                    ltscript.Text = "";
                }
                else
                {
                    gettydata.DataSource = null;
                    ltscript.Text        = "Sorry no records found.";
                }
                UpdatePanel1.Update();
            }
            catch (Exception ex)
            {
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex);
                ErrorLog.SaveErrorLog(_strSiteID, "postmultipleimages", "GoWebshot", "GoWebshot", ex.Message, _networkid.ToString());
            }
        }
Example #2
0
        protected void btnalbum_Click(object sender, EventArgs e)
        {
            DataTable     _dt      = new DataTable();
            List <string> _sellist = new List <string>();

            try
            {
                if (null != Request.QueryString["NwtID"])
                {
                    _networkid = Function.GetnetworkID(Request.QueryString["NwtID"].ToString());
                }

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

                if (null != Request.QueryString["randomID"])
                {
                    _strcookiename = Request.QueryString["randomID"].ToString();
                }
                if (null != Request.QueryString["NewsID"])
                {
                    _intnewsID = Convert.ToInt32(Request.QueryString["NewsID"].ToString());
                }

                if (null != Request.QueryString["url"])
                {
                    _redirecturl = HttpUtility.UrlDecode(Request.QueryString["url"].ToString());
                    _redirecturl = _redirecturl.Replace("&amp;", "&");
                }
                if (null != Request.QueryString["news"])
                {
                    _strnews = Request.QueryString["news"].ToString();
                }

                /* List<string> _imagesselect = new List<string>();
                 * foreach (DataListItem _chk in gettydata.Items)
                 * {
                 *   HtmlInputCheckBox _selchk = _chk.FindControl("chkimg") as HtmlInputCheckBox;
                 *   if (_selchk.Checked)
                 *   {
                 *       _imagesselect.Add(_selchk.Value);
                 *   }
                 * }*/
                //get download seleted images
                GetGettyImageData _objdata = new GetGettyImageData();
                _objdata._strsiteID        = !string.IsNullOrEmpty(_strSiteID) ? _strSiteID : "1";
                _objdata._strnetworkID     = _networkid;
                _objdata._strrandomecookie = _strcookiename;
                _objdata._strnewsID        = _intnewsID;
                _objdata._strnews          = _strnews;

                if (null != HttpContext.Current.Session["_dt"])
                {
                    _dt = (DataTable)HttpContext.Current.Session["_dt"];
                    foreach (DataRow _dtval in _dt.Rows)
                    {
                        _sellist.Add(_dtval["ImageID"].ToString());
                    }
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert('" + _sellist.Count + "!');", true);
                }
                //getdownload images.

                /*if (_lilist.Count > 0)
                 * {
                 *  if (_objdata.GetdownloadimagesFromEditors(_lilist))
                 *  {
                 *      ScriptManager.RegisterStartupScript(this, this.GetType(), "close", "javascript:self.close()", true);
                 *  }
                 * }
                 * else
                 * {
                 *  ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert('Please select image!');", true);
                 *  UpdatePanel1.Update();
                 * }*/

                if (_sellist.Count > 0)
                {
                    if (_objdata.GetdownloadimagesFromEditors(_sellist))
                    {
                        _sellist.Clear();
                        if (null != HttpContext.Current.Session["_dt"])
                        {
                            HttpContext.Current.Session["_dt"] = null;
                        }
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "close", "javascript:self.close()", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert('Please select image!');", true);
                    UpdatePanel1.Update();
                }

                //_imagesselect.Clear();
            }
            catch (Exception ex)
            {
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex);
                ErrorLog.SaveErrorLog(_strSiteID, "postmultipleimages", "GoWebshot", "GoWebshot", ex.Message, _networkid.ToString());
            }
        }