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