public ActionResult Delete(int id)
        {
            PlaceClient client = new PlaceClient();

            client.Delete(id);
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(Place CVM)
        {
            PlaceClient client = new PlaceClient();

            client.Edit(CVM);
            return(RedirectToAction("Index"));
        }
        public ActionResult Create(Place Place)
        {
            PlaceClient client = new PlaceClient();

            client.Create(Place);
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
        public String GetPlaceName(int Place)
        {
            PlaceClient ac    = new PlaceClient();
            Place       place = ac.Find(Place);

            return(place.Name);
        }
        public ActionResult Edit(int id)
        {
            PlaceClient    client = new PlaceClient();
            PlaceViewModel CVM    = new PlaceViewModel();

            CVM.Place = client.Find(id);
            return(View("Edit", CVM.Place));
        }
        // GET: Place where user id==current user id
        public ActionResult Index()
        {
            ClaimsPrincipal currentUser = User;

            var userId = currentUser.FindFirst(ClaimTypes.NameIdentifier).Value;

            PlaceClient client = new PlaceClient();

            ViewBag.Placelist = client.GetPlaceList(userId);


            return(View());
        }
Esempio n. 7
0
        public ClientImp()
        {
            _place     = new PlaceClient();
            _moderator = new ModeratorClient();
            _report    = new ReportClient();
            listener   = new UDPListener();

            var subscriberThread = new Thread(_place.Subscribe);

            subscriberThread.Name = "Subscriber";
            subscriberThread.Start();

            //new Thread(() => rest.SubscribeAsync()).Start();
            var listenerThread = new Thread(listener.Run);

            listenerThread.Name = "UDP Listener";
            listenerThread.Start();
        }
        public List <SelectListItem> GetPlaceList(string id)
        {
            PlaceClient         ac         = new PlaceClient();
            IEnumerable <Place> enumerable = ac.GetPlaceList(id);
            var types    = new List <SelectListItem>();
            var iterator = 0;

            foreach (var el in enumerable)
            {
                iterator++;
                types.Add(new SelectListItem()
                {
                    Text = el.Name.ToString(), Value = el.Id.ToString()
                });
            }



            return(types);
        }
Esempio n. 9
0
        public void Action(String choice, Table table = null, Client client = null, List <Menu> menus = null)
        {
            switch (choice)
            {
            case "BringMenu":     //Arg Table Card
                BringMenu bringMenu = (BringMenu)this.mapActions["BringMenu"];
                bringMenu.act(table);
                break;

            case "TakeOrder":     //Arg Client, List<Menu>
                TakeOrder takeOrder = (TakeOrder)this.mapActions["TakeOrder"];
                takeOrder.act(client, menus);
                break;

            case "PlaceClient":     // Arg Client Table
                PlaceClient placeClient = (PlaceClient)this.mapActions["PlaceClient"];
                placeClient.act(client, table);
                break;

            default:
                break;
            }
        }