private void btnAddUpdateAuthorization_Click(object sender, System.Windows.RoutedEventArgs e)
		{
            string authorizationNumber = txtAuthorization.Text.Trim();
            string preAuthorizationNumber = txtPreAuthorization.Text.Trim();

            if (AreValidFields(authorizationNumber, preAuthorizationNumber) == false)
            {
                return;
            }

            if (_isUpdateAuthorization)
            {
                _selectedAuthorization.AuthorizationDate = DateTime.Now;
                _selectedAuthorization.AuthorizationNumber = chkAuthorization.IsChecked.Value ? authorizationNumber : null;
                _selectedAuthorization.PreAuthorizationNumber = chkPreAuthorization.IsChecked.Value ? preAuthorizationNumber : null;

                UpdateAuthorization(_selectedAuthorization);
            }
            else
            {
                Model.Authorization authorizationToAdd = new Model.Authorization()
                {
                    AuthorizationDate = DateTime.Now,
                    AuthorizationNumber = chkAuthorization.IsChecked.Value ? authorizationNumber : null,
                    PreAuthorizationNumber = chkPreAuthorization.IsChecked.Value ? preAuthorizationNumber : null,
                    PatientId = _selectedPatient.PatientId
                };

                AddAuthorization(authorizationToAdd);
            }
		}
Example #2
0
        private (Model.Challenge challenge, string challengeUrl) CreateTestModel()
        {
            var account = new Model.Account(new Model.Jwk(StaticTestData.JwkJson), new List <string> {
                "*****@*****.**"
            }, null);
            var order = new Model.Order(account, new List <Model.Identifier> {
                new Model.Identifier("dns", "www.example.com")
            });
            var authorization = new Model.Authorization(order, order.Identifiers.First(), DateTimeOffset.UtcNow);
            var challenge     = new Model.Challenge(authorization, "http-01");

            return(challenge, "https://challenge.example.com");
        }
        public AddEditAuthorizationsModal(Model.Patient selectedPatient, Model.Authorization selectedAuthorization)
		{
			this.InitializeComponent();

            _selectedPatient = selectedPatient;
            _selectedAuthorization = selectedAuthorization;
            _isUpdateAuthorization = selectedAuthorization != null;

            lblExpNumber.ToolTip = lblExpNumber.Content = selectedPatient.AssignedId;
            lblPatientName.ToolTip = lblPatientName.Content = selectedPatient.FirstName + " " + selectedPatient.LastName;

            if (_isUpdateAuthorization)
            {
                PrepareWindowForUpdates();
            }
		}
Example #4
0
        public Authorization(Model.Authorization model, IEnumerable <Challenge> challenges)
        {
            if (model is null)
            {
                throw new System.ArgumentNullException(nameof(model));
            }

            if (challenges is null)
            {
                throw new System.ArgumentNullException(nameof(challenges));
            }

            Status = EnumMappings.GetEnumString(model.Status);

            Expires  = model.Expires.ToString("o", CultureInfo.InvariantCulture);
            Wildcard = model.IsWildcard;

            Identifier = new Identifier(model.Identifier);
            Challenges = new List <Challenge>(challenges);
        }