public string AddSeatindb(AddSeats obj) { using (HttpClient client = new HttpClient()) { string stringData = JsonConvert.SerializeObject(obj); var contentData = new StringContent(stringData, System.Text.Encoding.UTF8, "application/json"); HttpResponseMessage response = client.PostAsync(webapiurl + "/Admin/Updateseat", contentData).Result; var list = response.Content.ReadAsStringAsync().Result; return(list); } }
// Commands created from events from the conference BC public void Handle(AddSeats command) { var availability = repository.Find(command.ConferenceId); if (availability == null) { availability = new SeatsAvailability(command.ConferenceId); } availability.AddSeats(command.SeatType, command.Quantity); repository.Save(availability, command.Id.ToString()); }
public ActionResult AddSeats(AddSeats obj) { var res = AddSeatMethod(obj); if (res.Contains("Successfully")) { ViewBag.Message = res; ViewBag.Screen = DropDown.ScreenList(); ViewBag.Class = DropDown.Classid(); } return(View("AdminUserPage")); }
public HttpResponseMessage Updateseat(AddSeats obj) { bool status = false; status = objReg.updateSeat(obj); if (status == true) { var showmessage = "Updated Successfully."; return(Request.CreateResponse(HttpStatusCode.OK, showmessage)); } else { var showmessage = "Fail Please try again."; return(Request.CreateResponse(HttpStatusCode.BadRequest, showmessage)); } }
public string AddSeatMethod(AddSeats obj) { return(HttpCalls.Httpclientcall(obj, "Admin", "Updateseat")); }