Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vs/StaffHelper/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
999 changes: 999 additions & 0 deletions .vs/StaffHelper/config/applicationhost.config

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion .vs/StaffHelper/project-colors.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@
"ProjectGuid": "e2fa64e5-0ece-4b27-ab71-cb4addbcac52",
"DisplayName": "StaffHelper.API",
"ColorIndex": 3
},
"a2fe74e1-b743-11d0-ae1a-00a0c90fffc3": {
"ProjectGuid": "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3",
"DisplayName": "Miscellaneous Files",
"ColorIndex": -1
},
"605c879f-7568-469a-9c44-a8c5423af163": {
"ProjectGuid": "605c879f-7568-469a-9c44-a8c5423af163",
"DisplayName": "StaffHelper.Service",
"ColorIndex": 4
}
},
"NextColorIndex": 4
"NextColorIndex": 5
}
Binary file added .vs/StaffHelper/v17/.futdcache.v1
Binary file not shown.
Binary file modified .vs/StaffHelper/v17/.suo
Binary file not shown.
124 changes: 124 additions & 0 deletions StaffHelper.API/Controllers/CompanyController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using StaffHelper.Model.Entities;
using StaffHelper.Model.ViewModels;
using StaffHelper.Service.Interfaces;
using System.Threading.Tasks;

namespace StaffHelper.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class CompanyController : ControllerBase
{
private readonly ICompanyService _companyService;

public CompanyController(ICompanyService companyService)
{
_companyService = companyService;
}
/// <summary>
/// "Create Company"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost("CreateCompany")]
public async Task<IActionResult> CreateCompany(CreateCompanyViewModel model)
{
var response = await _companyService.CreateCompany(model);
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "Get All"
/// </summary>
/// <returns></returns>
[HttpGet("GetAll")]
public async Task<IActionResult> GetAll()
{
var response = await _companyService.GetAll();
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "Get By RcNo"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpGet("GetByRcNo")]
public async Task<IActionResult> GetByRcNo(CreateCompanyViewModel model)
{
var response = await _companyService.GetByRcNo(model);
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);

}
/// <summary>
/// "Get By Name"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpGet("GetByName")]
public async Task<IActionResult> GetByName(CreateCompanyViewModel model)
{
var response = await _companyService.GetByName(model);
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "Get By Address"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpGet("GetByAddress")]
public async Task<IActionResult> GetByAddress(CreateCompanyViewModel model)
{
var response = await _companyService.GetByAddress(model);
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "Update Company"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPut("UpdateCompany")]
public async Task<IActionResult> UpdateCompany(UpdateCompanyViewModel model)
{
var response = await _companyService.UpdateCompany(model);
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "SoftDelete Company"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpDelete("SoftDeleteCompany")]
public async Task<IActionResult> SoftDeleteCompany(CreateCompanyViewModel model)
{
var response = await _companyService.SoftDeleteCompany(model);

return Ok(response);
}

}
}
92 changes: 92 additions & 0 deletions StaffHelper.API/Controllers/CompanyDesignationController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using StaffHelper.Model.ViewModels;
using StaffHelper.Service.Interfaces;
using System.Threading.Tasks;

namespace StaffHelper.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class CompanyDesignationController : ControllerBase
{
private readonly ICompanyDesignationService _companyDesignationService;

public CompanyDesignationController(ICompanyDesignationService companyDesignationService)
{
_companyDesignationService = companyDesignationService;
}
/// <summary>
/// "Create CompanyDesignation"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost("CreateCompanyDesignation")]
public async Task<IActionResult> CreateCompanyDesignation(CreateCompanyDesignationViewModel model)
{
var response = await _companyDesignationService.CreateCompanyDesignation(model);
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "Get All"
/// </summary>
/// <returns></returns>
[HttpGet("GetAll")]
public async Task<IActionResult> GetAll()
{
var response = await _companyDesignationService.GetAll();
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "Get By CompanyId"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpGet("GetByCompanyId")]
public async Task<IActionResult> GetByCompanyId(CreateCompanyDesignationViewModel model)
{
var response = await _companyDesignationService.GetByCompanyId(model);
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "Update CompanyDesignation"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPut("UpdateCompanyDesignation")]
public async Task<IActionResult> UpdateCompanyDesignation(UpdateCompanyDesignationViewModel model)
{
var response = await _companyDesignationService.UpdateCompanyDesignation(model);
if (response == null)
{
return BadRequest(response);
}
else return Ok(response);
}
/// <summary>
/// "SoftDelete CompanyDesignation"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpDelete("SoftDeleteCompanyDesignation")]
public async Task<IActionResult> SoftDeleteCompanyDesignation(CreateCompanyDesignationViewModel model)
{
var response = await _companyDesignationService.SoftDeleteCompanyDesignation(model);

return Ok(response);
}

}
}
111 changes: 111 additions & 0 deletions StaffHelper.API/Controllers/CompanyRoleController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using StaffHelper.Model.Entities;
using StaffHelper.Model.ViewModels;
using StaffHelper.Service.Interfaces;
using System.Threading.Tasks;

namespace StaffHelper.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class CompanyRoleController : ControllerBase
{
private readonly ICompanyRoleService _companyRoleService;

public CompanyRoleController(ICompanyRoleService companyRoleService)
{
_companyRoleService = companyRoleService;
}

/// <summary>
/// "Create CompanyRole"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost("CreateCompanyRole")]
public async Task<IActionResult> CreateCompanyRole(CreateCompanyRoleViewModel model)
{
var response = await _companyRoleService.CreateCompanyRole(model);
if (response == null)
{
return BadRequest(response);
}
return Ok(response);
}
/// <summary>
/// "Get All"
/// </summary>
/// <returns></returns>
[HttpGet("GetAll")]
public async Task<IActionResult> GetAll()
{
var response = await _companyRoleService.GetAll();
if (response == null)
{
return BadRequest(response);
}
return Ok(response);
}

/// <summary>
/// "Get By CompanyId"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpGet("GetByCompanyId")]
public async Task<IActionResult> GetByCompanyId(CreateCompanyRoleViewModel model)
{
var response = await _companyRoleService.GetByCompanyId(model);
if (response == null)
{
return BadRequest(response);
}
return Ok(response);
}

/// <summary>
/// "Get By RoleId"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpGet("GetByRoleId")]
public async Task<IActionResult> GetByRoleId(CreateCompanyRoleViewModel model)
{
var response = await _companyRoleService.GetByRoleId(model);
if (response == null)
{
return BadRequest(response);
}
return Ok(response);
}
/// <summary>
/// "Update CompanyRole"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPut("UpdateCompanyRole")]
public async Task<IActionResult> UpdateCompanyRole(UpdateCompanyRoleViewModel model)
{
var response = await _companyRoleService.UpdateCompanyRole(model);
if (response == null)
{
return BadRequest(response);
}
return Ok(response);
}
/// <summary>
/// "SoftDelete ComapanyRole"
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpDelete("SoftDeleteCompanyRole")]
public async Task<IActionResult> SoftDeleteCompanyRole(CreateCompanyRoleViewModel model)
{
var response = await _companyRoleService.SoftDeleteCompanyRole(model);

return Ok(response);
}

}
}
Loading