示例#1
0
        public EmployeeRegistrationResponse registerEmployee(Employee employeeRegd)

        {
            Console.WriteLine("In registerEmployee");
            EmployeeRegistrationResponse employeeReply = new EmployeeRegistrationResponse();

            EmployeeRegistration.getInstance().Add(employeeRegd);
            employeeReply.EmpName    = employeeRegd.EmpName;
            employeeReply.EmpID      = employeeRegd.EmpID;
            employeeReply.Department = employeeRegd.Department;
            return(employeeReply);
        }
示例#2
0
        public EmployeeRegistrationReply registerEmployee(Employee empregd)
        {
            Console.WriteLine("In registerEmployee");
            EmployeeRegistrationReply empregreply = new EmployeeRegistrationReply();

            EmployeeRegistration.getInstance().Add(empregd);
            empregreply.Name = empregd.Name;
            empregreply.Age  = empregd.Age;
            empregreply.ID   = empregd.EmployeeID;
            empregreply.registrationStatus = "Successful";
            return(empregreply);
        }
示例#3
0
        public Employee PostEmployee([FromBody] Employee value)
        {
            Employee emp = new Employee();

            Console.WriteLine("In employeeRegistration");
            Employee empObj = new Employee();

            EmployeeRegistration.getInstance().Add(value);
            empObj.ID   = value.ID;
            empObj.Name = value.Name;
            empObj.Age  = value.Age;
            return(empObj);
        }
示例#4
0
        public EmployeeRegistrationReply addEmployee(Employees empregd)
        {
            Console.WriteLine("In registerStudent");
            EmployeeRegistrationReply empregreply = new EmployeeRegistrationReply();

            EmployeeRegistration.getInstance().Add(empregd);
            empregreply.firstName          = empregd.firstName;
            empregreply.lastName           = empregd.lastName;
            empregreply.Email              = empregd.Email;
            empregreply.HireDate           = empregd.HireDate;
            empregreply.EmployeeID         = empregd.EmployeeID;
            empregreply.DepartmentName     = empregd.DepartmentName;
            empregreply.Salary             = empregd.Salary;
            empregreply.RegistrationStatus = "Successful";
            return(empregreply);
        }
示例#5
0
        public List <Employees> GetAllEmployee()
        {
            //if (EmployeeRegistration.getInstance().getAllEmployees() == null)
            //{
            //    return new List<Employees>
            //{
            //    new Employees
            //    {
            //        firstName = "Glenn",
            //        lastName = "Block",
            //        Email = "",
            //        HireDate = "03/04/2018",
            //        Salary = 8900,
            //        DepartmentName = "QA",
            //        EmployeeID = 777

            //    },
            //    new Employees
            //    {
            //        firstName = "Dan",
            //        lastName = "Roth",
            //        Email = "",
            //        HireDate = "03/02/2018",
            //        Salary = 89000,
            //        DepartmentName = "QA II",
            //        EmployeeID = 333
            //    }

            //};
            //}
            //else
            //{
            Console.WriteLine("Get method is called");
            return(EmployeeRegistration.getInstance().getAllEmployees());
            //}
        }
示例#6
0
 public String DeleteEmployeeRecord(int ID)
 {
     Console.WriteLine("In deleteStudentRecord");
     return(EmployeeRegistration.getInstance().Remove(ID));
 }
示例#7
0
 public string UpdateEmployee([FromBody] Employee value)
 {
     Console.WriteLine("In updateStudentRecord");
     return(EmployeeRegistration.getInstance().UpdateEmployee(value));
 }
示例#8
0
        public Employee GetByEmployeesID(int empID)
        {
            Employee employees_data = EmployeeRegistration.getInstance().GetbyID(empID);

            return(employees_data);
        }
示例#9
0
        //Employee[] employees = new Employee[]
        //{
        //   new Employee { ID = 1, Name = "Mark", Age = 30 },
        //   new Employee { ID = 2, Name = "Allan", Age = 35 },
        //   new Employee { ID = 3, Name = "Johny", Age = 21 }
        //};

        public List <Employee> GetAllEmployees()
        {
            var employees = EmployeeRegistration.getInstance().getAllEmployee();

            return(employees);
        }
 public String DeleteEmployee(int empID)
 {
     Console.WriteLine("In delete Employee record");
     return(EmployeeRegistration.getInstance().Remove(empID));
 }
示例#11
0
 public String PutEmployeeRecord(Employee emp)
 {
     Console.WriteLine("In updateEmployeeRecord");
     return(EmployeeRegistration.getInstance().UpdateEmployee(emp));
 }
示例#12
0
 public List <Employee> GetAllEmployee()
 {
     return(EmployeeRegistration.getInstance().getAllEmployee());
 }