Ejemplo n.º 1
0
        public LocationList getAvailableLocationList()
        {
            SocketRequest        = new SocketRequest();
            SocketRequest.Action = ACTION.GET_AVAILABLE_LOCATIONS;
            //send request
            string requestAsJSON = JsonConvert.SerializeObject(SocketRequest);

            communicationController.SendMessage(requestAsJSON);

            // used for testing purposes
            string JsonString = communicationController.ReadReplyMessage();

            LocationList tempLocationList = new LocationList();

            communicationController.clientSocket.NoDelay = true;

            //deserializing
            tempLocationList = JsonConvert.DeserializeObject <LocationList>(JsonString);

            communicationController.clientSocket.Close();
            return(tempLocationList);
        }
Ejemplo n.º 2
0
        public void updatePallet(Pallet pallet)
        {
            SocketRequest        = new SocketRequest();
            SocketRequest.Action = ACTION.EDIT_PALLET;
            SocketRequest.Obj    = pallet;

            //send request
            string requestAsJSON = JsonConvert.SerializeObject(SocketRequest);

            communicationController.SendMessage(requestAsJSON);

            // used for testing purposes
            string JsonString = communicationController.ReadReplyMessage();
            bool   response   = false;

            if (JsonString.Equals("success"))
            {
                response = true;
            }
            communicationController.clientSocket.Close();
            //return response;
        }
Ejemplo n.º 3
0
        public void assignLocationToCompany(string locationID, string companyID)
        {
            SocketRequest            = new SocketRequest();
            SocketRequest.Action     = ACTION.ASSIGN_LOCATION_TO_COMPANY;
            SocketRequest.LocationID = locationID;
            SocketRequest.CompanyID  = companyID;

            //serializing to Json
            string requestAsJSON = JsonConvert.SerializeObject(SocketRequest);

            //send request
            communicationController.SendMessage(requestAsJSON);

            // used for testing purposes
            string JsonString = communicationController.ReadReplyMessage();
            bool   response   = false;

            if (JsonString.Equals("success"))
            {
                response = true;
            }
            communicationController.clientSocket.Close();
            //return response;
        }