...
This commit is contained in:
@@ -13,20 +13,61 @@
|
||||
@alertMessage
|
||||
</Alert>
|
||||
</div>
|
||||
<ul>
|
||||
@if (_UsedFromInvoice)
|
||||
{
|
||||
|
||||
@if (_UsedFromInvoice)
|
||||
{
|
||||
<ul>
|
||||
<li> style="color:indianred"این سند از فاکتور صادر شده، ویرایش مستقیم آن ممکن نیست</li>
|
||||
<br />
|
||||
}
|
||||
</ul>
|
||||
<div class="col-md-2">
|
||||
<AutoComplete @bind-Value="model.CODTitle"
|
||||
TItem="CODIdName<int>"
|
||||
DataProvider="CODDataProvider"
|
||||
PropertyName="Title"
|
||||
Placeholder="جستجو در کالا..."
|
||||
OnChanged="(CODIdName<int> cod) => OnAutoCompleteChanged(cod)" />
|
||||
</ul>
|
||||
}
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-6">
|
||||
<label class="col-sm-4 col-form-label" style="color:red" for="inputFullName">کالا</label>
|
||||
|
||||
<AutoComplete @bind-Value="model.CODTitle"
|
||||
TItem="CODIdName<int>"
|
||||
DataProvider="CODDataProvider"
|
||||
PropertyName="Title"
|
||||
Placeholder="جستجو در کالا..."
|
||||
OnChanged="(CODIdName<int> cod) => OnAutoCompleteChanged(cod)" />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="col-sm-4 col-form-label" style="color:red">تعداد</label>
|
||||
<InputNumber @bind-Value="model.Count" style="text-align:center" type="text" class="form-control" placeholder="تعداد" />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="col-sm-5 col-form-label" for="inputInvoicIssueDate">تاریخ</label>
|
||||
<InputText style=" text-align: center;" @bind-Value="model.Date" type="text" class="form-control" id="inputInvoicIssueDate" placeholder="تاریخ" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4">
|
||||
<label class="col-sm-4 col-form-label" style="color:red">نوع سند</label>
|
||||
|
||||
<select style="text-align:center" @bind="model.ModelTypeID" class="form-control" aria-label="Default select example">
|
||||
<option value="0" style="color: #b5b5b5" selected>نوع سند ...</option>
|
||||
@if (model.Type == TypeCirculation.Receipt)
|
||||
{
|
||||
<option value="1">خرید</option>
|
||||
<option value="2">امانت</option>
|
||||
}
|
||||
@if (model.Type == TypeCirculation.Remittance)
|
||||
{
|
||||
|
||||
<option value="3">فروش</option>
|
||||
<option value="4">امانت</option>
|
||||
}
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-8">
|
||||
<label class="col-form-label" for="inputdes">توضیحات</label>
|
||||
<InputText @bind-Value="model.info" type="text" class="form-control" id="inputdes" placeholder="توضیحات" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* <div class="col-md-2">
|
||||
<select style="text-align:center" @bind="Doctype" class="form-control" aria-label="Default select example">
|
||||
@@ -36,49 +77,23 @@
|
||||
</select>
|
||||
</div> *@
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<label class="col-sm-4 col-form-label" style="color:red" for="inputFullName">تعداد</label>
|
||||
<InputNumber @bind-Value="model.Count" type="text" class="form-control" id="inputam" placeholder="تعداد" />
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="col-sm-5 col-form-label" for="inputInvoicIssueDate">تاریخ</label>
|
||||
<InputText style=" text-align: center;" @bind-Value="model.Date" type="text" class="form-control" id="inputInvoicIssueDate" placeholder="تاریخ" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<select style="text-align:center" @bind="model.ModelTypeID" class="form-control" aria-label="Default select example">
|
||||
<option value="0" style="color: #b5b5b5" selected>نوع سند ...</option>
|
||||
@if (model.Type == TypeCirculation.Receipt)
|
||||
{
|
||||
<option value="1">خرید</option>
|
||||
<option value="2">امانت</option>
|
||||
}
|
||||
@if (model.Type == TypeCirculation.Remittance)
|
||||
{
|
||||
|
||||
<option value="3">فروش</option>
|
||||
<option value="4">امانت</option>
|
||||
}
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@if (model.Type == TypeCirculation.Receipt)
|
||||
{
|
||||
<div class="col-md-2">
|
||||
<Switch @bind-Value="forsale" Label="اجازه فروش" />
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-4" style="margin-top:30px">
|
||||
<Switch @bind-Value="forsale" Label="اجازه فروش" />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label class="col-form-label" for="inputdes">توضیحات</label>
|
||||
<InputText @bind-Value="model.info" type="text" class="form-control" id="inputdes" placeholder="توضیحات" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-10">
|
||||
@if (model.CODID == 0)
|
||||
@if (NewItem)
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAddOrUpdate" Type="ButtonType.Button">
|
||||
جدید
|
||||
@@ -117,11 +132,16 @@
|
||||
|
||||
public bool SpinnerVisible { get; set; } = false;
|
||||
|
||||
private bool forsale { get; set; } = false;
|
||||
private bool forsale { get; set; } = true;
|
||||
}
|
||||
@functions {
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
if (NewItem)
|
||||
forsale = true;
|
||||
|
||||
else
|
||||
forsale = model.ForSale.HasValue ? model.ForSale.Value : false;
|
||||
_UsedFromInvoice = model.invoiceID.HasValue;
|
||||
if (NewItem)
|
||||
model.Date = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront();
|
||||
@@ -178,6 +198,11 @@
|
||||
}
|
||||
private async Task Addorupdate()
|
||||
{
|
||||
if ((model.Type == TypeCirculation.Receipt && !await ValidateReceipt())
|
||||
|| (model.Type == TypeCirculation.Remittance && !await ValidateRemittance()))
|
||||
return;
|
||||
|
||||
|
||||
string controller = model.Type == TypeCirculation.Receipt ? "Receipt" : "Remittance";
|
||||
string route = NewItem ? "ADD" : "Update";
|
||||
ActionInResultComponent result = new ActionInResultComponent();
|
||||
@@ -186,7 +211,7 @@
|
||||
if (NewItem)
|
||||
{
|
||||
if (model.Type == TypeCirculation.Receipt)
|
||||
rsp = await hc.Post($"{controller}/{NewItem}/{model.ID}", new ReceiptDto()
|
||||
rsp = await hc.Post($"{controller}/{route}", new ReceiptDto()
|
||||
{
|
||||
CODID = model.CODID,
|
||||
Count = model.Count,
|
||||
@@ -197,7 +222,7 @@
|
||||
});
|
||||
|
||||
if (model.Type == TypeCirculation.Remittance)
|
||||
rsp = await hc.Post($"{route}/Update/{model.ID}", new RemittanceDto()
|
||||
rsp = await hc.Post($"{controller}/{route}", new RemittanceDto()
|
||||
{
|
||||
CODID = model.CODID,
|
||||
Count = model.Count,
|
||||
@@ -210,8 +235,9 @@
|
||||
else
|
||||
{
|
||||
if (model.Type == TypeCirculation.Receipt)
|
||||
rsp = await hc.Put($"{controller}/{NewItem}/{model.ID}", new ReceiptDto()
|
||||
rsp = await hc.Put($"{controller}/{route}", new ReceiptDto()
|
||||
{
|
||||
ID = model.ID,
|
||||
CODID = model.CODID,
|
||||
Count = model.Count,
|
||||
Date = model.Date,
|
||||
@@ -221,8 +247,9 @@
|
||||
});
|
||||
|
||||
if (model.Type == TypeCirculation.Remittance)
|
||||
rsp = await hc.Put($"{route}/Update/{model.ID}", new RemittanceDto()
|
||||
rsp = await hc.Put($"{controller}/{route}", new RemittanceDto()
|
||||
{
|
||||
ID = model.ID,
|
||||
CODID = model.CODID,
|
||||
Count = model.Count,
|
||||
Date = model.Date,
|
||||
@@ -232,7 +259,7 @@
|
||||
|
||||
result.Action = ComponentAction.update;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -243,15 +270,24 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
try
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
ShowDangerAlert("حظای سیستمی");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public async Task OnClickAddOrUpdate()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
await Addorupdate();
|
||||
SpinnerVisible = false;
|
||||
SpinnerVisible = true;
|
||||
await Addorupdate();
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
private async Task ShowConfirmationDeleteAsync()
|
||||
{
|
||||
@@ -298,13 +334,13 @@
|
||||
|
||||
if (model.CODID == null || model.CODID == 0)
|
||||
ShowDangerAlert("کالایی انتخاب کنید");
|
||||
if (model.Count <= 0)
|
||||
else if (model.Count <= 0)
|
||||
ShowDangerAlert("تعدادی وارد کنید");
|
||||
if (string.IsNullOrEmpty(model.Date))
|
||||
else if (string.IsNullOrEmpty(model.Date))
|
||||
ShowDangerAlert("تاریخ را مشخص کنید");
|
||||
if (model.Date.Replace("/", "").Length != 10)
|
||||
else if (model.Date.Replace("/", "").Length != 8)
|
||||
ShowDangerAlert("تاریخ صحیح نمی باشد");
|
||||
if (string.IsNullOrEmpty(model.info))
|
||||
else if (string.IsNullOrEmpty(model.info))
|
||||
ShowDangerAlert("توضیحی مشخص کنید");
|
||||
else return true;
|
||||
|
||||
|
@@ -44,12 +44,42 @@
|
||||
|
||||
if (property.CustomAttributes.Any(w => w.AttributeType.Name == "DisplayAttribute"))
|
||||
{
|
||||
if (property.PropertyType == typeof(Nullable<System.Decimal>) || property.PropertyType == typeof(System.Decimal))
|
||||
|
||||
if (property.PropertyType == typeof(Nullable<System.Decimal>)
|
||||
|| property.PropertyType == typeof(System.Decimal) && item.ToString() != "Shared.DTOs.Warehouse.CirculationDto")
|
||||
{
|
||||
<td>
|
||||
@decimal.Parse(property.GetValue(item, null).ToString()).ToString("N0") ريال
|
||||
</td>
|
||||
}
|
||||
else if (property.PropertyType == typeof(Nullable<System.Boolean>)
|
||||
|| property.PropertyType == typeof(System.Boolean))
|
||||
{
|
||||
var res = property.GetValue(item, null);
|
||||
if (res == null)
|
||||
{
|
||||
<td>
|
||||
...
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (res.ToString().ToLower()=="true")
|
||||
{
|
||||
<td>
|
||||
دارد
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>
|
||||
ندارد
|
||||
</td>
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if (property.Name.ToLower() == "id" && item.ToString() != "Shared.DTOs.SentTaxDto")
|
||||
{
|
||||
if (id > 0)
|
||||
|
@@ -204,7 +204,8 @@
|
||||
|
||||
if (result.Status==ComponentStatus.success)
|
||||
{
|
||||
await Load(1);
|
||||
await Load(1);
|
||||
await modal.HideAsync();
|
||||
}
|
||||
}
|
||||
public async Task Item(CirculationDto circulationDto)
|
||||
|
@@ -37,10 +37,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://moadiran.ir:444/api/") });
|
||||
|
||||
//Home
|
||||
//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/") });
|
||||
|
||||
//farzan
|
||||
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/") });
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
||||
|
||||
|
Reference in New Issue
Block a user