...
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Service">
|
||||
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
|
||||
<HintPath>..\..\Dlls\Service.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
|
@@ -99,7 +99,7 @@ namespace Back.Controllers
|
||||
return NotFound();
|
||||
|
||||
//permission
|
||||
order.OrderItems = item.promotionDetails.Select(s => new OrderItem
|
||||
order.OrderItems = item.promotionDetails.Where(w=>w.CreditAmount>0).Select(s => new OrderItem
|
||||
{
|
||||
APrice = pricing.Where(w => w.PermissionID == s.PermissionID).Select(c => c.Price).FirstOrDefault(),
|
||||
PermissionID = s.PermissionID,
|
||||
@@ -115,17 +115,18 @@ namespace Back.Controllers
|
||||
if (pro == null)
|
||||
return NotFound();
|
||||
|
||||
order.OrderItems=new List<OrderItem>()
|
||||
order.OrderItems = pro.PromotionDetails.Select(s => new OrderItem
|
||||
{
|
||||
new OrderItem()
|
||||
{
|
||||
PromotionID=pro.ID,
|
||||
APrice=pro.PromotionDetails.Sum(s=>s.TPrice),
|
||||
CreditAmount=1,
|
||||
Tax=0,
|
||||
Discount=0
|
||||
}
|
||||
};
|
||||
APrice =s.APrice,
|
||||
PermissionID = s.PermissionID,
|
||||
PromotionID=s.PromotionID,
|
||||
Discount = 0,
|
||||
Tax = 0,
|
||||
CreditAmount = s.CreditAmount
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
var result= await _servOrders.AddOrder(order);
|
||||
|
@@ -40,7 +40,7 @@ namespace Back.Services
|
||||
Status = w.Status,
|
||||
TDiscount = w.TDiscount,
|
||||
TPrice = w.TPrice,
|
||||
TTax = w.TPrice,
|
||||
TTax = w.TTax,
|
||||
lstDiscount = w.lstDiscount,
|
||||
}).Paging(itemSerach.PageIndex,itemSerach.PageSize);
|
||||
}
|
||||
@@ -57,9 +57,8 @@ namespace Back.Services
|
||||
Discount=s.Discount,
|
||||
ID = s.ID,
|
||||
Tax = s.Tax,
|
||||
Type= s.PermissionID.HasValue && !s.PromotionID.HasValue ? "سرویس" : !s.PermissionID.HasValue && s.PromotionID.HasValue ? "تعرفه" : "نامشخص",
|
||||
IDForType = s.PermissionID.HasValue && !s.PromotionID.HasValue ? s.PermissionID.Value : !s.PermissionID.HasValue && s.PromotionID.HasValue ? s.PromotionID.Value : 0,
|
||||
Title = s.PermissionID.HasValue && !s.PromotionID.HasValue ? s.Permission.Title : !s.PermissionID.HasValue && s.PromotionID.HasValue ? s.Promotion.Name : "",
|
||||
IDForType = s.PermissionID.Value ,
|
||||
Title = s.Permission.Title ,
|
||||
}).ToListAsync();
|
||||
}
|
||||
public async Task<Order> GetOrder(int OrderID, int CompanyID)
|
||||
|
@@ -11,7 +11,6 @@ namespace Shared.DTOs
|
||||
public int ID { get; set; }
|
||||
public string Title { get; set; }
|
||||
public int OrderID { get; set; }
|
||||
public string Type { get; set; }
|
||||
public int IDForType { get; set; }
|
||||
public int CreditAmount { get; set; }
|
||||
public decimal APrice { get; set; }
|
||||
|
@@ -171,9 +171,12 @@
|
||||
}
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
|
||||
orderSelectName = "نوع سفارش";
|
||||
Selected = null;
|
||||
values =new int[] { 0,0,0,0};
|
||||
TotalPrice = 0;
|
||||
Promotions = await fv.LoadPromotion();
|
||||
|
||||
orderstype = new List<IdName<int>>();
|
||||
orderstype.AddRange(Promotions.Select(s => new IdName<int>
|
||||
{ ID = s.ID, Title = s.Name }).ToList());
|
||||
|
||||
@@ -185,7 +188,14 @@
|
||||
orderSelectID = ID;
|
||||
orderSelectName = Title;
|
||||
|
||||
|
||||
Selected = Promotions.Where(w => w.ID == ID).First();
|
||||
|
||||
|
||||
if (ID > 0)
|
||||
TotalPrice = Selected.TotalPrice;
|
||||
|
||||
|
||||
}
|
||||
private async Task OnInput()
|
||||
{
|
||||
@@ -214,41 +224,47 @@
|
||||
}
|
||||
public async Task NewOrder()
|
||||
{
|
||||
if (Selected!=null)
|
||||
|
||||
if (Selected != null)
|
||||
{
|
||||
if (Selected.ID < 0 && (values[0] < 0 || values[1] < 0 || values[2] < 0 || values[3] < 0)) return;
|
||||
if (Selected.ID < 0 && values[0] == 0 && values[1] == 0 && values[2] == 0 && values[3] == 0) return;
|
||||
|
||||
//---------
|
||||
var itemFac = Selected.promotionDetails.Where(w => w.PermissionID == 3).FirstOrDefault();
|
||||
if (itemFac != null)
|
||||
itemFac.CreditAmount = values[0];
|
||||
var itemFac = Selected.promotionDetails.Where(w => w.PermissionID == 3).FirstOrDefault();
|
||||
if (itemFac != null)
|
||||
itemFac.CreditAmount = values[0];
|
||||
|
||||
var itemcod = Selected.promotionDetails.Where(w => w.PermissionID == 4).FirstOrDefault();
|
||||
if (itemcod != null)
|
||||
itemcod.CreditAmount = values[1];
|
||||
var itemcod = Selected.promotionDetails.Where(w => w.PermissionID == 4).FirstOrDefault();
|
||||
if (itemcod != null)
|
||||
itemcod.CreditAmount = values[1];
|
||||
|
||||
var itemcus = Selected.promotionDetails.Where(w => w.PermissionID == 5).FirstOrDefault();
|
||||
if (itemcus != null)
|
||||
itemcus.CreditAmount = values[2];
|
||||
var itemcus = Selected.promotionDetails.Where(w => w.PermissionID == 5).FirstOrDefault();
|
||||
if (itemcus != null)
|
||||
itemcus.CreditAmount = values[2];
|
||||
|
||||
var itemtax = Selected.promotionDetails.Where(w => w.PermissionID == 16).FirstOrDefault();
|
||||
if (itemtax != null)
|
||||
itemtax.CreditAmount = values[3];
|
||||
//---------
|
||||
var rsp = await hc.Post<PromotionDto>($"Orders/AddOrder", Selected);
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var newidorder = await rsp.Content.ReadFromJsonAsync<OrderDto>();
|
||||
await OnMultipleOfThree.InvokeAsync(newidorder);
|
||||
}
|
||||
else if (rsp.StatusCode==System.Net.HttpStatusCode.NotFound)
|
||||
{
|
||||
ShowDangerAlert("مرجع یافت نشد یافت نشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
var itemtax = Selected.promotionDetails.Where(w => w.PermissionID == 16).FirstOrDefault();
|
||||
if (itemtax != null)
|
||||
itemtax.CreditAmount = values[3];
|
||||
//---------
|
||||
var rsp = await hc.Post<PromotionDto>($"Orders/AddOrder", Selected);
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var newidorder = await rsp.Content.ReadFromJsonAsync<OrderDto>();
|
||||
await OnMultipleOfThree.InvokeAsync(newidorder);
|
||||
}
|
||||
else if (rsp.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
{
|
||||
ShowDangerAlert("مرجع یافت نشد یافت نشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
<input style="text-align: center;" value="@order.StatusTitle" type="text" class="form-control" id="StatusTitle" placeholder="وضغیت" readonly />
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="col-sm-5 col-form-label">تاریخ ایحاد</label>
|
||||
<label class="col-sm-5 col-form-label">تاریخ ایجاد</label>
|
||||
<InputText style="text-align: center;" @bind-Value="order.DateCreate" type="text" class="form-control" id="DateCreate" placeholder="تاریخ ایجاد" readonly />
|
||||
</div>
|
||||
@if (order.Status != StatusOrder.Create)
|
||||
@@ -45,9 +45,6 @@
|
||||
<GridColumn TItem="OrderItemDto" HeaderText="عنوان">
|
||||
@context.Title
|
||||
</GridColumn>
|
||||
<GridColumn TItem="OrderItemDto" HeaderText="نوع">
|
||||
@context.Type
|
||||
</GridColumn>
|
||||
<GridColumn TItem="OrderItemDto" HeaderText="تعداد">
|
||||
@context.CreditAmount
|
||||
</GridColumn>
|
||||
@@ -91,7 +88,7 @@
|
||||
</div> *@
|
||||
<div class="col-md-3">
|
||||
<label class="col-sm-5 col-form-label">مبلغ نهایی</label>
|
||||
<CurrencyInput style="text-align: center;" TValue="decimal" @bind-Value="order.TTax" Locale="fa-Ir" Placeholder="مبلغ نهایی" readonly />
|
||||
<CurrencyInput style="text-align: center;" TValue="decimal" @bind-Value="order.TPrice" Locale="fa-Ir" Placeholder="مبلغ نهایی" readonly />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -100,7 +97,7 @@
|
||||
@if (order.Status == StatusOrder.Create)
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickPay" Type="ButtonType.Button">
|
||||
پرداخت
|
||||
پرداخت با کیف پول
|
||||
</Button>
|
||||
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="OnClickCancel" Type="ButtonType.Button">
|
||||
ابطال
|
||||
@@ -195,13 +192,14 @@
|
||||
{
|
||||
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
var rsp = await hc.Get($"Orders/CancelOrder/{order.ID}");
|
||||
var rsp = await hc.Delete($"Orders/CancelOrder/{order.ID}");
|
||||
PreloadService.Hide();
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
if(await rsp.Content.ReadFromJsonAsync<bool>())
|
||||
{
|
||||
order.Status = StatusOrder.Cancel;
|
||||
result = new ActionInResultComponent();
|
||||
result.Status = ComponentStatus.success;
|
||||
result.Action = ComponentAction.delete;
|
||||
await OnMultipleOfThree.InvokeAsync(result);
|
||||
|
@@ -134,7 +134,7 @@ namespace Front
|
||||
Promotions.Add(new PromotionDto()
|
||||
{
|
||||
ID = -1,
|
||||
Name = "شخصی",
|
||||
Name = "شخصی سازی",
|
||||
promotionDetails = Pricing.Select(s => new PromotionDetailDto
|
||||
{
|
||||
ID = 0,
|
||||
|
@@ -207,6 +207,7 @@
|
||||
{
|
||||
await Newordermodal.HideAsync();
|
||||
await ReadOrderItem(result);
|
||||
await GetOrders(1);
|
||||
|
||||
}
|
||||
public async Task NewOrderItem()
|
||||
|
@@ -37,10 +37,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
|
||||
|
||||
//Home
|
||||
//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/") });
|
||||
|
||||
//farzan
|
||||
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");
|
||||
|
||||
|
Reference in New Issue
Block a user