+ 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:
@@ -29,7 +29,8 @@ namespace EveryThing.Pages.CodeTableItems
|
||||
public string TotalPrice { get; set; }
|
||||
public string SellingPrice { get; set; }
|
||||
public string DifferenceInPricePercentage { get; set; }
|
||||
|
||||
public string MaterialDimensions { get; set; }
|
||||
public string Material { get; set; }
|
||||
}
|
||||
|
||||
private readonly ApplicationDbContext _context;
|
||||
@@ -51,17 +52,29 @@ namespace EveryThing.Pages.CodeTableItems
|
||||
{
|
||||
var user = _userManager.GetUserAsync(User).Result;
|
||||
|
||||
ViewData["SearchString"] = searchString;
|
||||
ViewData["SearchString"] = searchString ?? "";
|
||||
|
||||
var search = !string.IsNullOrEmpty(searchString);
|
||||
|
||||
Item = await _context.CodeTableItems
|
||||
.Where(x => x.IdCompanyFk == user.IdCompanyFk)
|
||||
.Include(j => j.Company).ToListAsync();
|
||||
.Where(x => x.IdCompanyFk == user.IdCompanyFk
|
||||
&& EF.Functions.Like(x.Title, $"%{searchString}%")
|
||||
|| EF.Functions.Like(x.Description, $"%{searchString}%"))
|
||||
.Include(j => j.Company).Take(100).ToListAsync();
|
||||
|
||||
if (!string.IsNullOrEmpty(searchString))
|
||||
{
|
||||
Item = Item.Where(s => s.Title.Contains(searchString, StringComparison.InvariantCultureIgnoreCase)
|
||||
|| (s.Description != null && s.Description.Contains(searchString, StringComparison.InvariantCultureIgnoreCase))).ToList();
|
||||
}
|
||||
//Item = await _context.CodeTableItems
|
||||
// .Where(x => x.IdCompanyFk == user.IdCompanyFk
|
||||
// && (!search
|
||||
// || EF.Functions.Like(x.Title, $"%{searchString}%")
|
||||
// || (x.Description != null
|
||||
// && EF.Functions.Like(x.Description, $"%{searchString}%"))))
|
||||
// .Include(j => j.Company).Take(100).ToListAsync();
|
||||
|
||||
//if ()
|
||||
//{
|
||||
// Item = Item.Where(s => s.Title.Contains(searchString, StringComparison.InvariantCultureIgnoreCase)
|
||||
// || (s.Description != null && s.Description.Contains(searchString, StringComparison.InvariantCultureIgnoreCase))).ToList();
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,6 +88,8 @@ namespace EveryThing.Pages.CodeTableItems
|
||||
var workPrice = 0d;
|
||||
var sellingPrice = 0d;
|
||||
var differenceInPricePercentage = 0d;
|
||||
var materialDimensions = "";
|
||||
var material = "";
|
||||
|
||||
if (edit)
|
||||
{
|
||||
@@ -98,6 +113,7 @@ namespace EveryThing.Pages.CodeTableItems
|
||||
else
|
||||
{
|
||||
var projectPartItem = _context.ProjectPartItems
|
||||
.Include(x => x.Material)
|
||||
.OrderByDescending(x => x.DateModified)
|
||||
.ThenByDescending(x => x.IdProjectPartItem)
|
||||
.FirstOrDefault(x => x.IdItemFk == item.IdItem);
|
||||
@@ -108,6 +124,8 @@ namespace EveryThing.Pages.CodeTableItems
|
||||
workPrice = projectPartItem.WorkPrice;
|
||||
sellingPrice = projectPartItem.SellingPrice;
|
||||
differenceInPricePercentage = projectPartItem.DifferenceInPricePercentage;
|
||||
materialDimensions = projectPartItem.MaterialDimensions;
|
||||
material = projectPartItem.Material.Title;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +140,9 @@ namespace EveryThing.Pages.CodeTableItems
|
||||
SellingPrice = sellingPrice.ToString("#,###,##0.00", new CultureInfo("sl-SI")),
|
||||
TotalPrice = (materialPrice + workPrice).ToString("#,###,##0.00", new CultureInfo("sl-SI")),
|
||||
WorkPrice = workPrice.ToString("#,###,##0.00", new CultureInfo("sl-SI")),
|
||||
DifferenceInPricePercentage = differenceInPricePercentage.ToString("#,###,##0.00", new CultureInfo("sl-SI"))
|
||||
DifferenceInPricePercentage = differenceInPricePercentage.ToString("#,###,##0.00", new CultureInfo("sl-SI")),
|
||||
MaterialDimensions = materialDimensions,
|
||||
Material = material
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user