using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.Services; /// /// Summary description for srvPhotoGallery /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class srvPhotoGallery : System.Web.Services.WebService { public srvPhotoGallery() { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public List LoadPhotos(string url1, string url2, string url3) { string host = HttpContext.Current.Request.Url.Host.Replace("www.", ""); string _p = ""; string _a = ""; clsPhotoGallery obj = new clsPhotoGallery(); clsSecurity objS = new clsSecurity(); List _li = new List(); LastestHappeningClass _m = new LastestHappeningClass(); string _iddcy = ""; try { _iddcy = objS.DecryptText(url2 + "==", url1); } catch { } int _id1 = 0; try { _id1 = Int32.Parse(_iddcy); } catch { } if (_id1 == 0)/// get All gallary here { DataTable dt = obj.LastestPhoto("Photos"); int _ii = 0, _i1 = 0; // _a = "
"; foreach (DataRow dr in dt.Rows) { _ii++; string _id = dr["id"].ToString(); string _heading = dr["heading"].ToString(); string _lines = dr["lines"].ToString().Replace("

", "").Replace("

", ""); string _url = dr["url"].ToString(); string _filelocation = dr["filelocation"].ToString(); string _publishtype = dr["publishtype"].ToString(); string _enddate = dr["enddate"].ToString(); string _uploadby = dr["uploadby"].ToString(); string _uploaddate = dr["uploaddate"].ToString(); string _status = dr["status"].ToString(); string _gallery = dr["gallery"].ToString(); string _award = dr["award"].ToString(); string _eventdate = dr["StartDate"].ToString(); var suid1 = Guid.NewGuid().ToString().Replace("-", ""); var iddd = HttpUtility.HtmlEncode(objS.EncryptText(_id, suid1)); var suid = suid1;// iddd.Split('|')[1]; var idd = iddd;// iddd.Split('|')[0]; var url = "https://n." + host + "/img_Notice/" + _filelocation; var newline = _heading + ".."; if (_heading.Length > 25) { newline = _heading.Substring(0, 25) + "..."; } _a += "
" + "" + "
"; /* _a = _a + "
" + "
" + " " + " " + "
" + " " + newline + " " + " " + "
"; if (_ii == 3) { _ii = 0; _a = _a + "
"; }*/ } /* if (_ii != 0) { _a = _a + "
"; }*/ _p = "A"; } else// get photo by id /// { _p = "B"; DataTable dt = obj.LastestPhotoById(_id1); int _ii = 0, _i1 = 0; string heading = dt.Rows[0]["Heading"].ToString(); string url = dt.Rows[0]["url"].ToString(); string CoverImage = "https://n." + host + "/img_notice/" + dt.Rows[0]["CoverImage"].ToString().Replace("img_notice/", "/"); string PostId = dt.Rows[0]["PostId"].ToString(); string _aaa = "
"; // string _title = "

" + heading + "

"; string _a0 ="
" + " " + "SFS-Guwahati "+ heading + " " + " " + "
"; foreach (DataRow dr in dt.Rows) { string PhotoId = dr["PhotoId"].ToString(); var suid1 = Guid.NewGuid().ToString().Replace("-", ""); var iddd = HttpUtility.HtmlEncode(objS.EncryptText(PhotoId, suid1)); //var suid = suid1; //var idd = iddd; var GallLocation = "https://n." + host + "/pgallary/" + dr["ImagePath"].ToString().Replace("pgallary/", "/"); _a0 = _a0 + "
" + " " + "SFS-Guwahati "+ heading + " " + " " + "
"; } // Video here /*int videovalid = 0; if (url=="#" || url=="") { videovalid = 0; } else { videovalid = 1; } if (videovalid==1) { _a0 = _a0 + "
" + "
" + "
" + "
" + "
" + "
" + " " + "
" + "
" + "

" + "

" + "
" + "
" + "
" + "
" + "
" + "
"; } */ _a = _aaa + _a0 + "
"; } _m._data = _a; _m._data1 = _p; _li.Add(_m); return _li; } }