1262 lines
42 KiB
C#
1262 lines
42 KiB
C#
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using AutoMapper;
|
|||
|
using HRM.BO;
|
|||
|
using HRM.BO.Basic;
|
|||
|
using HRM.DA;
|
|||
|
using Microsoft.AspNetCore.Authorization;
|
|||
|
using Microsoft.AspNetCore.Http;
|
|||
|
using Ease.Core.DataAccess;
|
|||
|
using System.Data;
|
|||
|
|
|||
|
namespace HRM.UI.Controllers.Basic
|
|||
|
{
|
|||
|
[ApiController]
|
|||
|
[Route("api/ERBasic")]
|
|||
|
[Authorize]
|
|||
|
public class ErBasicController : ControllerBase
|
|||
|
{
|
|||
|
public ErBasicController(IAllowanceDeductionService allowanceDeductionService,
|
|||
|
IBonusService bonusService,
|
|||
|
ICategoryService categoryService,
|
|||
|
IDepartmentService departmentService,
|
|||
|
IDesignationService designationService,
|
|||
|
IGradeService gradeService,
|
|||
|
IGradeSegmentService gradeSegmentService,
|
|||
|
ILocationService locationService,
|
|||
|
IEmployeeOverTimeService employeeOverTimeService,
|
|||
|
ITermService termService,
|
|||
|
IOccupationService occupationService,
|
|||
|
IEducationLevelService educationLevelService,
|
|||
|
ITrainingTypeService trainingTypeService,
|
|||
|
IEducationTypeService educationTypeService,
|
|||
|
INominationPurposeService nominationPurposeService,
|
|||
|
IBankService bankService,
|
|||
|
IBranchService brachService,
|
|||
|
ICostcenterService icostcenterService,
|
|||
|
ILoanService iLoanService,
|
|||
|
IReligionService religionService,
|
|||
|
IProcessItemService processItemService,
|
|||
|
ISalaryComponent salarycoponenet,
|
|||
|
IHREmployeeService hrEmployeeService,
|
|||
|
ICountryService countryService,
|
|||
|
INatureOfTrainingService natureOfTrainingService,
|
|||
|
IInstitutionService institutionService,
|
|||
|
IRelationService relationService,
|
|||
|
IDistrictService districtService,
|
|||
|
IThanaService thanaService,
|
|||
|
IResultTypeService resultTypeService,
|
|||
|
IDisciplineService disciplineService,
|
|||
|
IJobDefinitionService jobDefinitionService,
|
|||
|
INationalityService nationalityService,
|
|||
|
ITrainingService trainingService,
|
|||
|
IReminderService reminderService)
|
|||
|
|
|||
|
{
|
|||
|
this._allowanceDeductionService = allowanceDeductionService;
|
|||
|
this._bonusService = bonusService;
|
|||
|
this._categoryService = categoryService;
|
|||
|
this._departmentService = departmentService;
|
|||
|
this._designationService = designationService;
|
|||
|
this._gradeService = gradeService;
|
|||
|
this._gradeSegmentService = gradeSegmentService;
|
|||
|
this._locationService = locationService;
|
|||
|
this._employeeOverTimeService = employeeOverTimeService;
|
|||
|
this._tempService = termService;
|
|||
|
this._occupationService = occupationService;
|
|||
|
this._educationLevelService = educationLevelService;
|
|||
|
this._trainingTypeService = trainingTypeService;
|
|||
|
this._educationTypeService = educationTypeService;
|
|||
|
this._nominationPurposeService = nominationPurposeService;
|
|||
|
|
|||
|
this._bankService = bankService;
|
|||
|
this._branchService = brachService;
|
|||
|
this._costCenterService = icostcenterService;
|
|||
|
this._loanService = iLoanService;
|
|||
|
this._processItemService = processItemService;
|
|||
|
|
|||
|
this._salaryComponent = salarycoponenet;
|
|||
|
this._hrEmployeeService = hrEmployeeService;
|
|||
|
this._countryService = countryService;
|
|||
|
this._natureOfTrainingService = natureOfTrainingService;
|
|||
|
this._institutionService = institutionService;
|
|||
|
this._relationService = relationService;
|
|||
|
this._districtService = districtService;
|
|||
|
this._thanaService = thanaService;
|
|||
|
this._resultTypeService = resultTypeService;
|
|||
|
this._disciplineService = disciplineService;
|
|||
|
this._religionService = religionService;
|
|||
|
this._jobDefinitionService = jobDefinitionService;
|
|||
|
_nationalityService = nationalityService;
|
|||
|
_reminderService = reminderService;
|
|||
|
_trainingService = trainingService;
|
|||
|
}
|
|||
|
|
|||
|
private readonly IAllowanceDeductionService _allowanceDeductionService;
|
|||
|
private readonly IBonusService _bonusService;
|
|||
|
private readonly ICategoryService _categoryService;
|
|||
|
private readonly IDepartmentService _departmentService;
|
|||
|
private readonly IDesignationService _designationService;
|
|||
|
private readonly IGradeService _gradeService;
|
|||
|
private readonly IGradeSegmentService _gradeSegmentService;
|
|||
|
private readonly ILocationService _locationService;
|
|||
|
private readonly IEmployeeOverTimeService _employeeOverTimeService;
|
|||
|
private readonly ITermService _tempService;
|
|||
|
private readonly IOccupationService _occupationService;
|
|||
|
private readonly IEducationLevelService _educationLevelService;
|
|||
|
private readonly ITrainingTypeService _trainingTypeService;
|
|||
|
private readonly IEducationTypeService _educationTypeService;
|
|||
|
private readonly INominationPurposeService _nominationPurposeService;
|
|||
|
private readonly IBankService _bankService;
|
|||
|
private readonly IBranchService _branchService;
|
|||
|
private readonly ICostcenterService _costCenterService;
|
|||
|
private readonly ILoanService _loanService;
|
|||
|
private readonly IProcessItemService _processItemService;
|
|||
|
private readonly ISalaryComponent _salaryComponent;
|
|||
|
private readonly IHREmployeeService _hrEmployeeService;
|
|||
|
private readonly ICountryService _countryService;
|
|||
|
private readonly INatureOfTrainingService _natureOfTrainingService;
|
|||
|
private readonly IInstitutionService _institutionService;
|
|||
|
private readonly IRelationService _relationService;
|
|||
|
private readonly IDistrictService _districtService;
|
|||
|
private readonly IThanaService _thanaService;
|
|||
|
private readonly IResultTypeService _resultTypeService;
|
|||
|
private readonly IDisciplineService _disciplineService;
|
|||
|
private readonly IReligionService _religionService;
|
|||
|
private readonly IJobDefinitionService _jobDefinitionService;
|
|||
|
private readonly INationalityService _nationalityService;
|
|||
|
private readonly IReminderService _reminderService;
|
|||
|
private readonly ITrainingService _trainingService;
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getAllowance")]
|
|||
|
public ActionResult getAllowance()
|
|||
|
{
|
|||
|
List<AllowanceDeduction> items = new List<AllowanceDeduction>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
items = _allowanceDeductionService.GetAllowance(EnumStatus.Active, (int)currentUser.PayrollTypeID);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getDeduction")]
|
|||
|
public ActionResult getDeduction()
|
|||
|
{
|
|||
|
List<AllowanceDeduction> items = new List<AllowanceDeduction>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
items = _allowanceDeductionService.GetDeduction(EnumStatus.Active, (int)currentUser.PayrollTypeID);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("GetAllAllowanceDeduction/{allowOrDeduct}/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllAllowanceDeduction(EnumAllowOrDeduct allowOrDeduct, EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<AllowanceDeduction> items = new List<AllowanceDeduction>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _allowanceDeductionService.GetAllAllowance(payrollTypeId, allowOrDeduct, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getAllowanceByID/{id}")]
|
|||
|
public ActionResult GetAllowanceByID(int id)
|
|||
|
{
|
|||
|
AllowanceDeduction item = new AllowanceDeduction();
|
|||
|
try
|
|||
|
{
|
|||
|
item = _allowanceDeductionService.Get(id);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(item);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getAllowanceBy2Enum/{periodicity}/{allowOrDeduct}")]
|
|||
|
public ActionResult GetAllowanceBy2Enum(int periodicity, int allowOrDeduct)
|
|||
|
{
|
|||
|
List<AllowanceDeduction> items = new List<AllowanceDeduction>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _allowanceDeductionService.GetAllowance((EnumPeriodicity)periodicity, (EnumAllowOrDeduct)allowOrDeduct);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getAllowanceBy3Enum/{periodicity}/{entitleType}/{allowOrDeduct}")]
|
|||
|
public ActionResult GetAllowanceBy3Enum(int periodicity, int entitleType, int allowOrDeduct)
|
|||
|
{
|
|||
|
List<AllowanceDeduction> items = new List<AllowanceDeduction>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _allowanceDeductionService.GetAllowance((EnumPeriodicity)periodicity, (EnumEntitleType)entitleType, (EnumAllowOrDeduct)allowOrDeduct);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Bonus
|
|||
|
[HttpGet("getAllBonus/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllBonus(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Bonus> items = new List<Bonus>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _bonusService.GetAllBonus(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getBonusByID/{id}")]
|
|||
|
public ActionResult GetBonusByID(int id)
|
|||
|
{
|
|||
|
Bonus item = new Bonus();
|
|||
|
try
|
|||
|
{
|
|||
|
item = _bonusService.Get(id);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(item);
|
|||
|
}
|
|||
|
|
|||
|
// Category
|
|||
|
[HttpGet("getAllCategory/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllCategory(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Category> items = new List<Category>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _categoryService.GetAllCategory(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getCategoryByID/{id}")]
|
|||
|
public ActionResult getCategoryByID(int id)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
return Ok(this._categoryService.Get(id));
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("payrollTypeID/{id}")]
|
|||
|
public ActionResult Get(int id)
|
|||
|
{
|
|||
|
Category item = new Category();
|
|||
|
try
|
|||
|
{
|
|||
|
item = _categoryService.Get(id);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(item);
|
|||
|
}
|
|||
|
|
|||
|
// Department
|
|||
|
[HttpGet("getAllDepartment/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllDepartment(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Department> items = new List<Department>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _departmentService.GetAllDepartment(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getDepartmentByID/{id}")]
|
|||
|
public ActionResult getDepartmentByID(int id)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
return Ok(this._departmentService.Get(id));
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getAllBank/{status}/{code}/{name}")]
|
|||
|
public ActionResult getAllBank(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Bank> items = new List<Bank>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _bankService.Get(status,1); //payroll type
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getBranchesByBankID/{bankid}/{status}/{code}/{name}")]
|
|||
|
public ActionResult getBranchesByBankID(int bankid, EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Branch> items = new List<Branch>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _branchService.GetChild(bankid);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getAllBranches/{status}/{code}/{name}")]
|
|||
|
public ActionResult getAllBranches(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Branch> items = new List<Branch>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _branchService.Get(status,1); //payroll type
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getAllOccupation/{status}/{code}/{name}")]
|
|||
|
public ActionResult getAllOccupation(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Occupation> items = new List<Occupation>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _occupationService.Get(status);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getAllCostCenter/{status}/{code}/{name}")]
|
|||
|
public ActionResult getAllCostCenter(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Costcenter> items = new List<Costcenter>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _costCenterService.GetAllCostCenter(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getCostCenter/{id}")]
|
|||
|
public ActionResult getCostCenter(int id)
|
|||
|
{
|
|||
|
Costcenter item = new Costcenter();
|
|||
|
try
|
|||
|
{
|
|||
|
item = _costCenterService.Get(id);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(item);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getGradeByID/{id}")]
|
|||
|
public ActionResult getGradeByID(int id)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
return Ok(this._gradeService.Get(id));
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// Grade
|
|||
|
[HttpGet("getAllGrade/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllGrade(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Grade> items = new List<Grade>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _gradeService.GetAllGrade(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// GradeSegment
|
|||
|
[HttpGet("getAllGradeSegment/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllGradeSegment(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<GradeSegment> items = new List<GradeSegment>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _gradeSegmentService.GetAllGradeSegment(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Loan
|
|||
|
[HttpGet("GetAllLoan/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllLoan(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Loan> items = new List<Loan>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _loanService.Get(status);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Location
|
|||
|
[HttpGet("GetAllLocation/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllLocation(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Location> items = new List<Location>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _locationService.GetAllLocation(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getLocationByID/{id}")]
|
|||
|
public ActionResult getLocationByID(int id)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
return Ok(this._locationService.Get(id));
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// Term
|
|||
|
[HttpGet("getAllTerm/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllTerm(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Term> items = new List<Term>();
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _tempService.GetAllTerm(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Occupation
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("getAllOccupation")]
|
|||
|
public ActionResult GetAllOccupation()
|
|||
|
{
|
|||
|
List<Occupation> items = new List<Occupation>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _occupationService.Get();
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Training Type
|
|||
|
[HttpGet("getAllTrainingType")]
|
|||
|
public ActionResult GetAllTrainingType()
|
|||
|
{
|
|||
|
List<TrainingType> items = new List<TrainingType>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _trainingTypeService.Get();
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Education Type
|
|||
|
[HttpGet("getAllEducationType")]
|
|||
|
public ActionResult GetAllEducationType()
|
|||
|
{
|
|||
|
List<EducationType> items = new List<EducationType>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _educationTypeService.Get();
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Nomination Purpose
|
|||
|
[HttpGet("getAllNominationPurpose")]
|
|||
|
public ActionResult GetAllNominationPurpose()
|
|||
|
{
|
|||
|
List<NominationPurpose> items = new List<NominationPurpose>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _nominationPurposeService.Get();
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// ProcessItem
|
|||
|
[HttpGet("getForTHeadGroup")]
|
|||
|
public ActionResult GetForTHeadGroup()
|
|||
|
{
|
|||
|
List<ProcessItem> items = new List<ProcessItem>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _processItemService.GetForTHeadGroup();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getSalaryCoponentBenefits")]
|
|||
|
public ActionResult getSalaryCoponentBenefits()
|
|||
|
{
|
|||
|
List<SalaryComponent> items = new List<SalaryComponent>();
|
|||
|
CurrentUser ouser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
items = this._salaryComponent.Benefits((int) ouser.PayrollTypeID);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[HttpGet("getSalaryCoponent")]
|
|||
|
public ActionResult getSalaryCoponent()
|
|||
|
{
|
|||
|
List<SalaryComponent> items = new List<SalaryComponent>();
|
|||
|
CurrentUser ouser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
try
|
|||
|
{
|
|||
|
items = this._salaryComponent.Components((int) ouser.PayrollTypeID);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// EmpRelation
|
|||
|
[HttpGet("getEmpRelation/{id}")]
|
|||
|
public ActionResult GetEmpRelation(int id)
|
|||
|
{
|
|||
|
List<EmpRelation> items = new List<EmpRelation>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _hrEmployeeService.GetEmpRelations(id);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getAllEmpRelations")]
|
|||
|
public ActionResult GetAllEmpRelations()
|
|||
|
{
|
|||
|
List<EmpRelation> items = new List<EmpRelation>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _hrEmployeeService.GetAllEmpRelations();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Relation
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("getAllRelations")]
|
|||
|
public ActionResult GetAllRelations()
|
|||
|
{
|
|||
|
List<Relation> items = new List<Relation>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _relationService.Get();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// EmpRelative
|
|||
|
[HttpGet("getEmpRelatives/{id}")]
|
|||
|
public ActionResult GetEmpRelatives(int id)
|
|||
|
{
|
|||
|
List<EmpRelative> items = new List<EmpRelative>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _hrEmployeeService.GetEmpRelatives(id);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// Designation
|
|||
|
[HttpGet("getDesignationByID/{id}")]
|
|||
|
public ActionResult getDesignationByID(int id)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
return Ok(this._designationService.Get(id));
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getAllDesignation/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllDesignation(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
|||
|
List<Designation> items = new List<Designation>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _designationService.GetAllDesignation(payrollTypeId, status, code, name);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Country
|
|||
|
[HttpGet("getAllCountries")]
|
|||
|
public ActionResult GetAllCountries()
|
|||
|
{
|
|||
|
List<Country> items = new List<Country>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _countryService.Get();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Nature of Training
|
|||
|
[HttpGet("getAllNatureOfTrainings")]
|
|||
|
public ActionResult GetAllNatureOfTrainings()
|
|||
|
{
|
|||
|
List<NatureOfTraining> items = new List<NatureOfTraining>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _natureOfTrainingService.Get();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// institution
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("getAllInstitutions")]
|
|||
|
public ActionResult GetAllInstitutions()
|
|||
|
{
|
|||
|
List<Institution> items = new List<Institution>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _institutionService.Get();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// District
|
|||
|
[HttpGet("getAllDistricts")]
|
|||
|
public ActionResult GetAllDistricts()
|
|||
|
{
|
|||
|
List<District> items = new List<District>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _districtService.Get();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getDistrictById/{id}")]
|
|||
|
public ActionResult GetDistrictById(int id)
|
|||
|
{
|
|||
|
District item = new District();
|
|||
|
try
|
|||
|
{
|
|||
|
item = _districtService.Get(id);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(item);
|
|||
|
}
|
|||
|
|
|||
|
// Thana
|
|||
|
[HttpGet("getAllThanas/{id}")]
|
|||
|
public ActionResult GetAllThanas(int id)
|
|||
|
{
|
|||
|
List<Thana> items = new List<Thana>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _thanaService.GetByDistID(id);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getThanaById/{id}")]
|
|||
|
public ActionResult GetThanaById(int id)
|
|||
|
{
|
|||
|
Thana item = new Thana();
|
|||
|
try
|
|||
|
{
|
|||
|
item = _thanaService.Get(id);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(item);
|
|||
|
}
|
|||
|
|
|||
|
// Result type
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("getAllResultTypesByStatus/{status}")]
|
|||
|
public ActionResult GetAllResultTypesByStatus(EnumStatus status)
|
|||
|
{
|
|||
|
List<ResultType> items = new List<ResultType>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _resultTypeService.Get(status);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Disciple
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("getAllDiscipline")]
|
|||
|
public ActionResult GetAllDiscipline()
|
|||
|
{
|
|||
|
List<Discipline> items = new List<Discipline>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _disciplineService.Get();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
// Religion
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("getAllReligion")]
|
|||
|
public ActionResult GetAllReligion()
|
|||
|
{
|
|||
|
List<Religion> items = new List<Religion>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _religionService.Get();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Job Definition
|
|||
|
[HttpPost]
|
|||
|
[Route("saveJobDefinition")]
|
|||
|
public ActionResult SaveJobDefinition(JobDefinition item)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
var isNew = item.ID <= 0;
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
if (isNew)
|
|||
|
{
|
|||
|
item.CreatedBy = currentUser.UserID;
|
|||
|
item.CreatedDate = DateTime.Today;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.ModifiedBy = currentUser.UserID;
|
|||
|
item.ModifiedDate = DateTime.Today;
|
|||
|
}
|
|||
|
|
|||
|
_jobDefinitionService.Save(item);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok();
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getAllJobDefinitions")]
|
|||
|
public ActionResult GetAllJobDefinitions()
|
|||
|
{
|
|||
|
List<JobDefinition> items = new List<JobDefinition>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _jobDefinitionService.GetAll();
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getJobDefinition/{id}")]
|
|||
|
public ActionResult GetJobDefinition(int id)
|
|||
|
{
|
|||
|
JobDefinition item = null;
|
|||
|
try
|
|||
|
{
|
|||
|
item = _jobDefinitionService.GetByID(id);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(item);
|
|||
|
}
|
|||
|
|
|||
|
[HttpPost]
|
|||
|
[Route("deleteJobDefinition")]
|
|||
|
public ActionResult DeleteJobDefinition(JobDefinition item)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
_jobDefinitionService.DeleteJobDefinition(item.ID);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok();
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("getJobDefinitionForApprovedData/{id}")]
|
|||
|
public ActionResult GetJobDefinitionForApprovedData(int id)
|
|||
|
{
|
|||
|
JobDefinition item = null;
|
|||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|||
|
List<Grade> grades = new GradeService().Get(EnumStatus.Regardless, (int) currentUser.PayrollTypeID);
|
|||
|
List<Designation> designations =
|
|||
|
new DesignationService().Get(EnumStatus.Regardless, (int) currentUser.PayrollTypeID);
|
|||
|
List<Department> departments =
|
|||
|
new DepartmentService().Get(EnumStatus.Regardless, (int) currentUser.PayrollTypeID);
|
|||
|
try
|
|||
|
{
|
|||
|
item = _jobDefinitionService.GetJobDefinitionById(id);
|
|||
|
if (item != null)
|
|||
|
{
|
|||
|
var grd = grades.FirstOrDefault(d => d.ID == item.GradeId);
|
|||
|
if (grd != null) item.GradeName = grd.Name;
|
|||
|
|
|||
|
var designation = designations.FirstOrDefault(d => d.ID == item.DesignationId);
|
|||
|
if (designation != null) item.DesignationName = designation.Name;
|
|||
|
var department = departments.FirstOrDefault(d => d.ID == item.DepartmentId);
|
|||
|
if (department != null) item.DepartmentName = department.Name;
|
|||
|
if (item.RevisionDate != null)
|
|||
|
{
|
|||
|
item.RevisionDateString = item.RevisionDate.ToString("dd/MM/yyyy");
|
|||
|
}
|
|||
|
|
|||
|
if (item.JdEducationList != null && item.JdEducationList.Count > 0)
|
|||
|
{
|
|||
|
item.EducationListName = string.Join(",",
|
|||
|
item.JdEducationList?.Select(x => x.JdEducationName)?.ToList());
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(item);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("GetByLevelIDs/{ids}")]
|
|||
|
public ActionResult GetByLevelIDs(string ids)
|
|||
|
{
|
|||
|
//JobDefinition item = null;
|
|||
|
List<EducationLevel> items = new List<EducationLevel>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _educationLevelService.GetByLevelIDs(ids);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("GetByIDs/{ids}")]
|
|||
|
public ActionResult GetByIDs(string ids)
|
|||
|
{
|
|||
|
//JobDefinition item = null;
|
|||
|
List<Discipline> items = new List<Discipline>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _disciplineService.GetByIDs(ids);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
// Nationality
|
|||
|
[HttpGet("getAllNationality")]
|
|||
|
public ActionResult GetAllNationality()
|
|||
|
{
|
|||
|
List<Nationality> items = new List<Nationality>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _nationalityService.Get(EnumStatus.Active);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("getAllEducationLevel/{status}")]
|
|||
|
public ActionResult getAllEducationLevel(EnumStatus status)
|
|||
|
{
|
|||
|
List<EducationLevel> items = new List<EducationLevel>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = _educationLevelService.Get(status);
|
|||
|
List<EducationType> types = new List<EducationType>();
|
|||
|
types = _educationTypeService.Get();
|
|||
|
foreach (var item in items)
|
|||
|
{
|
|||
|
item.EducationType = _educationTypeService.Get(item.EducationTypeID);
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("GetAllTrainingType/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllTrainingType(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<TrainingType> items = new List<TrainingType>();
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
items = this._trainingTypeService.Get(status);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("GetAllInstitues/{status}/{code}/{name}")]
|
|||
|
public ActionResult GetAllInstitues(EnumStatus status, string code, string name)
|
|||
|
{
|
|||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
|||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
|||
|
List<Institution> items = new List<Institution>();
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
items = this._institutionService.Get();
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("GetTrainingybyTypeID/{traininTypeID}")]
|
|||
|
public ActionResult GetTrainingybyTypeID(int traininTypeID)
|
|||
|
{
|
|||
|
List<Training> items = new List<Training>();
|
|||
|
try
|
|||
|
{
|
|||
|
items = this._trainingService.GetbyTypeID(traininTypeID);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
|||
|
}
|
|||
|
|
|||
|
return Ok(items);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|