...
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
}
|
}
|
||||||
[HttpPost("GetAll")]
|
[HttpPost("GetAll")]
|
||||||
public async Task<ActionResult<PagingDto<InvoiceDTO>?>> GetAll([FromBody] ItemSerchGetInvoices itemSerch)
|
public async Task<ActionResult<PagingDto<InvoiceGridDTO>?>> GetAll([FromBody] ItemSerchGetInvoices itemSerch)
|
||||||
{
|
{
|
||||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||||
var UserID = claim.Value;
|
var UserID = claim.Value;
|
||||||
@@ -34,6 +34,16 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
return Ok(await _servInvoice.GetInvoices(user.RolUsers.First().CompanyID, itemSerch));
|
return Ok(await _servInvoice.GetInvoices(user.RolUsers.First().CompanyID, itemSerch));
|
||||||
|
|
||||||
|
}
|
||||||
|
[HttpGet("Get/{ID}")]
|
||||||
|
public async Task<ActionResult<PagingDto<InvoiceGridDTO>?>> GetAll(int ID)
|
||||||
|
{
|
||||||
|
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||||
|
var UserID = claim.Value;
|
||||||
|
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||||
|
|
||||||
|
return Ok(await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID, ID));
|
||||||
|
|
||||||
}
|
}
|
||||||
[HttpPost("Add")]
|
[HttpPost("Add")]
|
||||||
public async Task<ActionResult<int>> Add([FromBody] NUInvoiceDTO item)
|
public async Task<ActionResult<int>> Add([FromBody] NUInvoiceDTO item)
|
||||||
|
@@ -20,25 +20,12 @@ namespace Back.Services
|
|||||||
_checkPermission = checkPermission;
|
_checkPermission = checkPermission;
|
||||||
|
|
||||||
}
|
}
|
||||||
public async Task<PagingDto<InvoiceDTO>?> GetInvoices(int CompanyID, ItemSerchGetInvoices itemSerch)
|
public async Task<InvoiceDTO> GetInvoice(int CompanyID, int ID)
|
||||||
{
|
{
|
||||||
#region AdvancedSearch
|
#region AdvancedSearch
|
||||||
var invok = _invoiceRepo
|
var invok = _invoiceRepo
|
||||||
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted);
|
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted && w.ID==ID);
|
||||||
|
|
||||||
if (itemSerch.InvoiceID != null)
|
|
||||||
invok = invok.Where(w => w.ID == itemSerch.InvoiceID);
|
|
||||||
|
|
||||||
if (itemSerch.CustomerID != null)
|
|
||||||
invok = invok.Where(w => w.CustomerID == itemSerch.CustomerID);
|
|
||||||
|
|
||||||
if (itemSerch.invoiceType != null)
|
|
||||||
invok = invok.Where(w => w.invoiceType == itemSerch.invoiceType);
|
|
||||||
|
|
||||||
if (itemSerch.Title != null)
|
|
||||||
invok = invok.Where(w => w.Title.Contains(itemSerch.Title));
|
|
||||||
//foreach (InputObj item in inputObjs)
|
|
||||||
// invok = invok.Where(ExMethod.GetFunc<Customer>(item.Param, item.Value));
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
//-----------------------
|
//-----------------------
|
||||||
@@ -93,6 +80,47 @@ namespace Back.Services
|
|||||||
trn = x.acn
|
trn = x.acn
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
})
|
})
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
public async Task<PagingDto<InvoiceGridDTO>?> GetInvoices(int CompanyID, ItemSerchGetInvoices itemSerch)
|
||||||
|
{
|
||||||
|
#region AdvancedSearch
|
||||||
|
var invok = _invoiceRepo
|
||||||
|
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted);
|
||||||
|
|
||||||
|
if (itemSerch.InvoiceID != null)
|
||||||
|
invok = invok.Where(w => w.ID == itemSerch.InvoiceID);
|
||||||
|
|
||||||
|
if (itemSerch.CustomerID != null)
|
||||||
|
invok = invok.Where(w => w.CustomerID == itemSerch.CustomerID);
|
||||||
|
|
||||||
|
if (itemSerch.invoiceType != null)
|
||||||
|
invok = invok.Where(w => w.invoiceType == itemSerch.invoiceType);
|
||||||
|
|
||||||
|
if (itemSerch.Title != null)
|
||||||
|
invok = invok.Where(w => w.Title.Contains(itemSerch.Title));
|
||||||
|
//foreach (InputObj item in inputObjs)
|
||||||
|
// invok = invok.Where(ExMethod.GetFunc<Customer>(item.Param, item.Value));
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
//-----------------------
|
||||||
|
return await invok
|
||||||
|
.Include(inc => inc.invoiceDetails)
|
||||||
|
.Include(inc => inc.payments)
|
||||||
|
.Include(inc => inc.pattern)
|
||||||
|
.Select(s => new InvoiceGridDTO()
|
||||||
|
{
|
||||||
|
CustomerID = s.CustomerID,
|
||||||
|
CustomerName = s.Customer.FullName,
|
||||||
|
ID = s.ID,
|
||||||
|
invoiceTypeTitle = s.invoiceType.GetEnumDisplayName(),
|
||||||
|
Title = s.Title,
|
||||||
|
InvoicIssueDate = s.InvoicIssueDate.ShamciToFormatShamci(),
|
||||||
|
tbill = s.tbill,
|
||||||
|
tdis = s.tdis,
|
||||||
|
tvam = s.tvam,
|
||||||
|
Udate = s.Udate.ShamciToFormatShamci(),
|
||||||
|
})
|
||||||
.Paging(itemSerch.PageIndex, itemSerch.PageSize);
|
.Paging(itemSerch.PageIndex, itemSerch.PageSize);
|
||||||
}
|
}
|
||||||
public async Task<bool> ExistInvoiceByInvoiceID(int CompanyID, int InvoiceID)
|
public async Task<bool> ExistInvoiceByInvoiceID(int CompanyID, int InvoiceID)
|
||||||
|
@@ -17,6 +17,33 @@ namespace Shared.DTOs
|
|||||||
public string InvoiceDate { get; set; }
|
public string InvoiceDate { get; set; }
|
||||||
public string? Des { get; set; }
|
public string? Des { get; set; }
|
||||||
}
|
}
|
||||||
|
public class InvoiceGridDTO
|
||||||
|
{
|
||||||
|
[Display(Name = "شناسه")]
|
||||||
|
public int ID { get; set; }
|
||||||
|
[Display(Name = "عنوان")]
|
||||||
|
public string Title { get; set; }//
|
||||||
|
[Display(Name = "نوع صورتحساب")]
|
||||||
|
public string? invoiceTypeTitle { get; set; }//
|
||||||
|
public int CustomerID { get; set; }//
|
||||||
|
[Display(Name = "مشتری")]
|
||||||
|
public string CustomerName { get; set; }//
|
||||||
|
public string? Udate { get; set; }
|
||||||
|
[Display(Name = "تاریخ صدور")]
|
||||||
|
public string InvoicIssueDate { get; set; }//
|
||||||
|
//مجموع تخفیفات
|
||||||
|
[Display(Name = "مجموع تخفیف")]
|
||||||
|
public decimal? tdis { get; set; }
|
||||||
|
//مجموع مالیات بر ارزش افزوده
|
||||||
|
[MaxLength(18)]
|
||||||
|
[Display(Name = "مجموع مالیات")]
|
||||||
|
public decimal? tvam { get; set; }
|
||||||
|
//مجموع صورتحساب
|
||||||
|
[MaxLength(18)]
|
||||||
|
[Display(Name = "مجموع صورتحساب")]
|
||||||
|
public decimal? tbill { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
public class InvoiceDTO
|
public class InvoiceDTO
|
||||||
{
|
{
|
||||||
[Display(Name = "شناسه")]
|
[Display(Name = "شناسه")]
|
||||||
|
@@ -2,6 +2,11 @@
|
|||||||
@using Shared.DTOs
|
@using Shared.DTOs
|
||||||
@using Shared
|
@using Shared
|
||||||
@inject HttpClientController hc;
|
@inject HttpClientController hc;
|
||||||
|
@layout PanelLayout
|
||||||
|
@inject Fixedvalues fv;
|
||||||
|
@page "/InvoiceDetails/{InvoiceID:int}"
|
||||||
|
@page "/InvoiceDetails"
|
||||||
|
<Preload LoadingText="در حال بارگذاری..." />
|
||||||
<form>
|
<form>
|
||||||
@* alert *@
|
@* alert *@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -29,9 +34,9 @@
|
|||||||
<option value="0" style="color: #b5b5b5">انتخاب کنید...</option>
|
<option value="0" style="color: #b5b5b5">انتخاب کنید...</option>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@foreach (InvoiceType i in Enum.GetValues(typeof(InvoiceType)))
|
@foreach (InvoiceType i in Enum.GetValues(typeof(InvoiceType)))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (invoice.invoiceType == i)
|
if (invoice.invoiceType == i)
|
||||||
{
|
{
|
||||||
@@ -42,16 +47,16 @@
|
|||||||
<option value="@i">@i.GetEnumDisplayName()</option>
|
<option value="@i">@i.GetEnumDisplayName()</option>
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label class="col-sm-8 col-form-label" for="inputPatternID">الگو صورتحساب</label>
|
<label class="col-sm-8 col-form-label" for="inputPatternID">الگو صورتحساب</label>
|
||||||
<select @bind="invoice.PatternID" class="form-control" aria-label="Default select example" id="inputPatternID">
|
<select @bind="invoice.PatternID" class="form-control" aria-label="Default select example" id="inputPatternID">
|
||||||
@if (invoice.PatternID == null || invoice.PatternID ==0)
|
@if (invoice.PatternID == null || invoice.PatternID == 0)
|
||||||
{
|
{
|
||||||
<option value="0" style="color: #b5b5b5" selected>انتخاب کنید...</option>
|
<option value="0" style="color: #b5b5b5" selected>انتخاب کنید...</option>
|
||||||
}
|
}
|
||||||
@@ -126,7 +131,7 @@
|
|||||||
<p class="ms-3">This is the placeholder content for the <b>Profile</b> tab.</p>
|
<p class="ms-3">This is the placeholder content for the <b>Profile</b> tab.</p>
|
||||||
</Content>
|
</Content>
|
||||||
</Tab>
|
</Tab>
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
<hr class="hr" />
|
<hr class="hr" />
|
||||||
@@ -139,12 +144,12 @@
|
|||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label class="col-sm-4 col-form-label" for="inputUdate">آخرین ویرایش</label>
|
<label class="col-sm-4 col-form-label" for="inputUdate">آخرین ویرایش</label>
|
||||||
<InputText style=" text-align: center;" @bind-Value="invoice.Udate" class="form-control" id="inputUdate" readonly />
|
<InputText style=" text-align: center;" @bind-Value="invoice.Udate" class="form-control" id="inputUdate" readonly />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
@@ -166,29 +171,55 @@ else
|
|||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
||||||
// alert
|
// alert
|
||||||
AlertColor alertColor = AlertColor.Primary;
|
AlertColor alertColor = AlertColor.Primary;
|
||||||
IconName alertIconName = IconName.CheckCircleFill;
|
IconName alertIconName = IconName.CheckCircleFill;
|
||||||
bool Hidealert = true;
|
bool Hidealert = true;
|
||||||
string alertMessage = "";
|
string alertMessage = "";
|
||||||
[Parameter] public List<ForCustomerSearch> Cus { get; set; }
|
[Parameter] public int? InvoiceID { get; set; }
|
||||||
[Parameter] public List<IdName<int>> Patterns { get; set; }
|
public List<ForCustomerSearch>? Cus { get; set; }
|
||||||
[Parameter] public InvoiceDTO invoice { get; set; }
|
public List<IdName<int>>? Patterns { get; set; }
|
||||||
[Parameter] public EventCallback<ActionInResultComponent> OnMultipleOfThree { get; set; }
|
public InvoiceDTO? invoice { get; set; }
|
||||||
// [Parameter] public List<IdName<int>>? Unitrequest { get; set; }
|
|
||||||
public ActionInResultComponent result { get; set; }
|
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
protected override Task OnParametersSetAsync()
|
|
||||||
{
|
{
|
||||||
result = new ActionInResultComponent()
|
invoice = new InvoiceDTO();
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task OnParametersSetAsync()
|
||||||
|
{
|
||||||
|
PreloadService.Show(SpinnerColor.Dark);
|
||||||
|
Cus =await fv.GetCustomers();
|
||||||
|
Patterns = await fv.GetPatterns();
|
||||||
|
if (InvoiceID != null && InvoiceID > 0)
|
||||||
|
{
|
||||||
|
var rsp = await hc.Get($"Invoice/Get/{InvoiceID}");
|
||||||
|
if (rsp.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
Status = ComponentStatus.fild
|
invoice = await rsp.Content.ReadFromJsonAsync<InvoiceDTO>();
|
||||||
};
|
}
|
||||||
|
else
|
||||||
|
hc._nav.NavigateTo("/Pael");
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
invoice = new InvoiceDTO()
|
||||||
|
{
|
||||||
|
ID = 0,
|
||||||
|
InvoiceDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
||||||
|
InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
||||||
|
Udate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Hidealert = true;
|
Hidealert = true;
|
||||||
alertMessage = "";
|
alertMessage = "";
|
||||||
return base.OnParametersSetAsync();
|
PreloadService.Hide();
|
||||||
|
await base.OnParametersSetAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@functions {
|
@functions {
|
||||||
@@ -209,24 +240,25 @@ else
|
|||||||
public async Task OnClickDelete()
|
public async Task OnClickDelete()
|
||||||
{
|
{
|
||||||
|
|
||||||
var rsp = await hc.Delete($"Cod/Delete/{invoice.ID}");
|
// var rsp = await hc.Delete($"Cod/Delete/{invoice.ID}");
|
||||||
if (rsp.IsSuccessStatusCode)
|
// if (rsp.IsSuccessStatusCode)
|
||||||
{
|
// {
|
||||||
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
// var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||||
if (request)
|
// if (request)
|
||||||
{
|
// {
|
||||||
result.Status = ComponentStatus.success;
|
// result.Status = ComponentStatus.success;
|
||||||
result.Action = ComponentAction.delete;
|
// result.Action = ComponentAction.delete;
|
||||||
await OnMultipleOfThree.InvokeAsync(result);
|
|
||||||
}
|
|
||||||
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (rsp.StatusCode == System.Net.HttpStatusCode.NotFound)
|
// //await OnMultipleOfThree.InvokeAsync(result);
|
||||||
{
|
// }
|
||||||
ShowDangerAlert("کالا با این شناسه یافت نشد");
|
// else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||||
}
|
// }
|
||||||
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
|
||||||
|
// else if (rsp.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||||
|
// {
|
||||||
|
// ShowDangerAlert("کالا با این شناسه یافت نشد");
|
||||||
|
// }
|
||||||
|
// else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,9 +1,46 @@
|
|||||||
using Shared.DTOs;
|
using Front.Services;
|
||||||
|
using Shared.DTOs;
|
||||||
|
using System.Net.Http.Json;
|
||||||
|
|
||||||
namespace Front
|
namespace Front
|
||||||
{
|
{
|
||||||
public static class Fixedvalues
|
public class Fixedvalues
|
||||||
{
|
{
|
||||||
public static UserAuthenticationDTO Userinfo=new UserAuthenticationDTO();
|
public readonly HttpClientController _hc;
|
||||||
|
private List<ForCustomerSearch>? Cus=null;
|
||||||
|
private List<IdName<int>>? Patterns = null;
|
||||||
|
public Fixedvalues(HttpClientController hc)
|
||||||
|
{
|
||||||
|
_hc = hc;
|
||||||
|
}
|
||||||
|
public async Task<List<ForCustomerSearch>?> GetCustomers()
|
||||||
|
{
|
||||||
|
if (Cus == null)
|
||||||
|
{
|
||||||
|
var request = await _hc.Get($"Customer/GetAllForidName");
|
||||||
|
if (request.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
Cus= await request.Content.ReadFromJsonAsync<List<ForCustomerSearch>>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Cus;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
public async Task<List<IdName<int>>?> GetPatterns()
|
||||||
|
{
|
||||||
|
if (Patterns==null)
|
||||||
|
{
|
||||||
|
var request = await _hc.Get($"Invoice/GetPatterns");
|
||||||
|
if (request.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
Patterns =await request.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return Patterns;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
@using Front.CUSComponent
|
@using Front.CUSComponent
|
||||||
@using Shared.DTOs.Serch
|
@using Shared.DTOs.Serch
|
||||||
@inject HttpClientController hc;
|
@inject HttpClientController hc;
|
||||||
|
@inject Fixedvalues fv;
|
||||||
<PageTitle>صورتحساب</PageTitle>
|
<PageTitle>صورتحساب</PageTitle>
|
||||||
<Modal Size="ModalSize.ExtraLarge" @ref="modal" />
|
<Modal Size="ModalSize.ExtraLarge" @ref="modal" />
|
||||||
|
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
ItemSerchGetInvoices itemsearch = new ItemSerchGetInvoices();
|
ItemSerchGetInvoices itemsearch = new ItemSerchGetInvoices();
|
||||||
[Parameter, SupplyParameterFromQuery]
|
[Parameter, SupplyParameterFromQuery]
|
||||||
public int? PageIndex { get; set; }
|
public int? PageIndex { get; set; }
|
||||||
public Shared.DTOs.PagingDto<InvoiceDTO>? request { get; set; }
|
public Shared.DTOs.PagingDto<InvoiceGridDTO>? request { get; set; }
|
||||||
private Modal modal = default!;
|
private Modal modal = default!;
|
||||||
// alert
|
// alert
|
||||||
AlertColor alertColor = AlertColor.Primary;
|
AlertColor alertColor = AlertColor.Primary;
|
||||||
@@ -171,7 +172,7 @@
|
|||||||
var rsp = await hc.Post<ItemSerchGetInvoices>("Invoice/GetAll", itemsearch);
|
var rsp = await hc.Post<ItemSerchGetInvoices>("Invoice/GetAll", itemsearch);
|
||||||
if (rsp.IsSuccessStatusCode)
|
if (rsp.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
request = await rsp.Content.ReadFromJsonAsync<PagingDto<InvoiceDTO>>();
|
request = await rsp.Content.ReadFromJsonAsync<PagingDto<InvoiceGridDTO>>();
|
||||||
}
|
}
|
||||||
else if (rsp.StatusCode == System.Net.HttpStatusCode.Forbidden)
|
else if (rsp.StatusCode == System.Net.HttpStatusCode.Forbidden)
|
||||||
{
|
{
|
||||||
@@ -183,7 +184,7 @@
|
|||||||
}
|
}
|
||||||
PreloadService.Hide();
|
PreloadService.Hide();
|
||||||
}
|
}
|
||||||
public async Task CallBackCustomerItem(ActionInResultComponent result)
|
public async Task CallBackInvoiceItem(ActionInResultComponent result)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (result.Action == ComponentAction.add)
|
if (result.Action == ComponentAction.add)
|
||||||
@@ -210,42 +211,45 @@
|
|||||||
}
|
}
|
||||||
public async Task InvoiceItem(int ID)
|
public async Task InvoiceItem(int ID)
|
||||||
{
|
{
|
||||||
if (customers is null)
|
// if (customers is null)
|
||||||
customers = await GetCustomers();
|
// customers = await GetCustomers();
|
||||||
if (Patterns == null || Patterns.Count < 0)
|
// if (Patterns == null || Patterns.Count < 0)
|
||||||
|
// {
|
||||||
|
// Patterns =await fv.GetPatterns();
|
||||||
|
// }
|
||||||
|
// var parameters = new Dictionary<string, object>();
|
||||||
|
|
||||||
|
// if (ID == 0) parameters.Add("Invoice", new InvoiceDTO()
|
||||||
|
// {
|
||||||
|
// ID = 0,
|
||||||
|
// InvoiceDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
||||||
|
// InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
||||||
|
// Udate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront()
|
||||||
|
// });
|
||||||
|
// else parameters.Add("invoice", request.list.Where(w => w.ID == ID).First().Clone());
|
||||||
|
// parameters.Add("Patterns", Patterns);
|
||||||
|
// parameters.Add("Cus", customers);
|
||||||
|
// parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<ActionInResultComponent>(this, CallBackInvoiceItem));
|
||||||
|
|
||||||
|
//await modal.ShowAsync<InvoiceItem>(title: ID == 0 ? "صورتحساب جدید" : "ویرایش اطلاعات", parameters: parameters);
|
||||||
|
if (ID==0)
|
||||||
{
|
{
|
||||||
var rsp = await hc.Get("Invoice/GetPatterns");
|
hc._nav.NavigateTo($"InvoiceDetails");
|
||||||
if (rsp.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
Patterns = await rsp.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var parameters = new Dictionary<string, object>();
|
else
|
||||||
|
hc._nav.NavigateTo($"InvoiceDetails/{ID}");
|
||||||
if (ID == 0) parameters.Add("Invoice", new InvoiceDTO()
|
|
||||||
{
|
|
||||||
ID = 0,
|
|
||||||
InvoiceDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
|
||||||
InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
|
||||||
Udate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront()
|
|
||||||
});
|
|
||||||
else parameters.Add("invoice", request.list.Where(w => w.ID == ID).First().Clone());
|
|
||||||
parameters.Add("Patterns", Patterns);
|
|
||||||
parameters.Add("Cus", customers);
|
|
||||||
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<ActionInResultComponent>(this, CallBackCustomerItem));
|
|
||||||
await modal.ShowAsync<InvoiceItem>(title: ID == 0 ? "صورتحساب جدید" : "ویرایش اطلاعات", parameters: parameters);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//------------------------
|
//------------------------
|
||||||
private async Task<List<ForCustomerSearch>> GetCustomers()
|
private async Task<List<ForCustomerSearch>> GetCustomers()
|
||||||
{
|
{
|
||||||
var rsp = await hc.Get("Customer/GetAllForidName");
|
return await fv.GetCustomers();
|
||||||
if (rsp.IsSuccessStatusCode)
|
// var rsp = await hc.Get("Customer/GetAllForidName");
|
||||||
{
|
// if (rsp.IsSuccessStatusCode)
|
||||||
return await rsp.Content.ReadFromJsonAsync<List<ForCustomerSearch>>();
|
// {
|
||||||
}
|
// return await rsp.Content.ReadFromJsonAsync<List<ForCustomerSearch>>();
|
||||||
return new List<ForCustomerSearch>();
|
// }
|
||||||
|
// return new List<ForCustomerSearch>();
|
||||||
|
|
||||||
}
|
}
|
||||||
private void OnAutoCompleteChanged(ForCustomerSearch customer)
|
private void OnAutoCompleteChanged(ForCustomerSearch customer)
|
||||||
|
@@ -14,6 +14,7 @@ builder.Services.AddBlazorBootstrap();
|
|||||||
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
|
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
|
||||||
builder.Services.AddScoped<localService>();
|
builder.Services.AddScoped<localService>();
|
||||||
builder.Services.AddScoped<HttpClientController>();
|
builder.Services.AddScoped<HttpClientController>();
|
||||||
|
builder.Services.AddScoped<Fixedvalues>();
|
||||||
builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
||||||
{
|
{
|
||||||
Company = new CompanyAuthenticationDTO()
|
Company = new CompanyAuthenticationDTO()
|
||||||
|
Reference in New Issue
Block a user