Пример #1
0
        public ActionResult GoToRegistration(string myGarmentsItems, string myWishListItems)
        {
            string[] myGarmentsArray = myGarmentsItems.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            string[] myWishListArray = myWishListItems.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            ClosetState.SetAddGarments((from s in myGarmentsArray select Convert.ToInt32(s)).ToList <int>());
            ClosetState.SetWishGarments((from s in myWishListArray select Convert.ToInt32(s)).ToList <int>());

            return(RedirectToAction("Index", "Registration"));
        }
Пример #2
0
        public ActionResult SaveSelection(UserGarmentSelection userGarmentSelection)
        {
            List <int> garmentsSelected     = new List <int>();
            List <int> wishGarmentsSelected = new List <int>();

            foreach (string id in userGarmentSelection.GarmentSelectedIds)
            {
                garmentsSelected.Add(Convert.ToInt32(id));
            }

            foreach (string id in userGarmentSelection.WishGarmentSelectedIds)
            {
                wishGarmentsSelected.Add(Convert.ToInt32(id));
            }

            ClosetState.SetAddGarments(garmentsSelected);
            ClosetState.SetWishGarments(wishGarmentsSelected);

            ViewData.Model = userGarmentSelection;

            return(Json(true));
        }