96 lines
3.0 KiB
C#
96 lines
3.0 KiB
C#
using _0_Framework.Application;
|
|
using CompanyManagment.App.Contracts.ClassificationScheme;
|
|
using CompanyManagment.App.Contracts.Employee;
|
|
using CompanyManagment.App.Contracts.PaymentInstrument;
|
|
using CompanyManagment.Application;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using ServiceHost.BaseControllers;
|
|
|
|
namespace ServiceHost.Areas.Admin.Controllers;
|
|
|
|
public class ClassificationSchemeController : AdminBaseController
|
|
{
|
|
private readonly IClassificationSchemeApplication _classificationSchemeApplication;
|
|
private readonly IAuthHelper _authHelper;
|
|
|
|
|
|
public ClassificationSchemeController(IClassificationSchemeApplication classificationSchemeApplication, IAuthHelper authHelper)
|
|
{
|
|
_classificationSchemeApplication = classificationSchemeApplication;
|
|
_authHelper = authHelper;
|
|
}
|
|
|
|
/// <summary>
|
|
/// لیست طرح
|
|
/// </summary>
|
|
/// <param name="workshopId"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public async Task<ActionResult<ClassificationSchemeListDto>> GetList(long workshopId)
|
|
{
|
|
var result =await _classificationSchemeApplication.GetClassificationSchemeList(workshopId);
|
|
return result;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// ایجاد طرح
|
|
/// </summary>
|
|
/// <param name="command"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Scheme")]
|
|
public async Task<ActionResult<OperationResult>> CreateScheme([FromBody] CreateClassificationSchemeDto command)
|
|
{
|
|
var result = await _classificationSchemeApplication.CreateClassificationScheme(command);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// دریافت اطلاعات طرح برای ویرایش
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("GetSchemeToEdit")]
|
|
public async Task<EditClassificationSchemeDto> GetSchemeToEdit(long id)
|
|
{
|
|
var result = await _classificationSchemeApplication.GetClassificationScheme(id);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// ویرایش طرح
|
|
/// </summary>
|
|
/// <param name="command"></param>
|
|
/// <returns></returns>
|
|
[HttpPut("Scheme")]
|
|
public async Task<ActionResult<OperationResult>> EditScheme([FromBody] EditClassificationSchemeDto command)
|
|
{
|
|
var result =await _classificationSchemeApplication.EditClassificationScheme(command);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// چگ کردن شرایط حذف طرح
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("CheckToDeleteScheme")]
|
|
public async Task<CheckStatusToDeleteScheme> CheckToDeleteScheme(long id)
|
|
{
|
|
var result =await _classificationSchemeApplication.CheckToDeleteScheme(id);
|
|
return result;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// حذف طرح
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpDelete]
|
|
public async Task<ActionResult<OperationResult>> DeleteScheme(long id)
|
|
{
|
|
var result = await _classificationSchemeApplication.DeleteScheme(id);
|
|
return result;
|
|
}
|
|
} |