/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package controller.person;

import controller.AbstractController;
import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import model.person.Person;
import model.person.enums.Call;

/**
 *
 * @author patri
 */
@Named
@RequestScoped
public class PersonEditController extends AbstractController{
    @Inject
    PersonController personController;
    
    private String email;
    private Call call;
    private String telefon;
    private String password;
    private String mobile;
    private String fax;
    private String firstname;
    private String lastname;
    private String title;

    public PersonEditController() {
    }
    
    @PostConstruct
    private void loadUserdata(){
        Person activePerson = personController.getActiveUser();
        
        email = activePerson.getEmail();
        call = activePerson.getCall();
        telefon = activePerson.getTelefon();
        password = "********";
        mobile = activePerson.getMobile();
        fax = activePerson.getFax();
        firstname = activePerson.getFirstname();
        lastname = activePerson.getLastname();
        title = activePerson.getTitle();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Call getCall() {
        return call;
    }

    public void setCall(Call call) {
        this.call = call;
    }

    public String getTelefon() {
        return telefon;
    }

    public void setTelefon(String telefon) {
        this.telefon = telefon;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    
    
}
