disattivato temporaneametne navigatore negiziazioni + ok licenze attive MULT

This commit is contained in:
Samuele Locatelli
2021-11-29 09:50:08 +01:00
parent e674ae48fe
commit 7d643c4655
8 changed files with 44 additions and 33 deletions
+20 -11
View File
@@ -8,9 +8,9 @@
<tr>
<th></th>
<th>Attivo</th>
<th>Trattativa</th>
@*<th>Trattativa</th>
<th>Tipo</th>
<th title="Tipo di record: Draft / Offerta Economica"><i class="fas fa-pen-nib"></i>/<i class="fas fa-euro-sign"></i></th>
<th title="Tipo di record: Draft / Offerta Economica"><i class="fas fa-pen-nib"></i>/<i class="fas fa-euro-sign"></i></th>*@
<th>Cod</th>
<th>Descrizione</th>
<th class="text-right">Importo</th>
@@ -32,8 +32,7 @@
<span class="oi oi-power-standby"></span>
</button>
</td>
<td>
<div title="@record.Negotiation.Descript">@record.Negotiation.CodNegotiation</div>
@*<td>
<div class="small max10Char" title="@record.Negotiation.Descript">
@record.Negotiation.Descript
@@ -49,8 +48,9 @@
{
<i class="fas fa-euro-sign"></i>
}
</td>
</td>*@
<td>
<div title="@record.Negotiation.Descript">@record.Negotiation.CodNegotiation</div>
<div>@record.CodDoc</div>
<div class="small">@record.DataIns.ToString("ddd yyyy.MM.dd HH:mm")</div>
</td>
@@ -72,12 +72,23 @@
</table>
@code {
private int _negotIdSour { get; set; } = 0;
[Parameter]
public int NegotIdSour { get; set; }
[Parameter]
public int NegotIdDest { get; set; }
public int NegotIdSour
{
get
{
return _negotIdSour;
}
set
{
_negotIdSour = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
private DatabaseModels.DocsModel currItem = null;
@@ -169,8 +180,6 @@
protected async Task ReloadAllData()
{
//basketList = await BBMService.BasketsGetAsync(1, 1, MessageService.SearchVal);
//negotiationList = await BBMService.NegotiationsGetAllAsync();
await updateTable();
}
protected async Task updateTable()
+3 -3
View File
@@ -16,13 +16,13 @@
<Microsoft.AspNetCore.Components.Forms.ValidationSummary />
<div class="row">
<div class="col-6 col-lg-3">
<NaviNegot @bind-SelValue=_currItem.NegotiationId SelCustomerId="@_currItem.Negotiation.Basket.CustomerId" SelBasketId="@_currItem.Negotiation.BasketId"></NaviNegot>
@*<InputSelect @bind-Value="@_currItem.NegotiationId" class="form-control form-control-sm">
@*<NaviNegot @bind-SelValue="_currItem.NegotiationId" SelCustomerId="@_currItem.Negotiation.Basket.CustomerId" SelBasketId="@_currItem.Negotiation.BasketId"></NaviNegot>*@
<InputSelect @bind-Value="@_currItem.NegotiationId" class="form-control form-control-sm">
@foreach (var item in negotiationList)
{
<option value="@item.NegotiationId">@item.CodNegotiation | @item.Descript</option>
}
</InputSelect>*@
</InputSelect>
</div>
<div class="col-6 col-lg-3">
<div class="form-group">
+2 -2
View File
@@ -24,7 +24,7 @@
<option value="1">--- Tutti ---</option>
@foreach (var item in negotiationList)
{
<option value="@item.NegotiationId" class="max10Char">@item.CodNegotiation | @trimTxt(item.Descript, 25)</option>
<option value="@item.NegotiationId" class="max10Char">@item.CodNegotiation | @trimTxt(item.Descript, 50)</option>
}
</select>
<div class="input-group-append">
@@ -88,7 +88,7 @@
<option value="1">--- Tutti ---</option>
@foreach (var item in negotiationList)
{
<option value="@item.NegotiationId" class="max10Char">@item.CodNegotiation | @trimTxt(item.Descript, 25)</option>
<option value="@item.NegotiationId" class="max10Char">@item.CodNegotiation | @trimTxt(item.Descript, 40)</option>
}
</select>
</div>
+2 -8
View File
@@ -230,13 +230,7 @@ namespace SHERPA.BBM.UI.Data
public void DocSetActive(DatabaseModels.DocsModel currItem)
{
try
{
dbController.DocSetActive(currItem);
}
catch
{
}
dbController.DocSetActive(currItem);
}
// da rivedere...
@@ -349,7 +343,7 @@ namespace SHERPA.BBM.UI.Data
public Task<List<DatabaseModels.NegotiationsModel>> NegotiationsGetAsync(int CompanyId, int CustomerId, int BasketId, string searchVal)
{
return Task.FromResult(dbController.NegotGetLastDesc(CompanyId,CustomerId,BasketId, searchVal));
return Task.FromResult(dbController.NegotGetLastDesc(CompanyId, CustomerId, BasketId, searchVal));
}
public void NegotiationUpdate(DatabaseModels.NegotiationsModel currItem)
+5 -4
View File
@@ -10,12 +10,12 @@
<div class="card-body">
<div class="row text-center">
<div class="col-6">
<NaviNegot SelValue="@SelNegIdSx"></NaviNegot>
<DocMovList NegotIdSour="@SelNegIdSx" NegotIdDest="@SelNegIdDx"></DocMovList>
<NaviNegot @bind-SelValue="@SelNegIdSx"></NaviNegot>
<DocMovList NegotIdSour="@SelNegIdSx"></DocMovList>
</div>
<div class="col-6">
<NaviNegot SelValue="@SelNegIdDx"></NaviNegot>
<DocMovList NegotIdSour="@SelNegIdDx" NegotIdDest="@SelNegIdSx"></DocMovList>
<NaviNegot @bind-SelValue="@SelNegIdDx"></NaviNegot>
<DocMovList NegotIdSour="@SelNegIdDx"></DocMovList>
</div>
</div>
</div>
@@ -25,4 +25,5 @@
protected int SelNegIdSx{ get; set; }
protected int SelNegIdDx{ get; set; }
}
+3 -2
View File
@@ -149,7 +149,8 @@ namespace SHERPA.BBM.UI.Pages
NegotiationId = SelectData.NegotiationId,
NumDoc = 0,
DocType = BbmDocType.Quotazione,
Descript = "New Document"
Descript = "New Document",
IsActive = true
};
currItem = newRecord;
SelectData.DocIdSrc = 0;
@@ -262,7 +263,7 @@ namespace SHERPA.BBM.UI.Pages
protected async Task SetActive(SHERPA.BBM.DatabaseModels.DocsModel currRecord)
{
// imposto ad attivo SOLO il DOC corrente tra quelli della negoziazione
// imposto ad attivo SOLO il DOC corrente tra quelli della negoziazione (SE NON FOSSE licenza)
BBMService.DocSetActive(currRecord);
await UpdateData();
}
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>60fcdaab-6c1e-4bec-9d88-f7727ef1c12c</UserSecretsId>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
<Version>1.0.2111.2712</Version>
<Version>1.0.2111.2909</Version>
</PropertyGroup>
<ItemGroup>
+8 -2
View File
@@ -596,11 +596,17 @@ namespace SHERPA.BBM.Controllers
.DbSetDocs
.Where(x => x.NegotiationId == updItem.NegotiationId && x.DocId != updItem.DocId)
.ToList();
foreach (var item in otherData)
// se NON fosse licenza --> disattivo altri
if (currData.DocType < BbmDocType.Licenza)
{
item.IsActive = false;
foreach (var item in otherData)
{
item.IsActive = false;
}
}
dbCtx.SaveChanges();
// rileggo
dbCtx.Entry(currData).Reload();
// anche altri valori