This commit is contained in:
mmrbnjd
2024-08-11 18:59:36 +03:30
parent 42ce2a29e7
commit d5bcde27d2
7 changed files with 57 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ namespace Front
private List<IdName<int>>? Patterns = null;
private List<IdName<int>>? Patternsbyinp = null;
private List<IdName<int>>? BillTypes = null;
private List<IdName<int>>? UnitsbyUnitTaxID = null;
private List<IdName<int>>? Units = null;
private List<CODIdName<int>>? Cods = null;
private CompanyDTO? InfoCompany = null;
@@ -84,6 +85,20 @@ namespace Front
return Patternsbyinp;
}
public async Task<List<IdName<int>>?> GetUnitsbyUnitTaxID()
{
if (UnitsbyUnitTaxID == null)
{
var request = await _hc.Get($"COD/GetUnits?UnitTaxID=true");
if (request.IsSuccessStatusCode)
{
UnitsbyUnitTaxID = await request.Content.ReadFromJsonAsync<List<IdName<int>>>();
}
}
return UnitsbyUnitTaxID;
}
public async Task<List<IdName<int>>?> GetBillTypes()
{
if (BillTypes == null)

View File

@@ -133,7 +133,7 @@ else
}
else if (item.eName.ToLower() == "inp")
{
patt=item.Value;
patt = item.Value;
var _patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
<input value="@_patt" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
@@ -145,7 +145,7 @@ else
}
else if (item.eName.ToLower() == "tob")
else if (item.eName.ToLower() == "tob")
{
CustomerType foo = (CustomerType)Enum.Parse(typeof(CustomerType), item.Value);
<input value="@foo.GetEnumDisplayName()" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
@@ -158,10 +158,10 @@ else
}
}
@@ -249,7 +249,20 @@ else
}
else if (itemB.InputBox == "autofild" || (itemB.eName.ToLower() == "_cfee" && patt != "2"))
{
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
@if (itemB.eName.ToLower() == "mu")
{
var mu = units.Where(w => w.ID == Convert.ToInt32(itemB.Value)).Select(s => s.Title).FirstOrDefault();
<input value="@mu" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
}
else
{
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
}
}
else
{
@@ -258,6 +271,8 @@ else
}
</div>
}
</div>
@@ -310,6 +325,7 @@ else
string patt = "";
private List<IdName<int>>? Patterns = new List<IdName<int>>();
private List<IdName<int>>? BillTypes = new List<IdName<int>>();
private List<IdName<int>>? units = new List<IdName<int>>();
private Modal modal = default!;
private ConfirmDialog dialog = default!;
[Parameter] public int? InvoiceID { get; set; }
@@ -328,7 +344,7 @@ else
PreloadService.Show(SpinnerColor.Dark);
Patterns = await fv.GetPatternsbyinp();
BillTypes = await fv.GetBillTypes();
units = await fv.GetUnitsbyUnitTaxID();
await LoadData();
PreloadService.Hide();