Exemplo n.º 1
0
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            if (Organization.SelectedItem == null || Role.SelectedItem == null)
            {
                DisplayErrorMessage("سازمان یا نقش انتخاب نشده است.");
                return;
            }

            try
            {
                HideErrorMessage();

                var Model = new Core.AppService.Contract.BindingModels.MembershipAuthenticationBindingModel()
                {
                    OrganizationId = Memberships.Where(P => P.OrganizationTitle == (Organization.SelectedItem as ComboBoxItem).Content.ToString()).Select(P => P.OrganizationId).First(),
                    Role           = RoleReverseDictionary[(Role.SelectedItem as ComboBoxItem).Content.ToString()]
                };
                var Result = AuthenticationCommand.SecondStepLogin(Model);

                if (Result.StatusCode != StatusCode.Ok)
                {
                    DisplayErrorMessage(Result.Message.Text);
                }
                else
                {
                    SessionManagement.AccessToken = Result.Data;
                    RedirectTo(new HomePage());
                }
            }
            catch (Exception Ex)
            {
                DisplayErrorMessage(Ex.Message);
            }
        }
Exemplo n.º 2
0
 public ServiceResult <string> Patch(MembershipAuthenticationBindingModel request)
 {
     return(_authenticationCommand.SecondStepLogin(request));
 }