public void GetValues(VLClientUser user, ref string logOnToken, ref string pswdToken) { user.FirstName = this.FirstName.Text; user.LastName = this.LastName.Text; logOnToken = this.LogOnToken.Text; pswdToken = this.PswdToken.Text; user.Email = this.Email.Text; user.Title = this.Title.Text; user.Department = this.Department.Text; if (!string.IsNullOrWhiteSpace(this.Country.SelectedValue)) { user.Country = Int32.Parse(this.Country.SelectedValue); } else { user.Country = null; } user.Prefecture = this.Prefecture.Text; user.Town = this.Town.Text; user.Address = this.Address.Text; user.Zip = this.Zip.Text; user.Telephone1 = this.Telephone1.Text; user.Telephone2 = this.Telephone2.Text; user.IsActive = this.IsActive.Checked; user.Role = Int16.Parse(this.Role.SelectedValue); user.Comment = this.Comment.Text; }
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; }
protected void saveBtn_Click(object sender, EventArgs e) { try { string logOnToken = null; string pswdToken = null; var temporalUser = new VLClientUser(); this.contactsform1.GetValues(temporalUser, ref logOnToken, ref pswdToken); var account = SystemManager.CreateClientAccount(this.SelectedClient.ClientId, temporalUser.FirstName, temporalUser.LastName, temporalUser.Role, temporalUser.Email, logOnToken, pswdToken); account.Title = temporalUser.Title; account.Department = temporalUser.Department; account.Country = temporalUser.Country; account.Prefecture = temporalUser.Prefecture; account.Town = temporalUser.Town; account.Address = temporalUser.Address; account.Zip = temporalUser.Zip; account.Telephone1 = temporalUser.Telephone1; account.Telephone2 = temporalUser.Telephone2; account.IsActive = temporalUser.IsActive; account.Comment = temporalUser.Comment; if (account.IsDirty) { account = SystemManager.UpdateClientUser(account); } this.Response.Redirect(_UrlSuffix(string.Format("../edit.aspx?ClientId={0}", account.Client)), false); this.Context.ApplicationInstance.CompleteRequest(); } catch (ThreadAbortException) { // } catch (Exception ex) { this.ErrorMessage = ex.Message; } }
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; } } } }