/*
 * 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 object;

/**
 *
 * @author Administrator
 */
public class UserApp {

    public static final boolean USER_ACTIVE = true;
    public static final boolean USER_NOT_ACTIVE = false;

    public static final int USER_ROLE_ADMIN = 1;
    public static final int USER_ROLE_STAFF = 2;
    public static final int USER_NO_ROLE = 0;

    private String username;
    private String password;
    private String name;
    private String birthday;
    private String phone;
    private String andress;
    private boolean status;
    private int roles;

    public UserApp() {
    }

    public UserApp(String username, String password, String name, String birthday, String phone, String andress, boolean status, int roles) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.birthday = birthday;
        this.phone = phone;
        this.andress = andress;
        this.status = status;
        this.roles = roles;
    }


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAndress() {
        return andress;
    }

    public void setAndress(String andress) {
        this.andress = andress;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public int getRoles() {
        return roles;
    }

    public void setRoles(int roles) {
        this.roles = roles;
    }

    @Override
    public String toString() {
        return "UserApp{" + "username=" + username + ", password=" + password + ", name=" + name + ", birthday=" + birthday + ", phone=" + phone + ", andress=" + andress + ", status=" + status + ", roles=" + roles + '}';
    }

    public String[] toArray() {
        return new String[]{username, password, name, birthday, phone, andress, status ? "active" : "not active", roles == 1 ? "quản lý" : "nhân viên"};
    }
}
