using System;namespace NET_system
{
public class Employee
{
public int EmployeeNo;
public string EmployeeName;
public string Department;
public string Designation;
public double EmployeeBasic;
public int DaysPresent;
public double HRA;
//public double PF;
public double Salary;
public void CreateNewEmployee(int employeeNo,string employeeName,string department,string designation)
{
this.EmployeeNo=employeeNo;
this.EmployeeName=employeeName;
this.Department=department;
this.Designation=designation; if(string.Compare(this.Designation,"Manager")==0)
{
this.EmployeeBasic=10000.00;
this.HRA=2000.00;
}
else if(string.Compare(this.Designation,"System Analyst")==0)
{
this.EmployeeBasic=8000.00;
this.HRA=1500.00;
}
else if(string.Compare(this.Designation,"Project Leader")==0)
{
this.EmployeeBasic=6000.00;
this.HRA=1000.00;
}
else if(string.Compare(this.Designation,"Programmer")==0)
{
this.EmployeeBasic=5000.00;
this.HRA=500.00;
}
}
public void ShowEmpInfo(int employeeNo)
{
Console.WriteLine("员工编号 {0}",this.EmployeeNo); Console.WriteLine("员工姓名 {1}",this.EmployeeName);
Console.WriteLine("所在部门 {2}",this.Department);
Console.WriteLine("职位     {3}",this.Designation);
} public void ShowEmpInfo(int employeeNo,int daysPresent)
{
this.Salary=((this.EmployeeBasic/30)*daysPresent)+((this.HRA/30)*daysPresent);
Console.WriteLine("员工编号 {0}",this.EmployeeNo);
Console.WriteLine("员工姓名 {1}",this.EmployeeName);
Console.WriteLine("基本工资 {2}",this.EmployeeBasic);
Console.WriteLine("奖金     {3}",this.HRA);
Console.WriteLine("实发工资 {4}",this.Salary);
}



public Employee()
{
this.Department="Software";
} public Employee(int employeeNo,string employeeName,string department,string designation)
{
this.CreateNewEmployee(employeeNo,employeeName,department,designation);
}
} public class Run
{
public static void Main(string[] args)
{
Employee e=new Employee(1,"gaoxuekui","Service","Manager");
e.ShowEmpInfo(1);
e.ShowEmpInfo(1,20);
}
}}
运行后,出现system.formatException的异常,请各位指教撒!!