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