/// <summary> /// Adds a new item to the list. /// Uses ProcyModes.LocalOnly as default. /// Override in your own class to use other ProxyModes /// </summary> protected override void AddNewCore() { var portal = new Csla.DataPortal <T>(); portal.CreateCompleted += (o, e) => { // call OnUnhandledAsyncException if failed if (e.Error != null) { OnUnhandledAsyncException(new ErrorEventArgs(this, e.Error)); } else { try { this.Add(e.Object); OnAddedNew(e.Object); } catch (Exception ex) { OnUnhandledAsyncException(new ErrorEventArgs(this, ex)); } } }; portal.BeginCreate(); }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { MarkBusy(true); var dp = new Csla.DataPortal<InvLib.ProductEdit>(); dp.DeleteCompleted += (o, e1) => { MarkBusy(false); _selectedItem = null; this.ViewEditContent.Content = null; ((CslaDataProvider)Resources["ProductList"]).Refresh(); }; InvLib.ProductList.ClearCache(); dp.BeginDelete(new Csla.SingleCriteria<InvLib.ProductEdit, int>(_selectedItem.Id)); }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { MarkBusy(true); var dp = new Csla.DataPortal <InvLib.ProductEdit>(); dp.DeleteCompleted += (o, e1) => { MarkBusy(false); _selectedItem = null; this.ViewEditContent.Content = null; ((CslaDataProvider)Resources["ProductList"]).Refresh(); }; InvLib.ProductList.ClearCache(); dp.BeginDelete(new Csla.SingleCriteria <InvLib.ProductEdit, int>(_selectedItem.Id)); }
public static ModuloFuncionalidadList Get(ModuloFuncionalidadCriteria criteria) { return(DataPortal.Fetch <ModuloFuncionalidadList>(criteria)); }