// GET: api/Locations //public IEnumerable<string> Get() //{ // return new string[] { "value1", "value2" }; //} //// GET: api/Locations/5 public locations<location> Get(string userEmailaddress="_all") { clsMainProgram cls = new clsMainProgram(); locations<location> Locations = cls.getLocations(); return Locations; }
public string HtmlString() { string _retval = ""; clsMainProgram cls = new clsMainProgram(); locationsWithThumbNails<locationWithThumbNails> Locations = cls.getLocationsWithThumbNails(this.UserId); char kwot = (char)34; char crlf = (char)13; _retval += "<table>"; foreach (locationWithThumbNails lcn in Locations) { if (lcn.isFavourite) { _retval += "<tr><td><p class=" + kwot + "locationsp" + kwot + " onclick=" + kwot + "imgSelectLocation('" + lcn.tKey + "')" + kwot + ">" + lcn.tag + "</p>"; _retval += "<img src=" + kwot + "images/favRem.png" + kwot + " class=" + kwot + "fav" + kwot + " onclick=" + kwot + "addUserLocationToFavourite('" + lcn.tKey + "')" + kwot + " id=" + kwot+ "u" + lcn.tKey + kwot + " />"; _retval += "</td><td><p class=" + kwot + "locationsp" + kwot + " onclick=" + kwot + "imgSelectLocation('" + lcn.tKey + "')" + kwot + ">" + lcn.counter + "</td><td>"; int i = 0; foreach (image img in lcn.locationimages) { _retval += "<td><img onclick=" + kwot + "imgSelectLocation('" + lcn.tKey + "')" + kwot + " class=" + kwot + "locationsimg" + kwot + " onmousehover='cursor:pointer' src=" + kwot + "data:image/jpeg;base64," + img.webImageThumbnailBase64Encoded + "" + kwot + " /></td>" + crlf; i++; if (i > 13) { break; } } // _retval += "</tr></table></td></tr>"; _retval += "</tr>";//></td></tr>"; } } _retval += "</table>"; return _retval; }
// GET: api/Login/5 public user Get(string emailaddress,string password) { clsMainProgram cls = new clsMainProgram(); user usr = cls.login(emailaddress, password); return usr; }
// GET: api/MainImageListHTML/5 public string Get(String Location) { string _retval = ""; clsMainProgram cls = new clsMainProgram(); images<image> imagelist = new images<image>(); imagelist = cls.SearchImagesPerLocation(Location); int i = 0; string clickevent = ""; char kwot = (char)34; char crlf = (char)13; int strLen = 0; int maxTextLenth = 31; _retval += "<table width=" + kwot + "100%" + kwot + " style=" + kwot + "width:100%" + kwot + ">"; foreach (image img in imagelist) { i++; if (i == 1) { clickevent = kwot + "getImgData('" + img.imgGUID + "');" + kwot; strLen = img.title.Length; if (strLen > maxTextLenth) { strLen = maxTextLenth; } _retval += "<tr><td><img class=" + kwot + "imagelist" + kwot + " onmouseover='cursor:pointer' onclick=" + clickevent + " src=" + kwot + "data:image/jpeg;base64," + img.webImageThumbnail240x250Base64Encoded + "" + kwot + " /> <p class=" + kwot + "imagename" + kwot + ">" + img.title.Replace("`", "'").Substring(0,strLen) + "</p></td>" + crlf; } if (i == 2) { clickevent = kwot + "getImgData('" + img.imgGUID + "');" + kwot; strLen = img.title.Length; if (strLen > maxTextLenth) { strLen = maxTextLenth; } _retval += "<td><img class=" + kwot + "imagelist" + kwot + " onmouseover='cursor:pointer' onclick=" + clickevent + " src=" + kwot + "data:image/jpeg;base64," + img.webImageThumbnail240x250Base64Encoded + "" + kwot + " /> <p class=" + kwot + "imagename" + kwot + ">" + img.title.Replace("`", "'").Substring(0, strLen) + "</p></td>" + crlf; } if (i == 3) { clickevent = kwot + "getImgData('" + img.imgGUID + "');" + kwot; strLen = img.title.Length; if (strLen > maxTextLenth) { strLen = maxTextLenth; } _retval += "<td><img class=" + kwot + "imagelist" + kwot + " onmouseover='cursor:pointer' onclick=" + clickevent + " src=" + kwot + "data:image/jpeg;base64," + img.webImageThumbnail240x250Base64Encoded + "" + kwot + " /> <p class=" + kwot + "imagename" + kwot + ">" + img.title.Replace("`", "'").Substring(0, strLen) + "</p></td>" + crlf; } if (i == 4) { clickevent = kwot + "getImgData('" + img.imgGUID + "');" + kwot; strLen = img.title.Length; if (strLen > maxTextLenth) { strLen = maxTextLenth; } _retval += "<td><img class=" + kwot + "imagelist" + kwot + " onmouseover='cursor:pointer' onclick=" + clickevent + " src=" + kwot + "data:image/jpeg;base64," + img.webImageThumbnail240x250Base64Encoded + "" + kwot + " /> <p class=" + kwot + "imagename" + kwot + ">" + img.title.Replace("`", "'").Substring(0, strLen) + "</p></td></tr>" + crlf; i = 0; } //if (i == 1) //{ // clickevent = kwot + "getImgData('" + img.imgGUID + "');" + kwot; // _retval += "<td><table><tr><td><img class=" + kwot + "imagelist" + kwot + " onmouseover='cursor:pointer' onclick=" + clickevent + " src=" + kwot + "data:image/jpeg;base64," + img.webImageThumbnail250x250Base64Encoded + "" + kwot + " /></td></tr><tr><td> <p class=" + kwot + "imagename" + kwot + ">" + img.title.Replace("`", "'") + "</p></td></tr></table></td></tr>" + crlf; // i = 0; //} //else //{ // clickevent = kwot + "getImgData('" + img.imgGUID + "');" + kwot; // _retval += "<tr><td><table><tr><td><img class=" + kwot + "imagelist" + kwot + " onmouseover='cursor:pointer' onclick=" + clickevent + " src=" + kwot + "data:image/jpeg;base64," + img.webImageThumbnail250x250Base64Encoded + "" + kwot + " /></td></tr><tr><td> <p class=" + kwot + "imagename" + kwot + ">" + img.title.Replace("`", "'") + "</p></td></tr></table></td>" + crlf; // i++; //} } _retval += "</table>"; return _retval; }
// GET: api/UserSessions public string Get(String sessionid) { clsMainProgram cls = new clsMainProgram(); return cls.ReadDataSet("").Tables[0].Rows[0].Field<string>("userid"); }