...
This commit is contained in:
43
TaxPayerFull/CUSComponent/SendTaxItem.razor
Normal file
43
TaxPayerFull/CUSComponent/SendTaxItem.razor
Normal file
@@ -0,0 +1,43 @@
|
||||
@using Front.Services
|
||||
@using Shared.DTOs
|
||||
@inject HttpClientController hc;
|
||||
<form>
|
||||
|
||||
<div class="row g-3">
|
||||
<label class="col-sm-5 col-form-label">وضعیت ارسال</label>
|
||||
<InputText @Value="inData.msgSentStatus" type="text" class="form-control" id="msgSentStatus" placeholder="وضعیت ارسال" />
|
||||
</div>
|
||||
@if (inData.SentStatus == SentStatus.Unsuccessful)
|
||||
{
|
||||
<div class="row g-3">
|
||||
<table class="table">
|
||||
<caption>لیست خطاهای صورتحساب</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">کد</th>
|
||||
<th scope="col">متن</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in inData.error)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.code</td>
|
||||
<td>@item.message</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter] public DataInSendTaxDto inData { get; set; }
|
||||
}
|
||||
@@ -50,7 +50,7 @@
|
||||
@decimal.Parse(property.GetValue(item, null).ToString()).ToString("N0") ريال
|
||||
</td>
|
||||
}
|
||||
else if (property.Name.ToLower() == "id")
|
||||
else if (property.Name.ToLower() == "id" && item.ToString() != "Shared.DTOs.SentTaxDto")
|
||||
{
|
||||
if (id > 0)
|
||||
{
|
||||
@@ -62,6 +62,44 @@
|
||||
}
|
||||
|
||||
}
|
||||
else if (property.Name.ToLower() == "msgsentstatus" && item.ToString() == "Shared.DTOs.SentTaxDto")
|
||||
{
|
||||
var convertmodel = (SentTaxDto)Convert.ChangeType(item, typeof(SentTaxDto));
|
||||
switch (convertmodel.SentStatus)
|
||||
{
|
||||
case SentStatus.Send:
|
||||
<td style="background-color:#6495ED">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
case SentStatus.Successful:
|
||||
<td style="background-color:#2AD51B">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
case SentStatus.Unsuccessful:
|
||||
<td style="background-color:#C70000">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
case SentStatus.pending :
|
||||
<td style="background-color:#FCFF2A">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
case SentStatus.IN_PROGRESS :
|
||||
<td style="background-color:#FCFF2A">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
case SentStatus.NOT_FOUND:
|
||||
<td style="background-color:#F19109">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
case SentStatus.Unknown:
|
||||
<td style="background-color:#932D2D">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
default:
|
||||
<td>@property.GetValue(item, null)</td>
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>@property.GetValue(item, null)</td>
|
||||
@@ -70,14 +108,36 @@
|
||||
}
|
||||
|
||||
}
|
||||
if (id > 0)
|
||||
if (item.ToString() == "Shared.DTOs.SentTaxDto")
|
||||
{
|
||||
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">ویرایش</button></td>
|
||||
var convertmodel = (SentTaxDto)Convert.ChangeType(item, typeof(SentTaxDto));
|
||||
if (convertmodel.SentStatus == SentStatus.Send
|
||||
|| convertmodel.SentStatus == SentStatus.pending
|
||||
|| convertmodel.SentStatus == SentStatus.IN_PROGRESS)
|
||||
{
|
||||
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">تعیین وضعیت</button></td>
|
||||
}
|
||||
else if (convertmodel.SentStatus == SentStatus.Unsuccessful)
|
||||
{
|
||||
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">نمایش خطا</button></td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td><button type="button" class="btn btn-link disabled">...</button></td>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<td><button type="button" class="btn btn-link disabled">ویرایش</button></td>
|
||||
if (id > 0)
|
||||
{
|
||||
<td><button @onclick="()=>OnMultipleOfThree.InvokeAsync(Convert.ToInt32(id))" type="button" class="btn btn-link">ویرایش</button></td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td><button type="button" class="btn btn-link disabled">ویرایش</button></td>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</tr>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
@using Shared
|
||||
@using Shared.DTOs
|
||||
@using Shared.DTOs.Serch
|
||||
|
||||
<Modal @ref="modal" />
|
||||
<Preload LoadingText="در حال بارگذاری..." />
|
||||
@* search *@
|
||||
<div class="row">
|
||||
@@ -33,7 +33,7 @@
|
||||
@foreach (InvoiceType i in Enum.GetValues(typeof(InvoiceType)))
|
||||
{
|
||||
|
||||
<option value="@Convert.ToInt32(i)">@i.GetEnumDisplayName()</option>
|
||||
<option value="@i">@i.GetEnumDisplayName()</option>
|
||||
|
||||
|
||||
}
|
||||
@@ -46,13 +46,16 @@
|
||||
@foreach (SentStatus i in Enum.GetValues(typeof(SentStatus)))
|
||||
{
|
||||
|
||||
<option value="@Convert.ToInt32(i)">@i.GetEnumDisplayName()</option>
|
||||
<option value="@i">@i.GetEnumDisplayName()</option>
|
||||
|
||||
|
||||
}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button @onclick="() => Load(1)" type="submit" class="btn btn-primary">جستجو</button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -99,8 +102,10 @@
|
||||
}
|
||||
|
||||
@code {
|
||||
private Modal modal = default!;
|
||||
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
||||
ItemSerchGetSentTax itemsearch = new ItemSerchGetSentTax();
|
||||
[Parameter]
|
||||
public int? routed { get; set; } = 0;
|
||||
// alert
|
||||
AlertColor alertColor = AlertColor.Primary;
|
||||
@@ -128,7 +133,23 @@
|
||||
@functions{
|
||||
public async Task SentTaxItem(int ID)
|
||||
{
|
||||
|
||||
var rsp = await hc.Get($"TaxPayer/GetResult/{ID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var requestsendTax = await rsp.Content.ReadFromJsonAsync<DataInSendTaxDto>();
|
||||
//عویض کردن اطلاعات در گرید
|
||||
var ingriddata= request.list.Where(w => w.ID == ID).First();
|
||||
ingriddata.SentStatus = requestsendTax.SentStatus;
|
||||
ingriddata.msgSentStatus = requestsendTax.msgSentStatus;
|
||||
//-----------------
|
||||
var parameters = new Dictionary<string, object>();
|
||||
parameters.Add("inData", requestsendTax);
|
||||
await modal.ShowAsync<CUSComponent.SendTaxItem>(title: "وضعیت صورتحساب ارسالی", parameters: parameters);
|
||||
}
|
||||
else{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
}
|
||||
public async Task Load(int pi)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user