Ejemplo n.º 1
0
        private void ChangePassword_Click(object sender, EventArgs e)
        {
            bool isAdmin = sender == vbtnChangeAdmin;

            //No authentication is needed here
            if (PasswordForm.ChangePassword(this.FindForm(), isAdmin))
            {
                if (!isAdmin)
                {
                    new MethodInvoker(() =>
                    {
                        var url      = SettingsTable.Get <string>(Strings.All_CentralServerUrl, Strings.All_CentralServerUrlPathDefault);
                        var authUser = SettingsTable.Get <UserAuth>(Strings.Transferring_AuthObject);
                        //Validate on TRS server
                        DataServiceClient.CallValidateUser(authUser.CountryID, authUser.Name, authUser.Password);

                        //Send to win service
                        var settingsObj = SettingsTable.Get <SettingsObj>(Strings.Transferring_SettingsObject, SettingsObj.Default);
                        DBConfigValue.Save(Strings.Transferring_AuthObject, authUser);
                        DBConfigValue.Save(Strings.Transferring_SettingsObject, settingsObj);
                    }).FireAndForget();
                }
            }
        }