protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ddlUser.DataSource = from user in Membership.GetAllUsers().Cast <MembershipUser>() join emp in employeeProvider.GetAll() on user.UserName equals emp.UserName where !user.IsLockedOut select new { UserName = user.UserName, Name = employeeProvider.GetName(user.UserName) == String.Empty ? user.UserName : employeeProvider.GetName(user.UserName) }; ddlUser.DataTextField = "Name"; ddlUser.DataValueField = "UserName"; ddlUser.DataBind(); ddlUser.Items.Insert(0, "Select user"); btnSave.Enabled = false; } }
protected void lnbAddNew_Click(object sender, EventArgs e) { mvwForm.SetActiveView(viwAddEdit); dtpDate.SelectedDate = DateTime.Today; hidBranchID.Value = ddlBranch.SelectedValue; lblBranch.Text = ddlBranch.SelectedItem.Text; ddlConsultant.DataSource = employeeProvider.GetAll(Convert.ToInt32(hidBranchID.Value)); ddlConsultant.DataTextField = "UserName"; ddlConsultant.DataValueField = "ID"; ddlConsultant.DataBind(); ddlConsultant.Items.Insert(0, new DropDownListItem(String.Empty)); txtFirstName.Text = txtLastName.Text = txtEmail.Text = txtIdentityNo.Text = txtNotes.Text = txtPhone1.Text = txtPhone2.Text = txtSourceRef.Text = String.Empty; chkEnableFreeTrial.Checked = false; txtFirstName.Focus(); }
public List <Employee> GetAll() { return(_myProvider.GetAll()); }