Example #1
0
    protected override void setAttributes()
    {
        // set up department label
        label.text = department.getLabel();

        // set up description
        description.text = department.getDescription();

        // set up gallery button
        if (department.getGallery() != null)
        {
            galleryButton.setup(this, department.getGallery());
        }

        // set up divisions
        if (department.getDivisions() != null)
        {
            List <Division> divisions = department.getDivisions();
            foreach (Division division in divisions)
            {
                DatabaseObjectButton divisionButton = Instantiate(databaseObjectButtonPrefab, transform.position, Quaternion.identity) as DatabaseObjectButton;
                divisionButton.setup(this, division);
                divisionButton.transform.SetParent(divisionsParent.transform, true);
            }
        }

        // set up location button
        if (department.getLocationImage() != null)
        {
            locationButton.setup(profileManager, department.getLocationImage());
        }
    }
Example #2
0
    protected override void setAttributes()
    {
        // set up employee label
        label.text = employee.getLabel();

        // set up role button
        if (employee.getRole() != null)
        {
            roleButton.setup(this, employee.getRole());
        }

        // set up gallery button
        if (employee.getGallery() != null)
        {
            galleryButton.setup(this, employee.getGallery());
        }

        // set up divisionButton
        if (employee.getDivision() != null)
        {
            divisionButton.setup(this, employee.getDivision());
        }

        // set up departmentButton
        if (employee.getDepartment() != null)
        {
            departmentButton.setup(this, employee.getDepartment());
        }


        // set up hobbies
        if (employee.getHobbies() != null && !employee.getHobbies().Equals(""))
        {
            hobbiesText.text = employee.getHobbies();
        }
        else
        {
            hobbiesText.text = "N/A";
        }

        // set up location button
        locationButton.setup(profileManager, employee.getLocationImage());

        // set up email text
        if (employee.getEmail() != null)
        {
            emailText.text = employee.getEmail();
        }

        // set up profile pic
        if (employee.getProfilePic() != null)
        {
            profilePic.sprite = employee.getProfilePic();
        }
        else
        {
            profilePic.sprite = Resources.Load <Sprite>("Sprites/GallerySprites/Default");
        }
    }
Example #3
0
    protected override void setAttributes()
    {
        if (gallery.getProfiable() != null)
        {
            Profiable profiable = gallery.getProfiable();

            // set up gallery label
            label.text = profiable.getLabel() + " Gallery";

            // set up profiable header
            switch (profiable.getTypeID())
            {
            case DatabaseObject.DEPARTMENT:
                profiableHeader.text = "Department:";
                break;

            case DatabaseObject.EMPLOYEE:
                profiableHeader.text = "Employee:";
                break;

            default:
                break;
            }

            // set up profiable button
            profiableButton.setup(this, profiable);
        }

        // set up pictures
        if (gallery.getImages() != null)
        {
            if (gallery.getImages().Count == 0 || gallery.getImages()[0] == null)
            {
                noPicsLabel.gameObject.SetActive(true);
            }
            else
            {
                List <Sprite> images = gallery.getImages();
                foreach (Sprite image in images)
                {
                    Image imageHolder = Instantiate(imagePrefab, transform.position, Quaternion.identity) as Image;
                    imageHolder.sprite = image;
                    imageHolder.transform.SetParent(picturesParent.transform, true);
                }
            }
        }
        else
        {
            noPicsLabel.gameObject.SetActive(true);
        }
    }
Example #4
0
    public void setup(SearchManager searchManager, Profiable profiable, string keyword)
    {
        this.profiable     = profiable;
        this.numExtraChars = Mathf.Abs(keyword.Length - profiable.getLabel().Length);

        switch (profiable.getTypeID())
        {
        case DatabaseObject.DEPARTMENT:
            labelText.text = SearchManager.DEP;
            break;

        case DatabaseObject.EMPLOYEE:
            labelText.text = SearchManager.EMP;
            break;

        default:
            break;
        }

        databaseObjectButton.setup(searchManager, profiable);
    }
Example #5
0
    protected override void setAttributes()
    {
        // set up department label
        label.text = role.getLabel();

        // set up division button
        if (role.getDivision() != null)
        {
            divisionButton.setup(this, role.getDivision());
        }
        // set up employees
        if (role.getEmployees() != null)
        {
            List <Employee> employees = role.getEmployees();
            foreach (Employee employee in employees)
            {
                DatabaseObjectButton employeeButton = Instantiate(databaseObjectButtonPrefab, transform.position, Quaternion.identity) as DatabaseObjectButton;
                employeeButton.setup(this, employee);
                employeeButton.transform.SetParent(employeesParent.transform, true);
            }
        }
    }
Example #6
0
    protected override void setAttributes()
    {
        // set up department label
        label.text = division.getLabel();

        // set up department button
        if (division.getDepartment() != null)
        {
            departmentButton.setup(this, division.getDepartment());
        }
        // set up roles
        if (division.getRoles() != null)
        {
            List <Role> roles = division.getRoles();
            foreach (Role role in roles)
            {
                DatabaseObjectButton roleButton = Instantiate(databaseObjectButtonPrefab, transform.position, Quaternion.identity) as DatabaseObjectButton;
                roleButton.setup(this, role);
                roleButton.transform.SetParent(rolesParent.transform, true);
            }
        }
    }