protected void btnSaveProfile_Click(object sender, EventArgs e) { try { GetFormFields(this.SelectedUser, this.SelectedCredentials); bool successs = false; if (this.SelectedClient.IsDirty) { m_account = SystemManager.UpdateClientUser(this.SelectedUser); successs = true; } if (this.SelectedCredentials.IsDirty) { m_credentials = SystemManager.UpdateCredential(this.SelectedCredentials); successs = true; } if (successs == true) { this.InfoMessage = "Update was successful"; } } catch (Exception ex) { this.ErrorMessage = ex.Message; } }
void SetFormFields(VLClientUser user, VLCredential credentials) { this.FirstName.Text = user.FirstName; this.LastName.Text = user.LastName; this.UserName.Text = credentials.LogOnToken; this.Email.Text = user.Email; }
void GetFormFields(VLClientUser user, VLCredential credentials) { user.FirstName = this.FirstName.Text; user.LastName = this.LastName.Text; user.Email = this.Email.Text; credentials.LogOnToken = this.UserName.Text; }
public void SetValues(VLSystemUser user, VLCredential credentials) { this.FirstName.Text = user.FirstName; this.LastName.Text = user.LastName; this.LogOnToken.Text = credentials.LogOnToken; this.Email.Text = user.Email; this.IsActive.Checked = user.IsActive; this.IsLockedOut.Checked = credentials.IsLockedOut; this.Role.SelectedValue = user.Role.ToString(CultureInfo.InvariantCulture); this.Notes.Text = user.Notes; if (user.IsBuiltIn) { foreach (Control ctrl in this.Controls) { if (ctrl is WebControl) { ((WebControl)ctrl).Enabled = false; } } } }
public void SetValues(VLClientUser user, VLCredential credentials) { this.FirstName.Text = user.FirstName; this.LastName.Text = user.LastName; this.LogOnToken.Text = credentials.LogOnToken; this.Email.Text = user.Email; this.Title.Text = user.Title; this.Department.Text = user.Department; if (user.Country.HasValue) { this.Country.SelectedValue = user.Country.Value.ToString(CultureInfo.InvariantCulture); } this.Prefecture.Text = user.Prefecture; this.Town.Text = user.Town; this.Address.Text = user.Address; this.Zip.Text = user.Zip; this.Telephone1.Text = user.Telephone1; this.Telephone2.Text = user.Telephone2; this.IsActive.Checked = user.IsActive; this.IsLockedOut.Checked = credentials.IsLockedOut; this.Role.SelectedValue = user.Role.ToString(CultureInfo.InvariantCulture); this.Comment.Text = user.Comment; if (user.IsBuiltIn) { foreach (Control ctrl in this.Controls) { if (ctrl is WebControl) { ((WebControl)ctrl).Enabled = false; } } } }