public ActionResult Update(SORTypeModel SORType)
        {
            try
            {
                List <SORTypeModel> SORTypeInfo = new List <SORTypeModel>();
                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(Baseurl);
                    //HTTP GET
                    var responseTask = client.PutAsJsonAsync("api/sortype/update", SORType);
                    responseTask.Wait();

                    var result = responseTask.Result;
                    if (result.IsSuccessStatusCode)
                    {
                        //Storing the response details recieved from web api
                        var SORTypeResponse = result.Content.ReadAsStringAsync().Result;

                        //Deserializing the response recieved from web api and storing into the Company list
                        SORTypeInfo = JsonConvert.DeserializeObject <List <SORTypeModel> >(SORTypeResponse);
                    }
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ExceptionLogHandler.LogData(ex);
                throw ex;
            }
        }
        public async Task <ActionResult> Insert(SORTypeModel SORType)
        {
            try
            {
                SORTypeModel SORTypeInfo = new SORTypeModel();
                using (var client = new HttpClient())
                {
                    //Passing service base url
                    client.BaseAddress = new Uri(Baseurl);

                    client.DefaultRequestHeaders.Clear();

                    var stype = JsonConvert.SerializeObject(SORType);

                    // Define request data format
                    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                    //Sending request to find web api REST service resource GetAllComapnies using HttpClient
                    HttpResponseMessage Res = await client.PostAsync("api/sortype/insert", new StringContent(stype, Encoding.UTF8, "application/json"));

                    //Checking the response is successful or not which is sent using HttpClient
                    if (Res.IsSuccessStatusCode)
                    {
                        //Storing the response details recieved from web api
                        var SORTypeResponse = Res.Content.ReadAsStringAsync().Result;

                        //Deserializing the response recieved from web api and storing into the Company list
                        SORTypeInfo = JsonConvert.DeserializeObject <SORTypeModel>(SORTypeResponse);
                    }

                    //returning the company list to view
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                ExceptionLogHandler.LogData(ex);
                throw ex;
            }
        }