Skip to content

Commit

Permalink
Merge pull request #16 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
Add support for AmountType
  • Loading branch information
Ali-YousefiTelori authored Dec 1, 2023
2 parents edfef3e + b3c59aa commit 1fc689a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
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

0 comments on commit 1fc689a

Please sign in to comment.