Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public CrmSoapService()
 {
     // Get Setting SettingsHelper
     _settings = SettingsService.Instance;
     // Instantiate proxy
     _proxy            = new OrganizationDataWebServiceProxy();
     _proxy.ServiceUrl = _settings.ServerUrl;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public CrmSoapService()
 {           
     // Get Setting SettingsHelper
     _settings = SettingsService.Instance;
     // Instantiate proxy
     _proxy = new OrganizationDataWebServiceProxy();
     _proxy.ServiceUrl = _settings.ServerUrl;
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 static CRMHelper()
 {
     proxy            = new OrganizationDataWebServiceProxy();
     proxy.ServiceUrl = ServerUrl;
     proxy.EnableProxyTypes();
 }
        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);
            }
        }
Exemplo n.º 7
0
 public CRMContext()
 {
     proxy = new OrganizationDataWebServiceProxy();
     proxy.ServiceUrl = ServerUrl;
 }
        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);
        }