/// <summary> /// This is a user-editing page that uses the same controls as the registration page. /// </summary> /// <param name="client">The REST Client.</param> /// <param name="user">The user that is to be edited.</param> public RegistrationPage(ref Services.RestClient client, Models.User user) { this.client = client; editing = true; newUser = user; InitializeComponent(); SetUpPage(); // Sets up the page as a whole. SetUpGrid(); // Sets up the grid on the page. lblTitle.Text = "Edit User Form"; // Change the title to reflect editing. // Fill in the fields with the user's current information. txtFirstName.Text = user.FirstName; txtLastName.Text = user.LastName; txtEmail.Text = user.EmailAddress; txtPhoneNumber.Text = user.PhoneNumber.ToString(); if (txtPhoneNumber.Text != null && !txtPhoneNumber.Text.Equals(string.Empty)) { TxtPhoneNumber_Unfocused(null, null); } txtAddressLineOne.Text = user.AddressLineOne; txtAddressLineTwo.Text = user.AddressLineTwo; txtZip.Text = user.ZipCode; txtCity.Text = user.City; if (user.State != null && !user.State.Equals(string.Empty)) { lstState.SelectedIndex = lstState.Items.IndexOf(user.State); } }
/// <summary> /// This is a blank, brand-new registration page to create a user in the database. /// </summary> /// <param name="client">The REST Client.</param> public RegistrationPage(ref Services.RestClient client) { this.client = client; InitializeComponent(); SetUpPage(); // Sets up the page as a whole. SetUpGrid(); // Sets up the grid on the page. }
/// <summary> /// This is a registration page with pre-existing first and last names from the lookup page. /// </summary> /// <param name="client">The REST Client.</param> /// <param name="firstName">The user's first name.</param> /// <param name="lastName">The user's last name.</param> public RegistrationPage(ref Services.RestClient client, string firstName, string lastName) { // This constructor is used when the lookup page does not find a user and the user then wishes to create a new user. // It simply fills in the first and last names with the information they provided in the lookup page to make it // slightly easier on the user. this.client = client; InitializeComponent(); SetUpPage(); // Sets up the page as a whole. SetUpGrid(); // Sets up the grid on the page. txtFirstName.Text = firstName; // Fill in the first name. txtLastName.Text = lastName; // Fill in the last name. }
/// <summary> /// This is the page where the user will submit a request to be visited by the pastor or other church personnel. /// </summary> /// <param name="client">The REST Client.</param> public VisitRequestPage(ref Services.RestClient client) { this.client = client; // The same original RestClient object. InitializeComponent(); SetUpPage(); // Sets up the page programmatically. }
/// <summary> /// This is the page where the user can submit prayer requests. /// </summary> /// <param name="client">The REST Client.</param> public PrayerRequestPage(ref Services.RestClient client) { this.client = client; // As per usual, this is the original REST Client object. InitializeComponent(); SetUpGrid(); // This sets up the grid programmatically. }