示例#1
0
 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();
 }
示例#2
0
        // get the name of the position
        string GetPositionName(string id)
        {
            OrgServiceClient client   = new OrgServiceClient();
            Position         position = client.GetPosition(id);

            client.Close();
            return(position.Name);
        }
示例#3
0
        // get the name of the department
        string GetDepartmentName(string id)
        {
            OrgServiceClient client = new OrgServiceClient();
            Department       dept   = client.GetDepartment(id);

            client.Close();
            return(dept.Name);
        }
示例#4
0
        // 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));
        }
示例#5
0
        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();
        }
示例#6
0
        // bind DropDownList of positions
        void BindPositions()
        {
            OrgServiceClient client    = new OrgServiceClient();
            IList <Position> positions = client.GetAllPositions().OrderBy(p => p.Name).ToList();

            foreach (Position position in positions)
            {
                this.ddlPosition.Items.Add(new ListItem(position.Name, position.Id));
            }
            client.Close();
        }
示例#7
0
        // bind DropDownList of departments
        void BindDepartments()
        {
            OrgServiceClient   client      = new OrgServiceClient();
            IList <Department> departments = client.GetAllDepartments().OrderBy(d => d.Name).ToList();

            foreach (Department department in departments)
            {
                this.ddlDepartment.Items.Add(new ListItem(department.Name, department.Id));
            }
            client.Close();
        }
示例#8
0
        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();
        }
示例#9
0
        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 of the position
 string GetPositionName(string id)
 {
     OrgServiceClient client = new OrgServiceClient();
     Position position = client.GetPosition(id);
     client.Close();
     return position.Name;
 }
 // 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);
 }
 // get the name of the department
 string GetDepartmentName(string id)
 {
     OrgServiceClient client = new OrgServiceClient();
     Department dept = client.GetDepartment(id);
     client.Close();
     return dept.Name;
 }
 // bind DropDownList of positions
 void BindPositions()
 {
     OrgServiceClient client = new OrgServiceClient();
     IList<Position> positions = client.GetAllPositions().OrderBy(p => p.Name).ToList();
     foreach (Position position in positions)
     {
         this.ddlPosition.Items.Add(new ListItem(position.Name, position.Id));
     }
     client.Close();
 }
 // bind DropDownList of departments
 void BindDepartments()
 {
     OrgServiceClient client = new OrgServiceClient();
     IList<Department> departments = client.GetAllDepartments().OrderBy(d => d.Name).ToList();
     foreach (Department department in departments)
     {
         this.ddlDepartment.Items.Add(new ListItem(department.Name, department.Id));
     }
     client.Close();
 }