protected void ChangeUser(object sender, EventArgs e) { OrgServiceClient client = new OrgServiceClient(); Session["user"] = client.GetEmployee(this.ddlConnectAs.SelectedValue); this.currentUser = (Employee)Session["user"]; client.Close(); this.ConfigureInboxTables(); }
// get the name and id of the employee string GetEmployeeName(string employeeId) { OrgServiceClient client = new OrgServiceClient(); Employee emp = client.GetEmployee(employeeId); client.Close(); return(string.Format("{0} - {1}", emp.Id, emp.Name)); }
protected void ChangeUser(object sender, EventArgs e) { OrgServiceClient client = new OrgServiceClient(); Session["user"] = client.GetEmployee(this.ddlConnectAs.SelectedValue); this.currentUser = (Employee)Session["user"]; client.Close(); this.ConfigureInboxTables(); }
void BindEmployees() { OrgServiceClient client = new OrgServiceClient(); IList <Employee> employees = client.GetAllEmployees().OrderBy(e => e.Name).ToList(); foreach (Employee employee in employees) { this.ddlConnectAs.Items.Add(new ListItem(string.Format("{0} - {1} ({2} - {3})", employee.Id, employee.Name, employee.Position.Name, employee.Department.Name), employee.Id)); } if (currentUser != null) { this.ddlConnectAs.Items.FindByValue(currentUser.Id).Selected = true; } else { Session["user"] = client.GetEmployee(ddlConnectAs.SelectedItem.Value); this.currentUser = (Employee)Session["user"]; } client.Close(); }
void BindEmployees() { OrgServiceClient client = new OrgServiceClient(); IList<Employee> employees = client.GetAllEmployees().OrderBy(e => e.Name).ToList(); foreach (Employee employee in employees) { this.ddlConnectAs.Items.Add(new ListItem(string.Format("{0} - {1} ({2} - {3})", employee.Id, employee.Name, employee.Position.Name, employee.Department.Name), employee.Id)); } if (currentUser != null) { this.ddlConnectAs.Items.FindByValue(currentUser.Id).Selected = true; } else { Session["user"] = client.GetEmployee(ddlConnectAs.SelectedItem.Value); this.currentUser = (Employee)Session["user"]; } client.Close(); }
// get the name and id of the employee string GetEmployeeName(string employeeId) { OrgServiceClient client = new OrgServiceClient(); Employee emp = client.GetEmployee(employeeId); client.Close(); return string.Format("{0} - {1}", emp.Id, emp.Name); }