This commit is contained in:
mmrbnjd
2025-01-21 19:06:37 +03:30
parent a296f31d74
commit a4b90b5142
4 changed files with 74 additions and 28 deletions

View File

@@ -28,7 +28,6 @@ namespace Back.Services.Warehouse
var RequestRemittance = _RemittanceRepo.Get(w => w.cODItem.CompanyID == CompanyID && !w.Deleted) var RequestRemittance = _RemittanceRepo.Get(w => w.cODItem.CompanyID == CompanyID && !w.Deleted)
.Select(s=>new CirculationDto .Select(s=>new CirculationDto
{ {
ID= s.ID,
CODID=s.CODID, CODID=s.CODID,
CODTitle=s.cODItem.Title, CODTitle=s.cODItem.Title,
Date=s.Date, Date=s.Date,
@@ -46,7 +45,6 @@ namespace Back.Services.Warehouse
var RequestReceipt = _ReceiptRepo.Get(w => w.cODItem.CompanyID == CompanyID && !w.Deleted) var RequestReceipt = _ReceiptRepo.Get(w => w.cODItem.CompanyID == CompanyID && !w.Deleted)
.Select(s => new CirculationDto .Select(s => new CirculationDto
{ {
ID = s.ID,
CODID = s.CODID, CODID = s.CODID,
CODTitle = s.cODItem.Title, CODTitle = s.cODItem.Title,
Date = s.Date, Date = s.Date,

View File

@@ -18,7 +18,6 @@ namespace Shared.DTOs.Warehouse
} }
public class CirculationDto public class CirculationDto
{ {
public int ID { get; set; }
public int CODID { get; set; } public int CODID { get; set; }
[Display(Name = "کالا")] [Display(Name = "کالا")]
public string? CODTitle { get; set; } public string? CODTitle { get; set; }

View File

@@ -54,7 +54,14 @@
{ {
if (id > 0) if (id > 0)
{ {
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">@property.GetValue(item, null)</button></td> if (OnMultipleOfThree.HasValue)
{
<td><button @onclick="()=>OnMultipleOfThree.Value.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">@property.GetValue(item, null)</button></td>
}
else if (OnMultipleOfThreeGeneric.HasValue)
{
<td><button @onclick="()=>OnMultipleOfThreeGeneric.Value.InvokeAsync(item)" type="button" class="btn btn-link">@property.GetValue(item, null)</button></td>
}
} }
else else
{ {
@@ -115,11 +122,29 @@
|| convertmodel.SentStatus == SentStatus.pending || convertmodel.SentStatus == SentStatus.pending
|| convertmodel.SentStatus == SentStatus.IN_PROGRESS) || convertmodel.SentStatus == SentStatus.IN_PROGRESS)
{ {
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">تعیین وضعیت</button></td> if (OnMultipleOfThree.HasValue)
{
<td><button @onclick="()=>OnMultipleOfThree.Value.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">تعیین وضعیت</button></td>
}
else if (OnMultipleOfThreeGeneric.HasValue)
{
<td><button @onclick="()=>OnMultipleOfThreeGeneric.Value.InvokeAsync(item)" type="button" class="btn btn-link">تعیین وضعیت</button></td>
}
} }
else if (convertmodel.SentStatus == SentStatus.Unsuccessful) else if (convertmodel.SentStatus == SentStatus.Unsuccessful)
{ {
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">نمایش خطا</button></td> if (OnMultipleOfThree.HasValue)
{
<td><button @onclick="()=>OnMultipleOfThree.Value.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">نمایش خطا</button></td>
}
else if (OnMultipleOfThreeGeneric.HasValue)
{
<td><button @onclick="()=>OnMultipleOfThreeGeneric.Value.InvokeAsync(item)" type="button" class="btn btn-link">نمایش خطا</button></td>
}
} }
else else
{ {
@@ -128,9 +153,18 @@
} }
else else
{ {
if (id > 0) if (id > 0 /* || item.ToString() == "Shared.DTOs.Warehouse.CirculationDto" */)
{ {
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">ویرایش</button></td> if (OnMultipleOfThree.HasValue)
{
<td><button @onclick="()=>OnMultipleOfThree.Value.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">ویرایش</button></td>
}
else if (OnMultipleOfThreeGeneric.HasValue)
{
<td><button @onclick="()=>OnMultipleOfThreeGeneric.Value.InvokeAsync(item)" type="button" class="btn btn-link">ویرایش</button></td>
}
} }
else else
{ {
@@ -159,5 +193,7 @@
@code { @code {
[Parameter] [Parameter]
public List<T> ModelinComponent { get; set; } = new List<T>(); public List<T> ModelinComponent { get; set; } = new List<T>();
[Parameter] public EventCallback<int> OnMultipleOfThree { get; set; } [Parameter] public EventCallback<int>? OnMultipleOfThree { get; set; }
[Parameter] public EventCallback<T>? OnMultipleOfThreeGeneric { get; set; }
} }

View File

@@ -59,10 +59,10 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="col-auto"> <div class="col-auto">
<Button Disabled="SpinnerVisible" Type="ButtonType.Submit" Color="ButtonColor.Primary" @onclick="()=>Item(-1)">رسید جدید</Button> <Button Disabled="SpinnerVisible" Type="ButtonType.Submit" Color="ButtonColor.Primary" @onclick="()=>Item(new CirculationDto(){Type=TypeCirculation.Receipt})">رسید جدید</Button>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<Button Disabled="SpinnerVisible" Type="ButtonType.Submit" Color="ButtonColor.Primary" @onclick="()=>Item(-2)">حواله جدید</Button> <Button Disabled="SpinnerVisible" Type="ButtonType.Submit" Color="ButtonColor.Primary" @onclick="()=>Item(new CirculationDto(){Type=TypeCirculation.Remittance})">حواله جدید</Button>
</div> </div>
</div> </div>
</div> </div>
@@ -80,7 +80,7 @@
@* data *@ @* data *@
@if (request != null) @if (request != null)
{ {
<LTable ModelinComponent="request?.list" OnMultipleOfThree="EventCallback.Factory.Create<int>(this,Item)" /> <LTable ModelinComponent="request?.list" OnMultipleOfThreeGeneric="EventCallback.Factory.Create<CirculationDto>(this,Item)" />
@* pagination *@ @* pagination *@
<p style="color:red">@request?.RowCount آیتم یافت شد</p> <p style="color:red">@request?.RowCount آیتم یافت شد</p>
<nav aria-label="Page navigation"> <nav aria-label="Page navigation">
@@ -185,22 +185,35 @@
{ {
} }
public async Task Item(int ID) public async Task Item(CirculationDto circulationDto)
{ {
//رسید جدید //رسید
if (ID == -1) if (circulationDto.Type == TypeCirculation.Receipt)
{
//جدید
if (circulationDto.CODID==0)
{ {
} }
//حواله جدید else
if (ID == -2)
{ {
} }
if (ID >0)
{
request.list.Where(w=>w.i)
} }
//حواله
if (circulationDto.Type == TypeCirculation.Remittance)
{
//جدید
if (circulationDto.CODID == 0)
{
}
else
{
}
}
// var parameters = new Dictionary<string, object>(); // var parameters = new Dictionary<string, object>();
// if (ID == 0) parameters.Add("Cus", new RCustomer() { ID = 0 }); // if (ID == 0) parameters.Add("Cus", new RCustomer() { ID = 0 });