Fix Model No Field

Fix Model No Field and added new remarks field
pull/1/head
paulcortez 2 years ago
parent 89e765bb69
commit 7889ffab7e

@ -330,6 +330,9 @@ namespace ItemServices
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByModelnoStartsWith", ReplyAction="http://tempuri.org/IItemService/GetItemListByModelnoStartsWithResponse")]
System.Threading.Tasks.Task<ItemServices.items[]> GetItemListByModelnoStartsWithAsync(string modelno);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByModelnoStartsWithAndLimit", ReplyAction="http://tempuri.org/IItemService/GetItemListByModelnoStartsWithAndLimitResponse")]
System.Threading.Tasks.Task<ItemServices.items[]> GetItemListByModelnoStartsWithAndLimitAsync(string modelno, int limit);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByDescription", ReplyAction="http://tempuri.org/IItemService/GetItemListByDescriptionResponse")]
System.Threading.Tasks.Task<ItemServices.items[]> GetItemListByDescriptionAsync(string description);
@ -616,6 +619,11 @@ namespace ItemServices
return base.Channel.GetItemListByModelnoStartsWithAsync(modelno);
}
public System.Threading.Tasks.Task<ItemServices.items[]> GetItemListByModelnoStartsWithAndLimitAsync(string modelno, int limit)
{
return base.Channel.GetItemListByModelnoStartsWithAndLimitAsync(modelno, limit);
}
public System.Threading.Tasks.Task<ItemServices.items[]> GetItemListByDescriptionAsync(string description)
{
return base.Channel.GetItemListByDescriptionAsync(description);

@ -16,7 +16,7 @@
<MudAutocomplete T="string" Label="Enter Branch Code" @bind-Value="selectedBranch" SearchFunc="@SearchBranch" CoerceValue=false />
</MudItem>
<MudItem xs="12" md="4">
<MudAutocomplete T="string" Label="Enter Model No." @bind-Value="selectedModelNo" SearchFunc="@SearchModelNo" CoerceValue=false />
<MudTextField T="string" Label="Enter Model No." @bind-Value="modelNo" />
</MudItem>
<MudItem xs="12" md="3">
<MudButton Variant="Variant.Filled" Color="Color.Primary" ButtonType="ButtonType.Button" OnClick="GetRecord" FullWidth="true" Disabled=@disableStatusGetRecord>Get Record</MudButton>
@ -36,12 +36,18 @@
<MudCard>
<MudCardContent>
<MudGrid>
<MudItem sm="4">
<MudItem sm="12" md="4">
<MudField Label="@branchItemLedger.modelno" Variant="Variant.Outlined">@branchItemLedger.itemcode</MudField>
</MudItem>
<MudItem sm="8">
<MudItem sm="12" md="8">
<MudField Label="Remarks" Variant="Variant.Outlined">@branchItemLedger.remarks</MudField>
</MudItem>
<MudItem sm="12">
<MudField Label="New Remarks" Variant="Variant.Outlined">@newRemarks</MudField>
</MudItem>
<MudItem sm="12">
<MudText Typo="Typo.body1"><b>Remarks</b> above is the existing value of remarks on particular item while <b>New Remarks</b> is the remarks that will be added to Remarks after changes had been saved.</MudText>
</MudItem>
</MudGrid>
<MudText Typo="Typo.body1" Class="my-3" Color="Color.Primary">Edit the details below</MudText>
<MudGrid>
@ -81,7 +87,7 @@ else
@code {
BranchServices.branch[]? branchList;
string? selectedBranch, selectedModelNo;
string? selectedBranch, modelNo, newRemarks;
BranchItemLedgerServices.branchitemledger? branchItemLedger = null;
bool disableStatusGetRecord = false, disableStatusSave = true;
@ -105,20 +111,6 @@ else
return branchList.Where(c => c.brCode.Contains(value, StringComparison.InvariantCultureIgnoreCase)).Select(c=>c.brCode);
}
async Task<IEnumerable<string>> SearchModelNo(string value)
{
ItemServices.items[] itemList;
if (string.IsNullOrEmpty(value) || value.Length < 2)
{
itemList = await itemServiceClient.GetTopDataAsync(10);
return itemList.Select(c => c.modelno);
}
itemList = await itemServiceClient.GetItemListByModelnoStartsWithAsync(value);
return itemList.Select(c => c.modelno);
}
async Task GetRecord()
{
if(string.IsNullOrEmpty(selectedBranch))
@ -132,7 +124,7 @@ else
return;
}
if (string.IsNullOrEmpty(selectedModelNo))
if (string.IsNullOrEmpty(modelNo))
{
var dialogParam = new DialogParameters();
dialogParam.Add("ContentText", "No model number. Please enter in the Model Number field");
@ -146,7 +138,8 @@ else
disableStatusGetRecord = true;
disableStatusSave = true;
branchItemLedger = await branchItemLedgerServiceClient.GetRemoteDataByBrCodeModelnoAsync(selectedBranch, selectedModelNo);
branchItemLedger = await branchItemLedgerServiceClient.GetRemoteDataByBrCodeModelnoAsync(selectedBranch, modelNo);
newRemarks = $"Manually edit by {userService?.CurrentUser?.fullName}. {DateTime.Now:MM/dd/yyyy hh:mm:sstt}";
disableStatusGetRecord = false;
disableStatusSave = false;
@ -160,8 +153,7 @@ else
disableStatusGetRecord = true;
disableStatusSave = true;
branchItemLedger.remarks = $"|Manually edit by {userService?.CurrentUser?.fullName}. {DateTime.Now:MM/dd/yyyy} [{branchItemLedger.beginningqty} {branchItemLedger.inqty} {branchItemLedger.outqty} {branchItemLedger.sales} {branchItemLedger.adjustment} {branchItemLedger.endingqty}]";
branchItemLedger.remarks = $"|Manually edit by {userService?.CurrentUser?.fullName}. {DateTime.Now:MM/dd/yyyy hh:mm:sstt} [{branchItemLedger.beginningqty} {branchItemLedger.inqty} {branchItemLedger.outqty} {branchItemLedger.sales} {branchItemLedger.adjustment} {branchItemLedger.endingqty}]";
int result = await branchItemLedgerServiceClient.UpdateRemoteBranchItemLedgerAsync(branchItemLedger);
if(result > 0)

Loading…
Cancel
Save