This commit is contained in:
mmrbnjd
2024-06-27 00:20:36 +03:30
parent 478456c03f
commit 94fdefa12c
8 changed files with 138 additions and 57 deletions

View File

@@ -36,7 +36,7 @@
<ItemGroup>
<Reference Include="Service">
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
<HintPath>..\..\Dlls\Service.dll</HintPath>
</Reference>
</ItemGroup>

View File

@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Shared.DTOs;
using Shared.DTOs.Serch;
namespace Back.Controllers
{
@@ -18,8 +19,8 @@ namespace Back.Controllers
{
_Servstuff = Servstuff;
}
[HttpGet("Getstuff/{value}")]
public async Task<ActionResult> Getstuff(string value)
[HttpPost("Getstuff")]
public async Task<ActionResult<PagingDto<stuffDto>>> Getstuff(GridDataProviderRequestDto value)
{
return Ok(await _Servstuff.Getstuff(value));
}

View File

@@ -1,7 +1,9 @@
using Back.Data.Contracts;
using Back.Common;
using Back.Data.Contracts;
using Back.Data.Models;
using Microsoft.EntityFrameworkCore;
using Shared.DTOs;
using Shared.DTOs.Serch;
namespace Back.Services
{
@@ -12,10 +14,24 @@ namespace Back.Services
{
_repostuff=repostuff;
}
public async Task<List<stuffDto>> Getstuff(string value)
public async Task<PagingDto<stuffDto>> Getstuff(GridDataProviderRequestDto value)
{
var request = _repostuff.Get(w => w.sType.Contains(value) || w.DescriptionOfID.Contains(value) || w.CID.Contains(value));
//Contains
var request = _repostuff.GetAll();
foreach (var item in value.Filters)
{
switch (item.PropertyName)
{
case "ID":
request = request.Where(w=>w.CID.Contains( item.Value));
break;
case "DescriptionOfID":
request = request.Where(w => w.DescriptionOfID.Contains(item.Value));
break;
default:
break;
}
}
return await request.Select(s=>new stuffDto
{
DescriptionOfID=s.DescriptionOfID,
@@ -25,7 +41,7 @@ namespace Back.Services
Vat= string.IsNullOrEmpty(s.Vat) ? 0 :Convert.ToInt32(s.Vat),
// VatCustomPurposes = string.IsNullOrEmpty(s.VatCustomPurposes) ? 0 : Convert.ToInt32(s.VatCustomPurposes)
}).ToListAsync();
}).Paging(value.PageNumber,value.PageSize);
}
}
}