Example #1
0
        /// <summary>
        /// Handles the DoLoginCompleted event of the loginService control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="PureMVC.CSharp.Demos.Silverlight.WebService.Login.Silverlight.LoginService.DoLoginCompletedEventArgs"/> instance containing the event data.</param>
        protected void loginService_DoLoginCompleted(object sender, DoLoginCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                SendNotification(Notifications.LOGIN_ERROR, "Invalid Username and/or Password");
            }
            else
            {
                // TODO: Need to find a way to share DTOs between layers
                validLoginDto           = new LoginDto();
                validLoginDto.Username  = e.Result.Username;
                validLoginDto.Password  = e.Result.Password;
                validLoginDto.LoginDate = e.Result.LoginDate;

                SendNotification(Notifications.LOGIN_SUCCESS);
            }
        }
        /// <summary>
        /// Handles the DoLoginCompleted event of the loginService control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="PureMVC.CSharp.Demos.Silverlight.WebService.Login.Silverlight.LoginService.DoLoginCompletedEventArgs"/> instance containing the event data.</param>
        protected void loginService_DoLoginCompleted(object sender, DoLoginCompletedEventArgs e)
        {
            if(e.Error != null)
            {
                SendNotification(Notifications.LOGIN_ERROR, "Invalid Username and/or Password");
            }
            else
            {
                // TODO: Need to find a way to share DTOs between layers
                validLoginDto = new LoginDto();
                validLoginDto.Username = e.Result.Username;
                validLoginDto.Password = e.Result.Password;
                validLoginDto.LoginDate = e.Result.LoginDate;

                SendNotification(Notifications.LOGIN_SUCCESS);
            }
        }