public async Task <ActionResult <List <EmployeeSalary> > > Get() { try { List <EmployeeSalary> response = await BO.GetSalary(); return(StatusCode(200, response)); } catch (Exception) { return(StatusCode(500, _configuration.GetSection("Mensajes").GetSection("Error").Value)); } }
public async Task <JsonResult> JsonListar(int Id) { if (Id > 0) { return(Json(await BO.GetSalary(Id))); } else if (Id == 0) { return(Json(await BO.GetSalary())); } else { return(Json("")); } }
public async Task <EmployeeResponseModel> GetEmployeeAsync(int id) { EmployeeResponseModel employeeModel = new EmployeeResponseModel(); IEnumerable <Employee> employees = await employeeService.GetEmployees(); Employee employee = employees.SingleOrDefault(s => s.Id == id); if (employee != null) { ISalary salary = salaryFactory.SelectEmployeeType(employee.ContractTypeName); employeeModel = new EmployeeResponseModel { Id = employee.Id, RoleId = employee.RoleId, RoleName = employee.RoleName, Name = employee.Name, RoleDescription = employee.RoleDescription, ContractTypeName = employee.ContractTypeName, Salary = salary.GetSalary(employee), AnualSalary = salary.GetAnualSalary(employee) }; } return(employeeModel); }
public int CompareTo(object obj) { if (obj == null) { return(1); } ISalary o = obj switch { Teacher teacher => teacher, Student student => student, _ => null }; return(GetSalary().CompareTo(o.GetSalary())); } }
public void Get_annual_salary_correct() { Task <EmployeeSalary> employee = BO.GetSalary(1); Assert.AreEqual(employee.Result.Salary, 8640000); }
public ViewResult Detail(int?id) { var sal = _salaryrepository.GetSalary(id ?? 1); return(View(sal)); }
private void buttonCalculateSalary_Click(object sender, EventArgs e) { modifyPerson = modifyPersonControl.Person; modifyPerson.GetSalary(); modifyPersonControl.Person = modifyPerson; }