Beispiel #1
0
        public ActionResult GetEmployeeId(int id)
        {
            var employee          = _employee.GetEmployeeById(id);
            var serializeEmployee = EmployeeMapper.SerializeEmployee(employee);

            return(PartialView(serializeEmployee));
        }
Beispiel #2
0
        public ActionResult Update(int id)
        {
            ViewBag.CompanyList = new SelectList(_company.GetCompanies(), "Id", "Name");
            var employee          = _employee.GetEmployeeById(id);
            var serializeEmployee = EmployeeMapper.SerializeEmployee(employee);

            return(PartialView(serializeEmployee));
        }
Beispiel #3
0
        public ActionResult Update(employeeViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var company          = _company.GetCompanyById(model.MCompany.Id);
            var serializeCompany = CompanyMapper.SerializeCompany(company);

            model.MCompany = serializeCompany;
            var serializeEmployee = EmployeeMapper.SerializeEmployee(model);
            var newEmployee       = _employee.EditEmployee(serializeEmployee);

            return(Ok(newEmployee));
        }