+ Timeout logout

+ Pred kreiranjem povpraševanja vprašaj za partnerja
+ Prikaz TOP 100 (predolgo nalaga)
+ Dodaj Sorovec na Urejanje Artikla (zadnji surovec)
+ V Urejanju artikla popravi opis v pot dokumentov
+ Kooperant
This commit is contained in:
David Štaleker
2025-07-18 08:10:42 +02:00
parent db0cc8d3de
commit a7560aa141
16 changed files with 463 additions and 55 deletions

View File

@@ -1,16 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using EveryThing.Data;
using EveryThing.Data;
using EveryThing.Models;
using EveryThing.Models.CodeTable;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace EveryThing.Pages.CodeTablePartners
{
@@ -49,5 +51,30 @@ namespace EveryThing.Pages.CodeTablePartners
.ToList();
}
}
public IActionResult OnGetPartners(bool? suppliers)
{
var user = _userManager.GetUserAsync(User).Result;
var successful = true;
var error = "";
var partners = _context.CodeTablePartners
.Where(x => x.IdCompanyFk == user.IdCompanyFk);
if (suppliers != null)
partners = partners.Where(x => x.Supplier == suppliers);
var sbJson = new StringBuilder();
foreach (var codeTablePartner in partners)
{
if (sbJson.Length > 0)
sbJson.Append(",");
sbJson.Append($"\"{codeTablePartner.IdPartner}\": \"{codeTablePartner.Title}\"");
}
return new JsonResult(new { jsonPartners = $"{{{sbJson}}}", error = error, successful = successful });
}
}
}