Example #1
0
        public ActionResult Edit([Bind(Include = "Id,Name,Address")] StoreModel storemodel)
        {
            if (ModelState.IsValid)
            {
                var response = SuperZapatosAPI.CallAPI("services/UpdateStore/", storemodel);

                return(RedirectToAction("Index"));
            }

            return(View(storemodel));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "name, description, price, total_in_shelf, total_in_vault, store_id")] ArticleModel articlemodel)
        {
            if (ModelState.IsValid)
            {
                var response = SuperZapatosAPI.CallAPI("services/CreateArticle/", articlemodel);

                return(RedirectToAction("Index"));
            }

            return(View(articlemodel));
        }
Example #3
0
        public ActionResult DeleteConfirmed(int?id)
        {
            var storeResponse = new SingularStoreResponse();
            var idModel       = new IdModel();

            idModel.id = id.ToString();
            var response = SuperZapatosAPI.CallAPI("services/DeleteStore/", idModel);

            if (response.IsSuccessStatusCode)
            {
                // Creating Json Request Object
                storeResponse = new JavaScriptSerializer().Deserialize <SingularStoreResponse>(response.Content.ReadAsStringAsync().Result);
            }

            return(RedirectToAction("Index"));
        }