protected virtual async Task OnAfterInsert(GridCreateComponent <T> component) { if (AfterInsert != null) { await AfterInsert.Invoke(component, _item); } }
protected virtual async Task <bool> OnBeforeInsert(GridCreateComponent <T> component) { if (BeforeInsert != null) { return(await BeforeInsert.Invoke(component, _item)); } return(true); }
public async Task CreateItem(GridCreateComponent <T> component) { try { bool isValid = await OnBeforeInsert(component); if (isValid) { await((CGrid <T>)Grid).CrudDataService.Insert(_item); ((CGrid <T>)Grid).Mode = GridMode.Grid; CrudRender = null; _fromCrud = true; await UpdateGrid(); } } catch (Exception e) { Console.WriteLine(e.Message); throw; } }