This commit is contained in:
mmrbnjd
2024-05-27 22:01:14 +03:30
parent 66871c7425
commit 4e6f8a5c40
4 changed files with 19 additions and 25 deletions

View File

@@ -35,7 +35,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Service"> <Reference Include="Service">
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath> <HintPath>..\..\Dlls\Service.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>

View File

@@ -98,10 +98,10 @@ namespace Back.Controllers
} }
[HttpPut("Update")] [HttpPut("Update")]
public async Task<ActionResult<int>> Update([FromBody] NUInvoiceDTO item) public async Task<ActionResult<bool>> Update([FromBody] NUInvoiceDTO item)
{ {
if (!ModelState.IsValid) //if (!ModelState.IsValid)
return BadRequest(item); // return BadRequest(item);
//-----GetUserAndCompany //-----GetUserAndCompany
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID"); var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
@@ -125,7 +125,7 @@ namespace Back.Controllers
if (await _servTaxPayer.ExistSuccessfulorSendorpendingInvoice(invoice)) if (await _servTaxPayer.ExistSuccessfulorSendorpendingInvoice(invoice))
return BadRequest(new List<string> { "این صورتحساب به سازمان ارسال شده"+'\n'+ return BadRequest(new List<string> { "این صورتحساب به سازمان ارسال شده"+'\n'+
"برای تغییر ،صورتحساب را ابطال/اصلاح یا برگشت بزنید"}); "برای تغییر ،صورتحساب را ابطال/اصلاح یا برگشت بزنید"});
else if (invoice.invoiceType != InvoiceType.BackFrmSale) else if (invoice.invoiceType == InvoiceType.BackFrmSale)
{ {
return BadRequest(new List<string> return BadRequest(new List<string>
{ "صورتحساب در وضعیت برگشت از فروش نمی تواند ویرایش شود" }); { "صورتحساب در وضعیت برگشت از فروش نمی تواند ویرایش شود" });

View File

@@ -27,8 +27,7 @@
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-2">
<label class="col-sm-4 col-form-label" for="inputinvoiceTypeTitle">نوع</label> <label class="col-sm-4 col-form-label" for="inputinvoiceTypeTitle">نوع</label>
@if (InvoiceID == 0 || InvoiceID == null ? false : true){ <select @bind="invoice.invoiceType" class="form-control" aria-label="Default select example" disabled id="inputinvoiceTypeTitle">
<select @bind="invoice.invoiceType" disabled class="form-control" aria-label="Default select example" id="inputinvoiceTypeTitle">
@if (!invoice.invoiceType.HasValue) @if (!invoice.invoiceType.HasValue)
{ {
<option value="0" style="color: #b5b5b5" selected>انتخاب کنید...</option> <option value="0" style="color: #b5b5b5" selected>انتخاب کنید...</option>
@@ -54,15 +53,8 @@
} }
</select>
} </select>
else
{
<select @bind="invoice.invoiceType" class="form-control" aria-label="Default select example" disabled id="inputinvoiceTypeTitle">
<option value="10" style="color: #b5b5b5" selected>پیشنهاد قیمت</option>
</select>
}
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-2">
@@ -188,7 +180,7 @@
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<br /> <br />
@if (invoice.ID == 0) @if(InvoiceID == 0 || InvoiceID == null)
{ {
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button"> <Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
جدید جدید
@@ -249,6 +241,7 @@
{ {
invoice = new InvoiceDTO() invoice = new InvoiceDTO()
{ {
invoiceType=InvoiceType.Bidding,
ID = 0, ID = 0,
InvoiceDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(), InvoiceDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(), InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
@@ -345,7 +338,7 @@
var request = await rsp.Content.ReadFromJsonAsync<bool>(); var request = await rsp.Content.ReadFromJsonAsync<bool>();
if (request) if (request)
{ {
ToastService.Notify(new ToastMessage(ToastType.Success, $"عملیات حذف با موفقیت انجام شد")); //ToastService.Notify(new ToastMessage(ToastType.Success, $"عملیات حذف با موفقیت انجام شد"));
hc._nav.NavigateTo("Invoice"); hc._nav.NavigateTo("Invoice");
} }
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده"); else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
@@ -371,18 +364,19 @@
ID = InvoiceID, ID = InvoiceID,
CustomerID = invoice.CustomerID, CustomerID = invoice.CustomerID,
Des = invoice.Des, Des = invoice.Des,
InvoiceDate = invoice.InvoiceDate, InvoiceDate = invoice.InvoiceDate.Replace("/", ""),
InvoicIssueDate = invoice.InvoicIssueDate, InvoicIssueDate = invoice.InvoicIssueDate.Replace("/", ""),
PatternID = invoice.PatternID, PatternID = invoice.PatternID,
Title = invoice.Title Title = invoice.Title
}); });
if (rsp.IsSuccessStatusCode) if (rsp.IsSuccessStatusCode)
{ {
var request = await rsp.Content.ReadFromJsonAsync<int>(); var request = await rsp.Content.ReadFromJsonAsync<bool>();
if (request > 0) if (request)
{ {
InvoiceID = request; ToastService.Notify(new ToastMessage(ToastType.Success, $"عملیات با موفقیت انجام شد"));
} }
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده"); else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
} }

View File

@@ -34,9 +34,9 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
}) ; }) ;
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") }); //builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir"); CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");