public ActionResult AddGet(int memberBookingSpaceID) { SetSessionVariables(); QuantityAddOnUsage quantityAddOnUsage = new QuantityAddOnUsage() { MemberBookingSpaceID = memberBookingSpaceID }; return(View(quantityAddOnUsage)); }
public ActionResult Add(QuantityAddOnUsage quantityAddOnUsage) { SetSessionVariables(); bool isError = true; if (ModelState.IsValid) { isError = false; } using (HttpClient client = new HttpClient()) { UserLogin userLogin = GetSessionObject(); if (userLogin != null) { isError = false; } if (isError == false) { client.BaseAddress = new Uri(Common.Instance.ApiQuantityAddOnUsageControllerName); //HTTP POST QuantityAddOnUsage var postTask = client.PostAsJsonAsync <QuantityAddOnUsage>(Common.Instance.ApiQuantityAddOnUsageAdd, quantityAddOnUsage); postTask.Wait(); var result = postTask.Result; if (result.IsSuccessStatusCode) { var readTask = result.Content.ReadAsAsync <bool>(); readTask.Wait(); } else { isError = true; } } } if (isError) { return(View("Error")); } return(RedirectToAction("List", new { memberBookingSpaceID = quantityAddOnUsage.MemberBookingSpaceID })); }
public QuantityAddOnUsageUpdateViewModel() { QuantityAddOnUsage = new QuantityAddOnUsage(); }
public QuantityAddOnUsageAddViewModel() { QuantityAddOnUsage = new QuantityAddOnUsage(); }