public override void DataPortal_DeleteSelf(Csla.DataPortalClient.LocalProxy <Person> .CompletedHandler handler) { var svc = new PersonService.PersonServiceClient( "BasicHttpBinding_IPersonService"); svc.DeletePersonCompleted += (o, e) => { LoadProperty(IdProperty, 0); handler(this, e.Error); }; svc.DeletePersonAsync(Id); }
public void DataPortal_Fetch( SingleCriteria <Person, int> criteria, Csla.DataPortalClient.LocalProxy <Person> .CompletedHandler handler) { var svc = new PersonService.PersonServiceClient( "BasicHttpBinding_IPersonService"); svc.GetPersonCompleted += (o, e) => { LoadProperty(IdProperty, e.Result.Id); LoadProperty(FirstNameProperty, e.Result.FirstName); LoadProperty(LastNameProperty, e.Result.LastName); handler(this, e.Error); }; svc.GetPersonAsync(criteria.Value); }
public override void DataPortal_Insert(Csla.DataPortalClient.LocalProxy <Person> .CompletedHandler handler) { var svc = new PersonService.PersonServiceClient( "BasicHttpBinding_IPersonService"); svc.AddPersonCompleted += (o, e) => { LoadProperty(IdProperty, e.Result.Id); LoadProperty(FirstNameProperty, e.Result.FirstName); LoadProperty(LastNameProperty, e.Result.LastName); handler(this, e.Error); }; var obj = new PersonService.PersonData(); obj.Id = ReadProperty(IdProperty); obj.FirstName = ReadProperty(FirstNameProperty); obj.LastName = ReadProperty(LastNameProperty); svc.AddPersonAsync(obj); }