コード例 #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public CrmSoapService()
 {
     // Get Setting SettingsHelper
     _settings = SettingsService.Instance;
     // Instantiate proxy
     _proxy            = new OrganizationDataWebServiceProxy();
     _proxy.ServiceUrl = _settings.ServerUrl;
 }
コード例 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public CrmSoapService()
 {           
     // Get Setting SettingsHelper
     _settings = SettingsService.Instance;
     // Instantiate proxy
     _proxy = new OrganizationDataWebServiceProxy();
     _proxy.ServiceUrl = _settings.ServerUrl;
 }
コード例 #3
0
        async private void GetAccounts(string accessToken)
        {
            OrganizationDataWebServiceProxy orgService = new OrganizationDataWebServiceProxy
            {
                ServiceUrl  = CrmUrl,
                AccessToken = accessToken
            };

            //Get "Sample" Accounts - make this more meaningful & add paging
            QueryExpression query = new QueryExpression
            {
                EntityName = "account",
                ColumnSet  = new ColumnSet("name", "address1_latitude", "address1_longitude"),
                TopCount   = 10,
                Orders     = new DataCollection <OrderExpression>
                {
                    new OrderExpression
                    {
                        AttributeName = "name",
                        OrderType     = OrderType.Descending
                    }
                },
                Criteria = new FilterExpression
                {
                    Conditions =
                    {
                        new ConditionExpression
                        {
                            EntityName    = "account",
                            AttributeName = "name",
                            Operator      = ConditionOperator.Like,
                            Values        = { "%sample%" }
                        }
                    }
                }
            };

            EntityCollection response = await orgService.RetrieveMultiple(query);

            foreach (Entity account in response.Entities)
            {
                _dataSource.Objects.Insert(0, account);

                using (var indexPath = NSIndexPath.FromRowSection(0, 0))
                    TableView.InsertRows(new[] { indexPath }, UITableViewRowAnimation.Automatic);
            }
        }
コード例 #4
0
        async partial void SetLatLong(UIBarButtonItem sender)
        {
            OrganizationDataWebServiceProxy orgService = new OrganizationDataWebServiceProxy
            {
                ServiceUrl  = MasterViewController.CrmUrl,
                AccessToken = NSUserDefaults.StandardUserDefaults.StringForKey("AccessToken")
            };

            Entity account = (Entity)_detailItem;

            account["address1_latitude"]  = _iPhoneLocationManager.Location.Coordinate.Latitude;
            account["address1_longitude"] = _iPhoneLocationManager.Location.Coordinate.Longitude;

            AccountLatitude.Text  = _iPhoneLocationManager.Location.Coordinate.Latitude.ToString(CultureInfo.InvariantCulture);
            AccountLongitude.Text = _iPhoneLocationManager.Location.Coordinate.Longitude.ToString(CultureInfo.InvariantCulture);

            await orgService.Update(account);
        }
コード例 #5
0
 static CRMHelper()
 {
     proxy            = new OrganizationDataWebServiceProxy();
     proxy.ServiceUrl = ServerUrl;
     proxy.EnableProxyTypes();
 }
コード例 #6
0
        async private void GetAccounts(string accessToken)
        {
            OrganizationDataWebServiceProxy orgService = new OrganizationDataWebServiceProxy
            {
                ServiceUrl = CrmUrl,
                AccessToken = accessToken
            };

            //Get "Sample" Accounts - make this more meaningful & add paging
            QueryExpression query = new QueryExpression
            {
                EntityName = "account",
                ColumnSet = new ColumnSet("name", "address1_latitude", "address1_longitude"),
                TopCount = 10,
                Orders = new DataCollection<OrderExpression>
                    {
                        new OrderExpression
                        {
                            AttributeName = "name",
                            OrderType = OrderType.Descending
                        }
                    },
                Criteria = new FilterExpression
                {
                    Conditions =
                        {
                            new ConditionExpression
                            {
                                EntityName = "account",
                                AttributeName = "name",
                                Operator = ConditionOperator.Like,
                                Values = {"%sample%"}
                            }
                        }
                }
            };

            EntityCollection response = await orgService.RetrieveMultiple(query);

            foreach (Entity account in response.Entities)
            {
                _dataSource.Objects.Insert(0, account);

                using (var indexPath = NSIndexPath.FromRowSection(0, 0))
                    TableView.InsertRows(new[] { indexPath }, UITableViewRowAnimation.Automatic);
            }
        }
コード例 #7
0
ファイル: CRMHelper.cs プロジェクト: angelcdz/Oltiva
 public CRMContext()
 {
     proxy = new OrganizationDataWebServiceProxy();
     proxy.ServiceUrl = ServerUrl;
 }
コード例 #8
0
        async partial void SetLatLong(UIBarButtonItem sender)
        {
            OrganizationDataWebServiceProxy orgService = new OrganizationDataWebServiceProxy
            {
                ServiceUrl = MasterViewController.CrmUrl,
                AccessToken = NSUserDefaults.StandardUserDefaults.StringForKey("AccessToken")
            };

            Entity account = (Entity)_detailItem;
            account["address1_latitude"] = _iPhoneLocationManager.Location.Coordinate.Latitude;
            account["address1_longitude"] = _iPhoneLocationManager.Location.Coordinate.Longitude;

            AccountLatitude.Text = _iPhoneLocationManager.Location.Coordinate.Latitude.ToString(CultureInfo.InvariantCulture);
            AccountLongitude.Text = _iPhoneLocationManager.Location.Coordinate.Longitude.ToString(CultureInfo.InvariantCulture);

            await orgService.Update(account);
        }