Example #1
0
        private async void _ButtLoginUser_Click(object sender, EventArgs e)
        {
            JsonCommand         cmd    = DataFoxServiceCommands.CreateGetUserByPINCommand("01055854");
            JsonCommandRetValue retval = await ModulesClientEnvironment.Default.JsonCommandClient.DoCommand(cmd);

            this._Ausgabe.Text = retval.ReturnCode + "\r\n" + retval.ReturnMessage + "\r\n" + retval.ReturnValue;
            User usr = JsonConvert.DeserializeObject <User>(retval.ReturnValue);

            this._Ausgabe.Text += "\r\nUrl: " + UserModule.Default.GetUserImageUrl(usr.ID);

            this.pictureEdit1.LoadAsync(UserModule.Default.GetUserImageUrl(usr.ID));
        }
Example #2
0
        public async Task <(bool success, string message)> Login(string pin)
        {
            JsonCommand cmd = DataFoxServiceCommands.CreateGetUserByPINCommand(pin);
            // string cmdUrl = ModulesClientEnvironment.Default.JsonCommandClient.BuildCommandUrl(cmd);
            JsonCommandRetValue retValue = await ModulesClientEnvironment.Default.JsonCommandClient.DoCommand(cmd);

            if (retValue.ReturnCode == 200)
            {
                CurrentUser = JsonConvert.DeserializeObject <User>(retValue.ReturnValue);
                this.RefreshStempelTagInfos();
                return(true, "Benutzer erfolgreich eingeloggt");
            }
            return(false, "Benutzer konnte nicht eingeloggt werden: " + retValue.ReturnMessage);
        }