protected void btnReset_Click(object sender, EventArgs e) { if (txtEmail.Text != "") { Affinity.Accounts accs = new Affinity.Accounts(this.phreezer); Affinity.AccountCriteria c = new Affinity.AccountCriteria(); c.Email = txtEmail.Text; accs.Query(c); if (accs.Count > 0) { foreach (Affinity.Account ac in accs) { string newPass = Com.Obviex.RandomPassword.Generate(6, 8); ac.Password = newPass; ac.SetPassword(); SendEmail(ac, newPass); } pnlReset.Visible = false; pnlResults.Visible = true; } else { lblError.Visible = true; lblError.Text = "The email specified was not found"; } } }
/// <summary> // This is called when the Re-Assign button is clicked and just shows the dropdown of possible user choices /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnReAssign_Click(object sender, EventArgs e) { this.RequirePermission(Affinity.RolePermission.AffinityManager); Affinity.Accounts accts = new Affinity.Accounts(this.phreezer); Affinity.AccountCriteria ac = new Affinity.AccountCriteria(); ac.AppendToOrderBy("LastName"); ac.AppendToOrderBy("FirstName"); accts.Query(ac); ddNewOriginator.DataSource = accts; ddNewOriginator.DataTextField = "FullName"; ddNewOriginator.DataValueField = "Id"; try { ddNewOriginator.SelectedValue = this.order.OriginatorId.ToString(); } catch (Exception ex) { } ddNewOriginator.DataBind(); txtOriginator.Visible = false; btnReAssign.Visible = false; ddNewOriginator.Visible = true; btnDoReAssign.Visible = true; }
/* ~~~ CONSTRAINTS ~~~ */ /* ~~~ SETS ~~~ */ /// <summary> /// Returns a collection of Account objects /// </summary> /// <param name="criteria"></param> /// <returns>Accounts</returns> public Accounts GetAccountRoles(AccountCriteria criteria) { criteria.RoleCode = this.Code; Accounts accountRoles = new Accounts(this.phreezer); accountRoles.Query(criteria); return(accountRoles); }
/* ~~~ CONSTRAINTS ~~~ */ /* ~~~ SETS ~~~ */ /// <summary> /// Returns a collection of Account objects /// </summary> /// <param name="criteria"></param> /// <returns>Accounts</returns> public Accounts GetAccountCompanys(AccountCriteria criteria) { criteria.CompanyId = this.Id; Accounts accountCompanys = new Accounts(this.phreezer); accountCompanys.Query(criteria); return(accountCompanys); }
protected void Page_Load(object sender, EventArgs e) { this.RequirePermission(Affinity.RolePermission.SubmitOrders); if (!Page.IsPostBack) { Affinity.Accounts accts = new Affinity.Accounts(this.phreezer); Affinity.AccountCriteria ac = new Affinity.AccountCriteria(); ac.AppendToOrderBy("LastName"); ac.AppendToOrderBy("FirstName"); accts.Query(ac); ddNewOriginator.DataSource = accts; ddNewOriginator.DataTextField = "FullName"; ddNewOriginator.DataValueField = "Id"; ddNewOriginator.DataBind(); } this.Master.SetLayout(this.header.InnerText, MasterPage.LayoutStyle.ContentOnly); }