Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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());
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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));
        }
Esempio n. 7
0
        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);
            }
        }
Esempio n. 8
0
        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);
            }
        }
Esempio n. 9
0
        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));
        }
Esempio n. 10
0
        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);
        }