public async Task AddRowkeydown(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args)
{
if (args.Key == "Enter")
{
styleBomLeatherSetup = (StyleBomLeatherSetup)styleBomLeatherDisplaySetup.Clone();
if (gridmode != CommonClassEnum.FormModes.Edit)
{
int maxno = 0;
if (styleBomLeatherSetups.Count > 0)
maxno = styleBomLeatherSetups.Max(t => t.StyleBomLeatherID);
if (changes.AddedRecords.Count > 0)
{
maxno = changes.AddedRecords.Max(t => t.StyleBomLeatherID);
}
styleBomLeatherSetup.TempID = maxno + 1;
styleBomLeatherSetup.Mode = "N";
//await gridRef.AddRecordAsync(styleBomLeatherSetup);
styleBomLeatherSetups.Add(styleBomLeatherSetup);
gridRef.Refresh();
}
else
{
gridRef.Refresh();
}
await ClearAll();
}
}
public async Task ClearAll()
{
EditEnabled = true;
FixEnabled = true;
DisableButton = false;
styleBomLeatherDisplaySetup.PartNoID = null;
styleBomLeatherDisplaySetup.TypeID = null;
styleBomLeatherDisplaySetup.LeatherID = null;
styleBomLeatherDisplaySetup.ColorID = null;
styleBomLeatherDisplaySetup.Norms = null;
styleBomLeatherDisplaySetup.Remarks = null;
styleBomLeatherDisplaySetup.Wastage = null;
styleBomLeatherDisplaySetup.TotalNorms = null;
gridmode = CommonClassEnum.FormModes.Add;
await typeIdRef.FocusAsync();
}
protected async Task OnEditClicked(StyleBomLeatherSetup args)
{
gridmode = CommonClassEnum.FormModes.Edit;
styleBomLeatherDisplaySetup = args;
EditEnabled = false;
await txtnorms.FocusAsync();
}