-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
198 changed files
with
95,821 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"dotnet-ef": { | ||
"version": "8.0.1", | ||
"commands": [ | ||
"dotnet-ef" | ||
] | ||
} | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<InvariantGlobalization>false</InvariantGlobalization> | ||
<UserSecretsId>061a22dd-f9a4-46cb-aec9-d2cde7df618f</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath> | ||
<Configurations>Debug;Release</Configurations> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> | ||
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AccSol.EF\AccSol.EF.csproj" /> | ||
<ProjectReference Include="..\AccSol.Reports.ExcelFiles\AccSol.Reports.ExcelFiles.csproj" /> | ||
<ProjectReference Include="..\AccSol.Repositories\AccSol.Repositories.csproj" /> | ||
<ProjectReference Include="..\AccSol.ViewModels\AccSol.ViewModels.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EditorConfigFiles Remove="C:\repo\AccSol\AccSol.API\.editorconfig" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="C:\repo\AccSol\AccSol.API\.editorconfig" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@AccSol.API_HostAddress = http://localhost:5049 | ||
|
||
GET {{AccSol.API_HostAddress}}/weatherforecast/ | ||
Accept: application/json | ||
|
||
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using AccSol.Models; | ||
using AccSol.Repositories; | ||
|
||
namespace AccSol.API.Controllers | ||
{ | ||
[ApiController] | ||
[Route("[controller]")] | ||
public class ClientsController : ControllerBase | ||
{ | ||
private readonly IRepositoryManager _repository; | ||
public ClientsController(IRepositoryManager repository) | ||
{ | ||
_repository = repository; | ||
} | ||
|
||
|
||
[HttpGet("GetAll")] | ||
public ActionResult<IEnumerable<Client>> GetAll() | ||
{ | ||
try | ||
{ | ||
var list = _repository.Client.GetAll(trackChanges: false); | ||
|
||
return Ok(list); | ||
} catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
|
||
} | ||
|
||
// GET: Clients/GetById/5 | ||
[HttpPost("Get")] | ||
public ActionResult<Client?> Get([FromBody] int? id) | ||
{ | ||
try | ||
{ | ||
Client? client = null; | ||
if (id != null) | ||
{ | ||
client = _repository.Client.Get(id, trackChanges: false); | ||
|
||
} | ||
|
||
return Ok(client); | ||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
[HttpPost("Save")] | ||
public IActionResult Save([FromBody] Client? client) | ||
{ | ||
try | ||
{ | ||
if (client != null) | ||
{ | ||
_repository.Client.SaveClient(client); | ||
|
||
} | ||
|
||
return Ok(client); | ||
|
||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
|
||
[HttpPost("Delete")] | ||
public IActionResult Delete([FromBody] int? id) | ||
{ | ||
try | ||
{ | ||
if (id != null) | ||
{ | ||
var client = _repository.Client.Get(id, false); | ||
if (client != null) | ||
{ | ||
_repository.Client.DeleteClient(client); | ||
} | ||
} | ||
|
||
return Ok(id); | ||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using AccSol.Models; | ||
using AccSol.Repositories; | ||
|
||
namespace AccSol.API.Controllers | ||
{ | ||
[ApiController] | ||
[Route("[controller]")] | ||
public class CoasController : ControllerBase | ||
{ | ||
private readonly IRepositoryManager _repository; | ||
public CoasController(IRepositoryManager repository) | ||
{ | ||
_repository = repository; | ||
} | ||
|
||
|
||
[HttpGet("GetAll")] | ||
public ActionResult<IEnumerable<Coa>> GetAll() | ||
{ | ||
var list = _repository.Coa.GetAll(trackChanges: false); | ||
|
||
return Ok(list); | ||
} | ||
|
||
// GET: Coas/GetById/5 | ||
[HttpPost("Get")] | ||
public ActionResult<Coa?> Get([FromBody] int? id) | ||
{ | ||
try | ||
{ | ||
Coa? coa = null; | ||
if (id != null) | ||
{ | ||
coa = _repository.Coa.Get(id, trackChanges: false); | ||
|
||
} | ||
|
||
return Ok(coa); | ||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
[HttpPost("Save")] | ||
public IActionResult Save([FromBody] Coa? coa) | ||
{ | ||
try | ||
{ | ||
if (coa != null) | ||
{ | ||
_repository.Coa.SaveCoa(coa); | ||
|
||
} | ||
|
||
return Ok(coa); | ||
|
||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
|
||
[HttpPost("Delete")] | ||
public IActionResult Delete([FromBody] int? id) | ||
{ | ||
try | ||
{ | ||
if (id != null) | ||
{ | ||
var coa = _repository.Coa.Get(id, false); | ||
if (coa != null) | ||
{ | ||
_repository.Coa.DeleteCoa(coa); | ||
} | ||
} | ||
|
||
return Ok(id); | ||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using AccSol.Models; | ||
using AccSol.Repositories; | ||
|
||
namespace AccSol.API.Controllers | ||
{ | ||
[ApiController] | ||
[Route("[controller]")] | ||
public class DepartmentsController : ControllerBase | ||
{ | ||
private readonly IRepositoryManager _repository; | ||
public DepartmentsController(IRepositoryManager repository) | ||
{ | ||
_repository = repository; | ||
} | ||
|
||
|
||
[HttpGet("GetAll")] | ||
public ActionResult<IEnumerable<Department>> GetAll() | ||
{ | ||
var list = _repository.Department.GetAll(trackChanges: false); | ||
|
||
return Ok(list); | ||
} | ||
|
||
// GET: Departments/GetById/5 | ||
[HttpGet("Get/{id}")] | ||
public ActionResult<Department?> Get(int id) | ||
{ | ||
try | ||
{ | ||
Department? department = _repository.Department.Get(id, trackChanges: false); | ||
return Ok(department); | ||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
[HttpPost("Save")] | ||
public IActionResult Save([FromBody] Department? department) | ||
{ | ||
try | ||
{ | ||
if (department != null) | ||
{ | ||
_repository.Department.SaveDepartment(department); | ||
} | ||
|
||
return Ok(department); | ||
|
||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
|
||
[HttpPost("Delete")] | ||
public IActionResult Delete([FromBody] int? id) | ||
{ | ||
try | ||
{ | ||
if (id != null) | ||
{ | ||
var department = _repository.Department.Get(id, false); | ||
if (department != null) | ||
{ | ||
_repository.Department.DeleteDepartment(department); | ||
} | ||
} | ||
|
||
return Ok(id); | ||
} | ||
catch (Exception ex) | ||
{ | ||
return StatusCode(500, ex.Message); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.