protected void Button1_Click(object sender, EventArgs e) { string json = shoeService.doDelete(shoeName.Text); Response result = JSONHelper.Deserializer <Response>(json); Label5.Text = result.statusText; }
protected void Button4_Click(object sender, EventArgs e) { int headerID = JSONHelper.Deserializer <int>(htController.getLastHT()); htController.insertHT(headerID, Int32.Parse(userFinish.Text)); Model.Cart currCart = JSONHelper.Deserializer <Model.Cart>(cartController.getUserCart(Int32.Parse(userFinish.Text))); dtController.insertDT(headerID, currCart.Quantity, currCart.ShoeID); }
protected void displayShoes() { string json = shoeService.doGet(); List <Model.Sho> shoeList = JSONHelper.Deserializer <List <Model.Sho> >(json); shoeListGrid.DataSource = shoeList; shoeListGrid.DataBind(); }
protected void displayUsers() { string json = userService.getAll(); List <Model.User> userList = JSONHelper.Deserializer <List <Model.User> >(json); userListGrid.DataSource = userList; userListGrid.DataBind(); }
protected void displayShoe() { string json = shoeControl.doGet(); List <Model.Sho> shoeList = JSONHelper.Deserializer <List <Model.Sho> >(json); shoeListView.DataSource = shoeList; shoeListView.DataBind(); }
protected void loadShoeDetail() { shoeId = Int32.Parse(shoe.Text); string json = shoeController.doGetByID(shoeId); List <Model.Sho> shoeList = JSONHelper.Deserializer <List <Model.Sho> >(json); shoeGrid.DataSource = shoeList; shoeGrid.DataBind(); }
protected void loadCartData() { userID = Int32.Parse(userController.getUserID(usernameTxt.Text)); string json = cartController.getUserCart(userID); List <Model.Cart> cartList = JSONHelper.Deserializer <List <Model.Cart> >(json); cartGrid.DataSource = cartList; cartGrid.DataBind(); }
protected void updateCart() { userID = Int32.Parse(updateUser.Text); shoeId = Int32.Parse(updateShoe.Text); qty = Int32.Parse(updateQty.Text); string json = cartController.updateCart(userID, shoeId, Int32.Parse(oldQty.Text), qty); Model.Cart cart = JSONHelper.Deserializer <Model.Cart>(json); List <Model.Cart> cartList = new List <Model.Cart>(); cartList.Add(cart); updateCartGrid.DataSource = cartList; updateCartGrid.DataBind(); }
protected void LoginBtn(object sender, EventArgs e) { string json = userController.doLogin(userTxt.Text, passTxt.Text); Response result = JSONHelper.Deserializer <Response>(json); if (userTxt.Text.Equals("admin") && passTxt.Text.Equals("admin")) { Response.Redirect("~/Views/Admin/AdminForm.aspx"); } else if (result.status != 201) { Response.Redirect("Login.aspx?msg=" + result.data.ToString()); } else { Session.Timeout = 60; Response.Redirect("~/Views/Store/Store.aspx"); } }