Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AmountType #16

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.11</Version>
<Version>0.0.0.12</Version>
<Description>ordering UI compoents.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>component,microcomponent,ui,core,order,ordering</PackageTags>
Expand All @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MudBlazor" Version="6.11.0" />
<PackageReference Include="MudBlazor" Version="6.11.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<MudStack Spacing="4">
<MudTextField @bind-Value="viewModel.Name" Label="Name" Variant="Variant.Text"></MudTextField>
<MudTextField @bind-Value="viewModel.PriceAmount" Label="Value Added Tax" Variant="Variant.Text"></MudTextField>
<MudSelect @bind-Value="viewModel.AmountType" Label="Amount Type" OpenIcon="@Icons.Material.Filled.LocalDrink" AdornmentColor="Color.Secondary">
@foreach (AmountType item in Enum.GetValues<AmountType>())
{
if ((int)item < 6)
continue;
<MudSelectItem Value="@item">@item.ToString()</MudSelectItem>
}
</MudSelect>
@if (viewModel.CountingUnits is not null)
{
<MudSelect T="long" @bind-Value="viewModel.SelectedCountingUnitId" Label="Counting Unit Type" Variant="Variant.Outlined" AnchorOrigin="Origin.BottomCenter">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.11</Version>
<Version>0.0.0.12</Version>
<Description>ordering view model.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>mvvm,viewmodel,viewmodels,modelviewviewmodel,ui,core,order,ordering</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ public decimal PriceAmount
}
}

AmountType _AmountType = AmountType.Percent;
public AmountType AmountType
{
get => _AmountType;
set
{
_AmountType = value;
OnPropertyChanged(nameof(AmountType));
}
}

ICollection<CountingUnitContract> _CountingUnits;
public ICollection<CountingUnitContract> CountingUnits
{
Expand Down Expand Up @@ -132,7 +143,7 @@ List<ProductPriceContract> GetPrices()
UniqueIdentity = GetCurrentProperty(x => x.Prices.Select(x=> x.UniqueIdentity).DefaultIfEmpty(null).FirstOrDefault()),
Amount = PriceAmount,
CurrencyCode = CurrencyCodeType.IRR,
AmountType = AmountType.Decimal,
AmountType = AmountType,
Type = PriceType.ValueAddedTax
}
};
Expand Down Expand Up @@ -160,14 +171,15 @@ public async Task LoadConfig()
var items = await _countingUnitClient.GetAllByLanguageAsync(new GetByLanguageRequestContract()
{
Language = "fa-IR"
}).AsCheckedResult(x=>x.Result);
}).AsCheckedResult(x => x.Result);
CountingUnits = items;
}

public void Clear()
{
Name = "";
PriceAmount = 0;
AmountType = AmountType.Percent;
UpdateProductContract = default;
CountingUnits = null;
}
Expand Down
Loading