public async Task <ActionResult> GetSalary()
        {
            var DTOList = await _repository.GetSalary();

            if (DTOList == null)
            {
                return(NotFound());
            }
            return(Ok(DTOList));
        }
Ejemplo n.º 2
0
        public ViewResult Edit(int id)
        {
            Salary employee      = _empRepo.GetSalary(id);
            Salary employeeModel = new Salary
            {
                SalaryId   = employee.SalaryId,
                Amount     = employee.Amount,
                Department = employee.Department,
                Type       = employee.Type
            };

            return(View(employeeModel));
        }
        public IActionResult GetSalary(int SalaryId)
        {
            if (!_SalaryRepository.SalaryExsists(SalaryId))
            {
                return(NotFound("Salary Id Not found"));
            }
            var salary = _SalaryRepository.GetSalary(SalaryId);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            return(Ok(salary));
        }
Ejemplo n.º 4
0
        public async Task <IWarriorSalary> GetWarriorWithSalary(string id)
        {
            var ninja = await warriorRepo.GetWarrior(id);

            var salary = await salaryRepo.GetSalary(id);

            return(new WarriorSalary()
            {
                Name = ninja.Name,
                WarriorId = ninja.WarriorId,
                Rank = ninja.Rank,
                SalaryRate = salary.SalaryRate
            });
        }
Ejemplo n.º 5
0
        public string GetSalary(BasicParamType param, int month, int year, long staffId, out string outTotalJson, out int totalRecord)
        {
            var response = _salaryRepository.GetSalary(param, month, year, staffId, out outTotalJson, out totalRecord);

            return(JsonConvert.SerializeObject(response));
        }
Ejemplo n.º 6
0
 private async Task <Salary> GetSalaryIdInternal(string id)
 {
     return(await _salRepository.GetSalary(id) ?? new Salary());
 }
        public async Task <JsonResult> Delete(int item)
        {
            await _salaryRepository.DeleteSalary(await _salaryRepository.GetSalary(item));

            return(Json(Ok()));
        }