Exemplo n.º 1
0
        public ActionResult insertIntoDb(appointment appointment)
        {
            HttpResponseMessage responseMessage = new HttpResponseMessage();
            StringContent       content         = new StringContent(JsonConvert.SerializeObject(appointment));

            var apiCallService = new WebApiCallService <appointment>();
            var inserted       = apiCallService.ApiPostRequest("Appointments/SetUpAppointment", content, responseMessage).Result;

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public ActionResult GetAllAppointment()
        {
            HttpResponseMessage responseMessage = new HttpResponseMessage();
            StringContent       content         = new StringContent(JsonConvert.SerializeObject(""));

            var apiCallService = new WebApiCallService <List <appointment> >();
            var appointments   = apiCallService.ApiGetRequest("Appointments/GetAllAppointments", responseMessage).Result;

            return(View(appointments));
        }
Exemplo n.º 3
0
        public ActionResult CreateNewUser(User user)
        {
            user.userId       = Guid.NewGuid().GetHashCode();
            user.token        = Guid.NewGuid().ToString();
            user.token_expire = DateTime.Now;

            HttpResponseMessage responseMessage = new HttpResponseMessage();
            StringContent       content         = new StringContent(JsonConvert.SerializeObject(user));

            var apiCallService = new WebApiCallService <appointment>();
            var NewUser        = apiCallService.ApiPostRequest("Authentication/CreateNewUser", content, responseMessage).Result;

            return(RedirectToAction("Index"));
        }