Ejemplo n.º 1
0
        public ActionResult AddGet(int memberBookingSpaceID)
        {
            SetSessionVariables();
            QuantityAddOnUsage quantityAddOnUsage = new QuantityAddOnUsage()
            {
                MemberBookingSpaceID = memberBookingSpaceID
            };

            return(View(quantityAddOnUsage));
        }
Ejemplo n.º 2
0
        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 }));
        }
Ejemplo n.º 3
0
 public QuantityAddOnUsageUpdateViewModel()
 {
     QuantityAddOnUsage = new QuantityAddOnUsage();
 }
Ejemplo n.º 4
0
 public QuantityAddOnUsageAddViewModel()
 {
     QuantityAddOnUsage = new QuantityAddOnUsage();
 }