Exemple #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();
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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));
        }
        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();
        }
Exemple #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();
        }
Exemple #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();
        }
        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();
        }
Exemple #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();
 }