-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmployeeCollection.cs
43 lines (37 loc) · 1.11 KB
/
EmployeeCollection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EmpCollection
{
class EmployeeCollection
{
List<Employee> LstEmp = new List<Employee>();
public void AddEmp()
{
Employee e = new Employee();
Console.WriteLine("Enter ID : ");
e.Eid = int.Parse(Console.ReadLine());
Console.WriteLine("Enter Name : ");
e.Ename = Console.ReadLine();
Console.WriteLine("Enter Designation : ");
e.Designation = Console.ReadLine();
Console.WriteLine("Enter Salary");
e.Salary = double.Parse(Console.ReadLine());
LstEmp.Add(e);
}
public void show()
{
foreach(Employee e in LstEmp)
{
Console.WriteLine("{0},{1},{2},{3}", e.Eid, e.Ename, e.Designation, e.Salary);
}
}
public void RemoveEmp(int Index)
{
LstEmp.RemoveAt(Index);
show();
}
}
}