BrightSide Workbench Full Report + Source Code
org.turro.contacts.hhrr.HumanResourcesVM Class Reference
Collaboration diagram for org.turro.contacts.hhrr.HumanResourcesVM:

Public Member Functions

void setBusiness (@BindingParam("business") Object business)
 
void save ()
 
boolean isEditable ()
 
IContact getBusiness ()
 
Set< BusinessRelationgetModel ()
 
List< IContactgetBusinessModel ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 38 of file HumanResourcesVM.java.

Member Function Documentation

◆ getBusiness()

IContact org.turro.contacts.hhrr.HumanResourcesVM.getBusiness ( )

Definition at line 66 of file HumanResourcesVM.java.

66  {
67  return business;
68  }

◆ getBusinessModel()

List<IContact> org.turro.contacts.hhrr.HumanResourcesVM.getBusinessModel ( )

Definition at line 79 of file HumanResourcesVM.java.

79  {
80  if(contact == null) {
81  contact = Authentication.getIContact();
82  }
83  if(contact.isAdmin()) {
84  ContactList list = new ContactList();
85  list.addAll(contact.getCenters());
86  list.addAll(contact.getCompanies());
87  list.sort((o1, o2) -> {
88  return o1.getName().compareTo(o2.getName());
89  });
90  return list;
91  } else {
92  return contact.getBusinessList();
93  }
94  }
List< IContact > getBusinessList()
Here is the call graph for this function:

◆ getModel()

Set<BusinessRelation> org.turro.contacts.hhrr.HumanResourcesVM.getModel ( )

Definition at line 70 of file HumanResourcesVM.java.

70  {
71  if(business != null && business.isValid()) {
72  model = new HumanResourcesSet(((Contact) business.getContact()).getWorkerRelations());
73  } else {
74  model = new HumanResourcesSet(Collections.EMPTY_SET);
75  }
76  return model;
77  }
Here is the call graph for this function:

◆ isEditable()

boolean org.turro.contacts.hhrr.HumanResourcesVM.isEditable ( )

Definition at line 62 of file HumanResourcesVM.java.

62  {
63  return editable;
64  }

◆ save()

void org.turro.contacts.hhrr.HumanResourcesVM.save ( )

Definition at line 56 of file HumanResourcesVM.java.

56  {
57  if(editable && model != null && !model.isEmpty()) {
58  new ContactsPU().saveCollection(model);
59  }
60  }
Here is the call graph for this function:

◆ setBusiness()

void org.turro.contacts.hhrr.HumanResourcesVM.setBusiness ( @BindingParam("business") Object  business)

Definition at line 46 of file HumanResourcesVM.java.

46  {
47  if(business instanceof IContact) {
48  this.business = (IContact) business;
49  model = null;
50  editable = contact.isHHRR((IContact) business) || contact.isAdmin();
51  }
52  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: