Exemplo n.º 1
0
        public ActionResult GetEmployee(int id)
        {
            IEmplyeeServices es  = new EmplyeeServicesClient();
            Employee         emp = es.Get(id);

            return(View(emp));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets all the Employees from the database
        /// </summary>
        /// <returns> A list of the Employees </returns>
        public List <MAPMAClient.Model.Employee> GetAll()
        {
            IEmplyeeServices Service = new EmplyeeServicesClient();

            var employees = Service.GetAll();

            return(GetClientsideEmployees(employees));
        }
Exemplo n.º 3
0
        //IemplyeeServices skal have ændret Navn til IEmployeeServices
        public Employee GetEmployee(int id)
        {
            IEmplyeeServices Empserv = new EmplyeeServicesClient();

            try {
                return(Empserv.Get(id));
            }
            catch (NullReferenceException NE) {
                Console.WriteLine(NE);
                Console.ReadLine();
                return(null);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Search the database for one Employee, through the WCF
        /// </summary>
        /// <param name="id"></param>
        /// <returns>One Employee (Emp)</returns>
        public MAPMAClient.Model.Employee Get(int id)
        {
            IEmplyeeServices Service = new EmplyeeServicesClient();

            try {
                var Employee = Service.Get(id);

                MAPMAClient.Model.Employee Emp;

                Emp = GetEmployeeClientSide(Employee);

                return(Emp);
            }
            catch (NullReferenceException NE) {
                Console.WriteLine(NE);
                Console.ReadLine();
                return(null);
            }
        }