示例#1
0
        public async Task <string> InsertActSysWarranties()
        {
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());

                var    encodedURL   = Request.GetEncodedUrl();
                var    pathAndQuery = Request.GetEncodedPathAndQuery();
                var    displayURL   = Request.GetDisplayUrl();
                string path         = Request.Path.ToString();
                string queryStr     = Request.QueryString.ToString();

                //http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=pkInsertAct_syswarranties&name=dennee&vehicle_group_id=8&pk=GsZVzEYe50uGgNM
                //_hmacManager.test();
                //var response = await HttpClientRequestFactory.Get("http://localhost:58443/api/values/23", headers);
                var response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php" + queryStr, headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model state is not valid");
            }
        }
        public async Task <string> SysBranchDealerManOfficeTreeList()
        {
            // aşağıdaki blok self-signed cert kısmında ssl bağlantı sorunu çıkartıyor.
            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            string queryStr = Request.QueryString.ToString();
            var    url      = "http://proxy.mansis.co.za:18443/SlimProxyBoot.php";

            if (queryStr == "")
            {
                url = url + "?url=pkFillDepartmentsTree_syssisdepartments&pk=GsZVzEYe50uGgNM&language_code=en";
            }
            else
            {
                url = url + queryStr + "&url=pkFillDepartmentsTree_syssisdepartments&pk=GsZVzEYe50uGgNM&language_code=en";
            }
            var response = await HttpClientRequestFactory.Get(url, headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
示例#3
0
        public async Task <string> IndexPostObjectParameter([FromBody] AddressInfo addressInfo)
        {
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());

                string test       = _queryCreater.GetQueryStringFromObject(addressInfo);
                var    encodedURL = Request.GetEncodedUrl();
                Request.GetEncodedPathAndQuery();

                //_hmacManager.test();
                //var response = await HttpClientRequestFactory.Get("http://localhost:58443/api/values/23", headers);
                var response = await HttpClientRequestFactory.Get("https://manservices.man.com.tr/SlimProxyBoot.php?url=fillServicesDdlist_infoAfterSales&pk=zC3zCuVV2cttXP6", headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model satate is not valid");
            }
        }
        public async Task <string> SysYesNo()
        {
            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            var url      = "http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=fillYesNoTypes_sysSpecificDefinitions&language_code=en&pk=GsZVzEYe50uGgNM";
            var response = await HttpClientRequestFactory.Get(url, headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
示例#5
0
        public async Task <string> SysVehicleTypesForBuybackInDeal()
        {
            //Vehicle  type for deal buybacks
            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            var response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=pkVehiclesEndgroupsCostDdList_sysvehiclesendgroups&language_code=en&pk=GsZVzEYe50uGgNM", headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
示例#6
0
        public async Task <string> DeleteTruckstogo([FromBody] DeletePostModel deleteModel)
        {
            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            string queryStr = _queryCreater.GetQueryStringFromObject(deleteModel);
            var    response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?" + queryStr, headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
        public async Task <string> SysBbTbContractTypes()
        {
            // buyback tradeback contract type
            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            var response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=pkBbContractTypesDdList_sysbbcontracttypes&language_code=en&pk=GsZVzEYe50uGgNM", headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
        public async Task <string> SysSalesman()
        {
            // aşağıdaki blok self-signed cert kısmında ssl bağlantı sorunu çıkartıyor.
            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            var url      = "http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=pkSalesmanDdList_infoUsers&language_code=en&pk=GsZVzEYe50uGgNM";
            var response = await HttpClientRequestFactory.Get(url, headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
示例#9
0
        public async Task <string> SysVehicleGroupTypes([FromBody] VehicleGroupsPostModel postModel)
        {
            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            string queryStr = _queryCreater.GetQueryStringFromObject(postModel);
            //url=pkVehicleGroupTypesDdList_sysvehiclegrouptypes&vehicle_groups_id=1&language_code=en&pk=GsZVzEYe50uGgNM
            var response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?" + queryStr, headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
        public async Task <string> SysTrainee()
        {
            // aşağıdaki blok self-signed cert kısmında ssl bağlantı sorunu çıkartıyor.

            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            //_hmacManager.test();
            //var response = await HttpClientRequestFactory.Get("http://localhost:58443/api/values/23", headers);
            var response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=pkFillEducationsSalesmanGridx_syseducationssalesman&page=&rows=&sort=&order=&language_code=en&pk=GsZVzEYe50uGgNM", headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
        }
示例#11
0
        public async Task <string> IndexPostPrimitiveTypeParameter([FromBody] string addressInfo)
        {
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
                var response = await HttpClientRequestFactory.Get("https://manservices.man.com.tr/SlimProxyBoot.php?url=fillServicesDdlist_infoAfterSales&pk=zC3zCuVV2cttXP6", headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model satate is not valid");
            }
        }
示例#12
0
        public async Task <string> TruckstogoGrid([FromBody] DefaultPostModelGridList gridModel)
        {
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
                string queryStr = _queryCreater.GetQueryStringFromObject(gridModel);
                var    response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?" + queryStr, headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model state is not valid");
            }
        }
示例#13
0
        public async Task <string> AddDealProxyService([FromBody] DealModel dealModel)
        {
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
                string queryStr = _queryCreater.GetQueryStringFromObject(dealModel);
                var    response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?" + queryStr, headers);

                //var response = await HttpClientRequestFactory.Get("http://91.93.128.181:8080/mansis_services/mansissa_Slim_Proxy_v1/SlimProxyBoot.php?"+ queryStr, headers);
                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model state is not valid");
            }
        }
        public async Task <string> SysCityFilter([FromHeader] string country_id, [FromHeader] string region_id)
        {
            // aşağıdaki blok self-signed cert kısmında ssl bağlantı sorunu çıkartıyor.
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
                var url = "http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=pkCityDdList_syscity&language_code=en&pk=GsZVzEYe50uGgNM&country_id=" + country_id + "&region_id=" + region_id;
                //&country_id=107&region_id=1
                var response = await HttpClientRequestFactory.Get(url, headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model state is not valid");
            }
        }
示例#15
0
        public async Task <string> SysWarrantyNameFilter([FromHeader] string vehicle_group_id)
        {
            // aşağıdaki blok self-signed cert kısmında ssl bağlantı sorunu çıkartıyor.
            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
                var url = "http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=pkWarrantiesParentsDdList_syswarranties&language_code=en&pk=GsZVzEYe50uGgNM&vehicle_group_id=" + vehicle_group_id;
                //_hmacManager.test();
                //var response = await HttpClientRequestFactory.Get("http://localhost:58443/api/values/23", headers);
                var response = await HttpClientRequestFactory.Get(url, headers);//("http://91.93.128.181:8080/mansis_services/mansissa_Slim_Proxy_v1/SlimProxyBoot.php?url=pkWarrantiesParentsDdList_syswarranties&language_code=en&pk=GsZVzEYe50uGgNM&vehicle_group_id=", headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model state is not valid");
            }
        }
示例#16
0
        public async Task <string> IndexPostObjectParameter([FromBody] AddressInfo addressInfo)
        {
            // aşağıdaki blok self-signed cert kısmında ssl bağlantı sorunu çıkartıyor.

            if (ModelState.IsValid)
            {
                var headers        = new Dictionary <string, string>();
                var tokenGenerated = HttpContext.Session.GetHmacToken();
                headers.Add("X-Hmac", tokenGenerated);
                headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
                //_hmacManager.test();
                //var response = await HttpClientRequestFactory.Get("http://localhost:58443/api/values/23", headers);
                var response = await HttpClientRequestFactory.Get("http://proxy.mansis.co.za:18443/SlimProxyBoot.php?url=fillServicesDdlist_infoAfterSales&pk=zC3zCuVV2cttXP6", headers);

                var data = response.Content.ReadAsStringAsync().Result;
                return(data.ToString());
            }
            else
            {
                throw new Exception("Model satate is not valid");
            }
        }
示例#17
0
        public async Task <string> Index()
        {
            // aşağıdaki blok self-signed cert kısmında ssl bağlantı sorunu çıkartıyor.


            var headers        = new Dictionary <string, string>();
            var tokenGenerated = HttpContext.Session.GetHmacToken();

            headers.Add("X-Hmac", tokenGenerated);
            headers.Add("X-PublicKey", HttpContext.Session.GetUserPublicKey());
            //_hmacManager.test();
            //var response = await HttpClientRequestFactory.Get("http://localhost:58443/api/values/23", headers);
            var response = await HttpClientRequestFactory.Get("https://manservices.man.com.tr/SlimProxyBoot.php?url=fillServicesDdlist_infoAfterSales&pk=zC3zCuVV2cttXP6", headers);

            var data = response.Content.ReadAsStringAsync().Result;

            return(data.ToString());
            //return "test";

            // aşağıdaki blok self-signed cert çağırıken kullanılabiliyor

            /*
             * using (var httpClientHandler = new HttpClientHandler())
             * {
             *  httpClientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; };
             *  using (var client = new HttpClient(httpClientHandler))
             *  {
             *      // Make your request...
             *      client.BaseAddress = new Uri("https://proxy.codebase_v2.com/SlimProxyBoot.php?url=fillServicesDdlist_infoAfterSales&pk=ktibmGO59ym7sIc");
             *      client.DefaultRequestHeaders.Accept.Clear();
             *      client.DefaultRequestHeaders.Accept.Add(
             *          new MediaTypeWithQualityHeaderValue("application/json"));
             *      HttpResponseMessage response = await client.GetAsync("https://proxy.codebase_v2.com/SlimProxyBoot.php?url=fillServicesDdlist_infoAfterSales&pk=ktibmGO59ym7sIc");
             *      var data = response.Content.ReadAsStringAsync().Result;
             *      return data.ToString();
             *  }
             * }*/
        }