コード例 #1
0
ファイル: Person.cs プロジェクト: zuiwanting/csla
        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);
        }
コード例 #2
0
ファイル: Person.cs プロジェクト: zuiwanting/csla
        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);
        }
コード例 #3
0
ファイル: Person.cs プロジェクト: zuiwanting/csla
        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);
        }