public bool SaveEmployee(Api.Models.Employee employee)
        {
            var result = new Data.Models.Employee();

            result.EmployeeName = employee.Name;
            result.EmployeeAge  = employee.Age;

            return(_repository.SaveEmployee(result));
        }
Example #2
0
        public JsonResult UpdateSalary(string model)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            Employee             employee   = serializer.Deserialize <Employee>(model);
            var entity = _context.Employees.Find(employee.ID);
            var result = entity.Salary = employee.Salary;

            _context.SaveChanges();
            return(Json(new
            {
                status = true
            }));
        }