Exemplo n.º 1
0
 public void UpdateEmployee(Employee newEmp)
 {
     EmployeeData.Instance.Update(newEmp);
 }
Exemplo n.º 2
0
        public void Update(Employee updEmployee)
        {
            var existing = _empList.Find(p => p.EmpId == updEmployee.EmpId);

            if (existing == null)
                throw new KeyNotFoundException("Specified Employee cannot be found");

            existing.Fname = updEmployee.Fname;
            existing.Lname = updEmployee.Lname;
            existing.Age = updEmployee.Age;
        }
Exemplo n.º 3
0
 public void AddEmployee(Employee newEmp)
 {
     EmployeeData.Instance.Add(newEmp);
 }
Exemplo n.º 4
0
 public void Add(Employee newEmployee)
 {
     _empList.Add(new Employee
     {
         EmpId = newEmployee.EmpId,
         Fname = newEmployee.Fname,
         Lname = newEmployee.Lname,
         Age = newEmployee.Age,
         JoinDate = DateTime.Now,
         Designation = newEmployee.Designation,
         Salary = newEmployee.Salary
     });
 }