protected void btnmore_Click(object sender, EventArgs e) { try { Getimagedata _objdata = new Getimagedata(); //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert(" + _intstartval + ");", true); _intstartval = _intstartval + 75; prev.Visible = true; _objdata._intstartcnt = _intstartval; _objdata._strorientation = "horizontal"; var _data = _objdata.GeteventimageDatalist(); 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, "Indexpage", "btnmore_Click", "btnmore_Click", ex.Message, _networkid.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { try { Getimagedata _objdata = new Getimagedata(); //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert(" + _intstartval + ");", true); _objdata._intstartcnt = 1; _objdata._strorientation = "horizontal"; if (null != Request.QueryString["search"]) { _objdata._strserachterm = Request.QueryString["search"].ToString().Trim(); } else { _objdata._strserachterm = "nadal"; } var _data = _objdata.GetDefaultimageDatalist(); if (_data.Count > 0) { cdcatalog.DataSource = _data; cdcatalog.DataBind(); } else { cdcatalog.DataSource = null; } } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex); } /* Gettyclasses.Class1 n = new Class1(); * //List<string>li=n.getser(); * * DataTable _dt = new DataTable(); * var _objval = n.getser(); * cdcatalog.DataSource = _objval; * cdcatalog.DataBind(); * //cdcatalog.DataSource = _dt; * //cdcatalog.DataBind(); * //get all classes * string imageName = string.Empty; * string filename = string.Empty; * filename = DateTime.Now.ToString("yyyyMMMddhhmmss") + "_" + n._dnloadurlID + ".jpg"; * try * { * WebClient webClient = new WebClient(); * webClient.DownloadFile(n._dnloadurl, _imagepathdownload + filename); * webClient.Dispose(); * } * catch (Exception ex) * { * Response.Write(ex.Message.ToString()); * }*/ }
protected void Page_Load(object sender, EventArgs e) { if (null != Request.QueryString["NwtID"]) { _networkid = Function.GetnetworkID(Request.QueryString["NwtID"].ToString()); } if (null != Request.QueryString["eventid"]) { eventID = Convert.ToInt32(Request.QueryString["eventid"].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("&", "&"); } if (!Page.IsPostBack) { _lilist = new List <String>(); Getimagedata _objdata = new Getimagedata(); //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert(" + _intstartval + ");", true); _objdata._intstartcnt = 1; _objdata._strorientation = "horizontal"; var _data = _objdata.GetalleventimageDatalist(eventID); if (_data.Count > 0) { gettydata.DataSource = _data; gettydata.DataBind(); } else { gettydata.DataSource = null; } } }
static void Main(string[] args) { try { Getimagedata _obj = new Getimagedata(); Console.WriteLine("Scheduler started"); _obj._strnetworkID = commonfn._defaultNetwork; _obj.NewFN_AddGettyeventdetails(); Console.WriteLine("Scheduler end"); } catch (Exception ex) { Console.WriteLine("Scheduler Error" + ex.Message); CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex); ErrorLog.SaveErrorLog("0", "Main(string[] args)", "Program", "Program", ex.Message, "2"); } }
protected void btnprev_Click(object sender, EventArgs e) { try { Getimagedata _objdata = new Getimagedata(); 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_Newsletter(); 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()); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { try { Getimagedata _objdata = new Getimagedata(); //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert(" + _intstartval + ");", true); if (null != Request.QueryString["eventid"]) { _strevent = Request.QueryString["eventid"].ToString(); //_strevent = "533251361,514207643,484215707,516299701,499974343"; } _objdata._intstartcnt = 1; _objdata._strorientation = "horizontal"; _strarray = _strevent.Split(','); if (_strarray.Length > 0) { foreach (var i in _strarray) { _rtcnt = _objdata.Get_gettyevents_Responseimagecount(i.ToString()); if (_tlcnt == 0) { _strval += string.Format("{0}", _rtcnt); _tlcnt++; } else { _strval += "," + string.Format("{0}", _rtcnt); } _rtcnt = 0; //_tlcnt = _objdata.Get_gettyevents_Responseimagecount(i.ToString()); } } //Response.Write("_strval" + _strval); } catch (Exception ex) { Response.Write(ex); } } }
protected void btnsearch_Click(object sender, EventArgs e) { try { Getimagedata _objdata = new Getimagedata(); if (txtsearch.Text != "") { _objdata._strserachterm = txtsearch.Text.Trim(); } _intstartval = 1; prev.Visible = false; loadmore.Visible = true; //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert(" + _intstartval + ");", true); //Response.Write("_intstartval " + _intstartval+"</br>"); _objdata._intstartcnt = _intstartval; _objdata._strorientation = RDchkbox.SelectedValue; //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."; } _data = null; UpdatePanel1.Update(); } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex); } }
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("&", "&"); } if (null != Request.QueryString["news"]) { _strnews = Request.QueryString["news"].ToString(); } //get download seleted images Getimagedata _objdata = new Getimagedata(); _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); } if (_sellist.Count > 0) { if (_objdata.NewsletterFromEditors(_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()); } }
protected void btnalbum_Click(object sender, EventArgs e) { 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("&", "&"); } 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 Getimagedata _objdata = new Getimagedata(); _objdata._strsiteID = !string.IsNullOrEmpty(_strSiteID) ? _strSiteID : "1"; _objdata._strnetworkID = _networkid; _objdata._strrandomecookie = _strcookiename; _objdata._strnewsID = _intnewsID; _objdata._strnews = _strnews; //getdownload images. if (_lilist.Count > 0) { if (_objdata.Getdownloadmultipleimages(_lilist)) { //ScriptManager.RegisterStartupScript(this, this.GetType(), "close", "javascript:self.close()", true); ScriptManager.RegisterStartupScript(this, this.GetType(), "close", "javascript:window.opener.location.href = '" + commonfn._admin + _redirecturl + "';self.close();", true); } } //_imagesselect.Clear(); } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex); ErrorLog.SaveErrorLog(_strSiteID, "Indexpage", "btnalbum_Click", "btnalbum_Click", ex.Message, _networkid.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { try { if (null != Request.QueryString["isimgserver"]) { isimgserver = Request.QueryString["isimgserver"].ToString(); } if (null != Request.QueryString["sitefldname"]) { sitefldname = Request.QueryString["sitefldname"].ToString(); } if (null != Request.QueryString["isdefault"]) { isdefault = Request.QueryString["isdefault"].ToString(); } if (null != Request.QueryString["imgpath"]) { imgpath = Request.QueryString["imgpath"].ToString(); } if (null != Request.QueryString["imageid"]) { largeimageId = Request.QueryString["imageid"].ToString(); } if (imgpath.ToLower().Contains(".gif")) { imgExt = ".gif"; } if (imgpath.ToLower().Contains(".png")) { imgExt = ".png"; } if (imgpath.ToLower().Contains(".jpg")) { imgExt = ".jpg"; } if (imgpath.ToLower().Contains(".jpeg")) { imgExt = ".jpeg"; } if (imgExt.Trim().Length == 0) { imgExt = ".jpg"; } //imgExt = Path.GetExtension(imgpath); imagename = DateTime.Now.ToString("yyyyMMddhhmmss") + ".jpg"; largeimagename = "large_" + imagename; //new code for large image if (!string.IsNullOrEmpty(largeimageId)) { Getimagedata _objnew = new Getimagedata(); _strIds.Add(largeimageId); largeimagenameURL = _objnew.getlargeimage_download_DandD(_strIds); _strIds.Clear(); } //end code returnimagename = imagename; WebClient webClient = new WebClient(); Function.ValidateSiteFolder(sitefldname); //Function.CreateImagesFolderInBackend(sitefldname, monthyearfolder, dayfolder); // Image Server Code _imagepath = Server.MapPath(string.Format("{0}/", sitefldname)); //webClient.DownloadFile(imgpath, _imagepath + largeimagename); if (!string.IsNullOrEmpty(largeimageId)) { webClient.DownloadFile(largeimagenameURL, _imagepath + largeimagename); } else { webClient.DownloadFile(imgpath, _imagepath + imagename); } webClient.Dispose(); //large image download if (isimgserver.ToUpper() == "Y" && isdefault.ToUpper() == "Y") { if (!string.IsNullOrEmpty(largeimageId)) { //original large image // largereturnimagename = Function.SaveThumbnailCompress(largeimagename, _imagepath, "DD_", 1200, 100); //original news image largereturnimagename = Function.SaveoriginalImage(largeimagename, _imagepath, "", 600, 500); } //end code returnimagename = Function.SaveThumbnailCompress(imagename, _imagepath, "", 300, 225); //Function.SaveThumbnailCompress(imagename, _imagepath, "", 128, 85); returnimagepath = string.Format("{0}{1}/{2}", _imgserver, sitefldname, returnimagename); } //json = string.Format("jsonCallback({'result':{'imgname':'{0}','imgpath':'{1}'}})", returnimagename, returnimagepath); json = "jsonCallback({'result':{'imgname':'" + returnimagename + "','imgpath':'" + returnimagepath + "'}})"; largeimagenameURL = ""; } catch (Exception ex) { Response.Write(ex.Message); json = "jsonCallback({'result':{'imgname':'','imgpath':''}})"; } ltresult.Text = json; }
protected void rd_selectedbtn(object sender, EventArgs e) { 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("&", "&"); } if (null != Request.QueryString["news"]) { _strnews = Request.QueryString["news"].ToString(); } List <string> _imagesselect = new List <string>(); foreach (DataListItem _chk in gettydata.Items) { RadioButton _selchk = _chk.FindControl("Rdselect") as RadioButton; if (_selchk.Checked) { HtmlInputHidden _selectedID = _chk.FindControl("btnselectId") as HtmlInputHidden; _imagesselect.Add(_selectedID.Value); Getimagedata _objdata = new Getimagedata(); _objdata._strsiteID = !string.IsNullOrEmpty(_strSiteID) ? _strSiteID : "1"; _objdata._strnetworkID = _networkid; _objdata._strrandomecookie = _strcookiename; _objdata._strnewsID = _intnewsID; _objdata._strnews = _strnews; //getdownload images. if (_objdata.Getdownloadsingleimages(_imagesselect)) { ScriptManager.RegisterStartupScript(this, this.GetType(), "close", "javascript:self.close()", true); } break; } } } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex); ErrorLog.SaveErrorLog(_strSiteID, "singleimage", "rd_selectedbtn", "rd_selectedbtn", ex.Message, _networkid.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { 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("&", "&"); } if (!Page.IsPostBack) { _lilist = new List <String>(); if (_intstartval > 75) { prev.Visible = true; } loadmore.Visible = true; prev.Visible = false; Getimagedata _objdata = new Getimagedata(); //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert(" + _intstartval + ");", true); _objdata._intstartcnt = 1; _objdata._strorientation = "horizontal"; var _data = _objdata.GeteventimageDatalist(); if (_data.Count > 0) { gettydata.DataSource = _data; gettydata.DataBind(); } else { gettydata.DataSource = null; } } else { if (_intstartval > 75) { prev.Visible = true; } } } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex); } }
protected void Page_Load(object sender, EventArgs e) { if (null != Request.QueryString["NwtID"]) { _networkid = Function.GetnetworkID(Request.QueryString["NwtID"].ToString()); } if (null != Request.QueryString["eventid"]) { eventID = Convert.ToInt32(Request.QueryString["eventid"].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("&", "&"); } if (!Page.IsPostBack) { try { _lilist = new List <String>(); string _strItemhtml = @"'ImageTitle':'{0}' ,'Imageid' :'{1}','ImageUrl':'{2}','ImgUrlThumbformat':'{3}','Imagecaption':'{4}','ImgArtist':'{5}','ImgPreviewUrl':'{6}'"; string _strOuterhtml = @"jsonCallback({'menu': { 'header': '{0}',items': [{{1}}]}})"; string _title = string.Empty; string _gotitems = string.Empty; string _gotouter = string.Empty; int _cntget = 1; Getimagedata _objdata = new Getimagedata(); //ScriptManager.RegisterStartupScript(this, this.GetType(), "print", "alert(" + _intstartval + ");", true); _objdata._intstartcnt = 1; _objdata._strorientation = "horizontal"; var _data = _objdata.GetalleventimageDatalist(eventID); if (_data.Count > 0) { foreach (var _dr in _data) { _title = _dr.Title; if (_cntget == 1) { _gotitems += "{ " + string.Format(_strItemhtml, getData(_dr.Title), _dr.ImageId, _dr.UrlPreview, _dr.UrlThumb, getData(_dr.Caption), getData(_dr.Artist), _dr.UrlPreview) + " }"; _cntget++; } else { _gotitems += ", { " + string.Format(_strItemhtml, getData(_dr.Title), _dr.ImageId, _dr.UrlPreview, _dr.UrlThumb, getData(_dr.Caption), getData(_dr.Artist), _dr.UrlPreview) + " }"; } } //_strjson = "jsonCallback({'menu':{'imgname':'" + returnimagename + "','imgpath':'" + returnimagepath + "'}})"; //_gotouter = string.Format(_strOuterhtml, _title, _gotitems); _gotouter = @"jsonCallback({'menu': {'header': '" + _title + "','items': [" + _gotitems + "]}})"; ltresult.Text = _gotouter; } } catch (Exception ex) { CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "btnsearch_Click :", ex); ErrorLog.SaveErrorLog(_strSiteID, "Indexpage", "btnalbum_Click", "btnalbum_Click", ex.Message, _networkid.ToString()); } } }