public ActionResult Login(string email, string password)
        {
            var request = new RestRequest("api/ApiKey?email=" + email + "&password="******"ApiKey"] = x.ApiKey;
                Session["UserId"] = x.UserId;

                request = new RestRequest("api/[email protected]&password=123456", Method.GET);
                queryResult = client.Execute(request);
                var x2 = deserial.Deserialize<GetApikeyDTO>(queryResult);

                request = new RestRequest("api/Users/" + x.UserId, Method.GET);

                request.AddHeader("xcmps383authenticationkey", x2.ApiKey);
                request.AddHeader("xcmps383authenticationid", x2.UserId.ToString());
                queryResult = client.Execute(request);

                GetUserDTO user = new GetUserDTO();

                statusCodeCheck(queryResult);

                if (queryResult.StatusCode == HttpStatusCode.OK)
                {
                    user = deserial.Deserialize<GetUserDTO>(queryResult);
                    if (user.Role.ToString().Equals("User"))
                    {
                        Session["Role"] = null;
                    }
                    else
                    {
                        Session["Role"] = user.Role.ToString();
                    }

                    Session["Name"] = user.FirstName;
                }
                else
                {
                    Session["Role"] = "User";
                    Session["Name"] = "Customer";
                }

                return RedirectToAction("Index", "Home");
            }
            else
            {
                return Content("An error occured with Log In credential!");
            }
        }
        // GET: User/Details/5
        public JsonResult Details(int id)
        {
            var request = new RestRequest("api/Users/" + id, Method.GET);
            var apiKey = Session["ApiKey"];
            var UserId = Session["UserId"];
            request.AddHeader("xcmps383authenticationkey", apiKey.ToString());
            request.AddHeader("xcmps383authenticationid", UserId.ToString());
            var queryResult = client.Execute(request);

            GetUserDTO x = new GetUserDTO();

            statusCodeCheck(queryResult);

            if (queryResult.StatusCode == HttpStatusCode.OK)
            {
                RestSharp.Deserializers.JsonDeserializer deserial = new JsonDeserializer();
                x = deserial.Deserialize<GetUserDTO>(queryResult);
            }

            return Json(new { Result = "Ok", Record = x });
        }
        // GET: User/Edit/5
        public ActionResult Edit(int id)
        {
            if (!Session["Role"].Equals("Admin"))
            {
                return RedirectToAction("Index", "Home");
            }
            var request = new RestRequest("api/Users/" + id, Method.GET);
            var apiKey = Session["ApiKey"];
            var UserId = Session["UserId"];
            request.AddHeader("xcmps383authenticationkey", apiKey.ToString());
            request.AddHeader("xcmps383authenticationid", UserId.ToString());
            var queryResult = client.Execute(request);

            GetUserDTO x = new GetUserDTO();

            statusCodeCheck(queryResult);

            if (queryResult.StatusCode == HttpStatusCode.OK)
            {
                RestSharp.Deserializers.JsonDeserializer deserial = new JsonDeserializer();
                x = deserial.Deserialize<GetUserDTO>(queryResult);
            }
            else if (queryResult.StatusCode == HttpStatusCode.Forbidden)
            {
                return RedirectToAction("Login", "User");
            }
            return View(x);
        }