Exemplo n.º 1
0
 protected virtual async Task OnAfterUpdate(GridUpdateComponent <T> component)
 {
     if (AfterUpdate != null)
     {
         await AfterUpdate.Invoke(component, _item);
     }
 }
Exemplo n.º 2
0
 protected virtual async Task <bool> OnBeforeUpdate(GridUpdateComponent <T> component)
 {
     if (BeforeUpdate != null)
     {
         return(await BeforeUpdate.Invoke(component, _item));
     }
     return(true);
 }
Exemplo n.º 3
0
        public async Task UpdateItem(GridUpdateComponent <T> component)
        {
            try
            {
                bool isValid = await OnBeforeUpdate(component);

                if (isValid)
                {
                    await((CGrid <T>)Grid).CrudDataService.Update(_item);
                    ((CGrid <T>)Grid).Mode = GridMode.Grid;
                    CrudRender             = null;
                    _fromCrud = true;
                    await UpdateGrid();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }