コード例 #1
0
        public void successLoginTest()
        {
            SystemUser user = db.getUserByName("test2");

            sl.removeUser(4, user.id);
            sl.removeUser(5, user.id);
            sl.Logout(db.getUserByName("test2").id);
            object m = sl.Login("test2", "2");

            Assert.IsInstanceOfType(m, typeof(SystemUser));
        }
コード例 #2
0
        private static void Login(ClientInfo clientInfo, JObject jsonObject)
        {
            var usernameToken   = jsonObject["username"];
            var passwordToken   = jsonObject["password"];
            var passPhraseToken = jsonObject["passPhrase"];

            if ((usernameToken == null) || (usernameToken.Type != JTokenType.String) ||
                (String.IsNullOrWhiteSpace(usernameToken.ToString())) ||

                (passwordToken == null) || (passwordToken.Type != JTokenType.String) ||
                (String.IsNullOrWhiteSpace(passwordToken.ToString())))
            {
                throw new ArgumentException("Error: Parameters Mismatch at Login.", "Login");
            }

            if ((passPhraseToken != null) && (passPhraseToken.Type == JTokenType.String) &&
                (!String.IsNullOrWhiteSpace(passPhraseToken.ToString())))
            {
                if (clientInfo.type == ClientInfo.CLIENT_TYPE.TCP)
                {
                    clientInfo.passPhrase = (string)passPhraseToken;
                }
            }

            var loginResponse = sl.Login((string)usernameToken, (string)passwordToken);

            SendMessage(clientInfo, loginResponse, 200, true);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            SLInterface b1Company = new SLInterface("https://andromeda:50000/b1s/v1/");
            bool        connected = b1Company.Login(usrName: "manager", pwd: "", db: "SBODEMOES");

            Console.WriteLine($"Resultado de la conexión: {connected}");
            if (!connected)
            {
                Console.ReadLine();
                return;
            }
            //b1Company.GetItems();
            //b1Company.GetItem("A00001");
            //b1Company.GetOrders();
            b1Company.AddSaleOrder(cardCode: "C20000", itemCode: "A00001");
            b1Company.Logout();
            Console.WriteLine("Fin de la ejecución!! ************************");
            Console.ReadLine();
        }
コード例 #4
0
 public object login(string username, string password)
 {
     return(sl.Login(username, password));
 }