public HttpResponseMessage Demo(string lang, string token) { var json = provincesrvice.GetAllProvinces(lang, token); response = toJson(json, lang); request = HttpContext.Current.Request; logservices.logservices(request, response, "dbo", "JSON", "path", lang, token, string.Empty, "test", string.Empty); return(response); }
public HttpResponseMessage Geo(string ip, string token) { var country = geolocationservices.GetIPCountry(ip, token); response = toJson(country); request = HttpContext.Current.Request; logservices.logservices(request, response, "geo", "json", "path", string.Empty, token, string.Empty, "geo", ip); return(response); }
public HttpResponseMessage GetAllTopCategories(string lang, string token) { var json = topCategorysercice.GetAllTopCategories(lang, token).ToList(); response = toJson(json, lang); request = HttpContext.Current.Request; logservices.logservices(request, response, "dbo", "json", "path", lang, token, "all", "TopCategory", string.Empty); return(response); }
public ActionResult Index() { HttpResponseMessage response = new HttpResponseMessage(); HttpRequest request = System.Web.HttpContext.Current.Request; logservices.logservices(request, response, "dbo", "page", "display", request.UserHostName, string.Empty, request.UserHostAddress, "doc", "sandbox"); return(View()); }
public HttpResponseMessage GetAllProvince(string lang, string token) { //var json = provincesrvice.GetAllProvinces(lang).ToList(); var json = provincesrvice.GetAllProvinces(lang, token); response = toJson(json, lang); request = HttpContext.Current.Request; logservices.logservices(request, response, "dbo", "json", "path", lang, token, "all", "province", string.Empty); return(response); }
public ActionResult Index() { ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider(); HttpResponseMessage response = new HttpResponseMessage(); HttpRequest request = System.Web.HttpContext.Current.Request; logservices.logservices(request, response, "dbo", "page", "display", request.UserHostName, string.Empty, request.UserHostAddress, "help", "quick start"); return(View(Configuration.Services.GetApiExplorer().ApiDescriptions)); }
public HttpResponseMessage Send([FromBody] email _email) { string host = Properties.Settings.Default.host; int port = Properties.Settings.Default.port; bool ssl = Properties.Settings.Default.ssl; string loginName = Properties.Settings.Default.loginname; string pwd = Properties.Settings.Default.pwd; string sendfrom = Properties.Settings.Default.sendfrom; string displayName = Properties.Settings.Default.displayname; string subject = _email.lang == "fr" ? Properties.Settings.Default.subject_fr : Properties.Settings.Default.subject; //string subject = Properties.Settings.Default.subject; bool result = false; //sendfromInternal(host, port, ssl, loginname, pwd, sendfrom, displayname, receiver, subject, body) try { result = es.sendfromInternal(host, port, ssl, loginName, pwd, sendfrom, displayName, _email.receiver, subject, _email.body); } catch (Exception e) { e.Message.ToString(); } if (result) { var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent("\"status\":\"OK\"", Encoding.UTF8); response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); logservices.logservices(request, response, string.Empty, string.Empty, "send", _email.lang, string.Empty, subject, "email", _email.receiver); return(response); } else { var response = this.Request.CreateResponse(HttpStatusCode.NotFound); response.Content = new StringContent("\"status\":\"Failed\"", Encoding.UTF8); response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); logservices.logservices(request, response, string.Empty, string.Empty, "send", _email.lang, string.Empty, subject, "email", _email.receiver); return(response); } }
public HttpResponseMessage answer([FromBody] ChatSurvey _survey) { bool result = false; int _chatid = 0; string _language = ""; string _surveyAnswer_Device = ""; string _token = ""; List <answer> _answer = _survey.chatsurvey; int _surveyQuestion_ID = 0; string _surveyAnswer = ""; try { _chatid = _survey.chatID; _language = _survey.language; _surveyAnswer_Device = _survey.surveyAnswer_Device; _token = _survey.token; foreach (answer _a in _answer) { _surveyQuestion_ID = _a.surveyQuestion_ID; _surveyAnswer = _a.surveyAnswer; ss.insertSurvey(_token, _surveyQuestion_ID, _chatid, _surveyAnswer, _language, _surveyAnswer_Device); result = true; } } catch (Exception e) { e.Message.ToString(); } if (result) { var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent("\"status\":\"OK\"", Encoding.UTF8); response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); //( request, response, dbschema, format, para, lang, token, string cscontent, csendpoint, keywords) logservices.logservices(request, response, "survey", "json", "path", _language, _token, "answer", "survey", _chatid + ""); return(response); } else { var response = this.Request.CreateResponse(HttpStatusCode.NotFound); response.Content = new StringContent("\"status\":\"Failed\"", Encoding.UTF8); response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); logservices.logservices(request, response, "survey", "json", "path", _language, _token, "answer", "survey", _chatid + ""); return(response); } }
public HttpResponseMessage GetAllGoogleCitis() { HttpContext.Current.Response.Cache.VaryByHeaders["accept-enconding"] = true; var resoult = locationservice.GetAllGoogleCitis(); response = toJson(resoult); request = HttpContext.Current.Request; logservices.logservices(request, response, "dbo", "json", "path", string.Empty, string.Empty, "all", "google", "city"); return(toJson(response)); }
public HttpResponseMessage GetAllCitis(string token) { HttpContext.Current.Response.Cache.VaryByHeaders["accept-enconding"] = true; var r = citysercice.GetAllCitis(token); response = toJson(r); request = HttpContext.Current.Request; logservices.logservices(request, response, "dbo", "json", "path", string.Empty, token, "all", "city", string.Empty); return(response); }