예제 #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"));
        }
예제 #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));
        }
예제 #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"));
        }