public ActionResult Update(ProjectRatesModel cm)
        {
            try
            {
                List <ProjectRatesModel> ProjectRatesInfo = new List <ProjectRatesModel>();
                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(Baseurl);
                    //HTTP GET
                    var responseTask = client.PutAsJsonAsync("api/ProjectRates/update", cm);
                    responseTask.Wait();

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

                        //Deserializing the response recieved from web api and storing into the Sub SORType  list
                        ProjectRatesInfo = JsonConvert.DeserializeObject <List <ProjectRatesModel> >(ProjectRatesResponse);
                    }
                }

                return(RedirectToAction("Index", "Project"));
            }
            catch (Exception ex)
            {
                ExceptionLogHandler.LogData(ex);

                throw ex;
            }
        }
        public async Task <ActionResult> Insert(ProjectRatesModel cm)
        {
            try
            {
                ProjectRatesModel ProjectRatesInfo = new ProjectRatesModel();
                using (var client = new HttpClient())
                {
                    //Passing service base url
                    client.BaseAddress = new Uri(Baseurl);

                    client.DefaultRequestHeaders.Clear();

                    var obj = JsonConvert.SerializeObject(cm);

                    // 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/ProjectRates/insert", new StringContent(obj, 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 ProjectRatesResponse = Res.Content.ReadAsStringAsync().Result;

                        //Deserializing the response recieved from web api and storing into the Company list
                        ProjectRatesInfo = JsonConvert.DeserializeObject <ProjectRatesModel>(ProjectRatesResponse);
                    }

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

                throw ex;
            }
        }