package topica.moduel;

import java.io.Serializable;
import java.util.Scanner;

public class GiangVien extends NhanVien implements Serializable {


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String chucvu;
	
	private int ngaycong,phucap;
	static Scanner sc = new Scanner(System.in);
	
	public GiangVien() {
		// TODO Auto-generated constructor stub
	}

	public GiangVien(String chucvu, int ngaycong, Scanner sc) {
		super();
		this.chucvu = chucvu;
		this.ngaycong = ngaycong;
		this.sc = sc;
	}

	public String getChucvu() {
		return chucvu;
	}

	public void setChucvu(String chucvu) {
		this.chucvu = chucvu;
	}

	public int getNgaycong() {
		return ngaycong;
	}

	public void setNgaycong(int ngaycong) {
		this.ngaycong = ngaycong;
	}

	public Scanner getSc() {
		return sc;
	}

	public void setSc(Scanner sc) {
		this.sc = sc;
	}
	
	
	public void menu()
	{
		System.out.println("!---------------!");
		System.out.println("!1.Trưởng phòng-!");
		System.out.println("!2.Phó phòng----!");
		System.out.println("!3.Nhân viên----!");
		System.out.println("!---------------!");
	}
	
	
	public void inputInformation() {
		// TODO Auto-generated method stub
		
		menu();
		boolean flag = true;
		do {
			
			int choice;
			do {
				try {
					System.out.print("Nhập chức vụ : ");
					choice = Integer.parseInt(sc.nextLine());
					break;
					
				} catch (Exception e) {
					// TODO: handle exception
					e.printStackTrace();
				}
				
				
			} while (true);
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			switch (choice) {
			case 1:
				{
					this.chucvu ="Trưởng phòng";
					this.phucap = 2000;
				    flag = false;
					break;
				}
			
				
			case 2:
			{
				
				this.chucvu ="Phó phòng";
				this.phucap = 1000;
				flag = false;
				break;
			}
			
			
			case 3:
			{
				
				this.chucvu ="Nhân viên";
				this.phucap = 500;
				flag = false;
				break;
			}
			
			

			default:
			{
				System.out.println("Nhập sai vui lòng nhập lại !");
				
			}
			}
			
			
		} while (flag);
		System.out.print("Nhập ngày công : ");
		this.ngaycong = Integer.parseInt(sc.nextLine());
		super.setLuong(0.6*730+this.phucap+this.ngaycong*200);
		
		
	}
	
	
	@Override
	public void inputID() throws ExceptionCharacter {
		// TODO Auto-generated method stub
		super.inputID();
	}
	
	@Override
	public void inputName() {
		// TODO Auto-generated method stub
		super.inputName();
	}
	
	@Override
	public void inputAge() throws ExceptionValue {
		// TODO Auto-generated method stub
		super.inputAge();
	}
	
	

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return super.toString()+"Cán bộ - chức vụ : "+this.chucvu+"||"+"Ngày công :"+this.ngaycong;
	}
	

}
