Exemple #1
0
        /* Login using the appropiate request (FishbowlRequests or FishbowlLegacyRequest)
         */
        public static void LogInRESTfulFish()
        {
            // Get Fishbowl username, password, host, and port from app.config
            Misc.ReadAllSettings();

            // Grab Fishbowl username and password from ConfigurationManager.AppSettings object
            string FishbowlUser     = ConfigurationManager.AppSettings.Get("FishbowlUser");
            string FishbowlPassword = ConfigurationManager.AppSettings.Get("FishbowlPassword");

            ConnectionObject.Connect();

            String loginCommand = FishbowlLegacyRequests.LoginRq("3565",
                                                                 "RESTfulFish Gateway", FishbowlUser, "RESTfulFish Gateway", FishbowlPassword);


            /* Send login command once to get fishbowl server to recognize the connection attempt
             * or pull the key off the line if already connected.
             */
            Console.WriteLine("Misc.LogInRESTfulFish(): Client Started...");

            Key = FishbowlLegacy.PullKey(ConnectionObject.sendCommand(loginCommand));

            while (Misc.Key == "null")
            {
                Console.WriteLine("Please accept the connection attempt on the fisbowl server and press Enter.");
                Console.WriteLine("Refer to 'Integrated Apps tab' in https://www.fishbowlinventory.com/wiki/Settings");
                Console.ReadLine();
                Misc.Key = FishbowlLegacy.PullKey(ConnectionObject.sendCommand(loginCommand));
            }
        }