コード例 #1
0
        public IHttpActionResult ValidateCredentials([FromUri] SalesForceCredentials credentials)
        {
            if (!ModelState.IsValid)
            {
                return(Unauthorized());
            }

            crmService = new SalesForceService();

            if (crmService.Validate(credentials))
            {
                return(Ok());
            }
            else
            {
                return(Unauthorized());
            }
        }
コード例 #2
0
        public IHttpActionResult ValidateCredentials([FromUri] SalesForceCredentials credentials)
        {
            try
            {
                service = new SalesForceService();
                if (service.Validate(credentials))
                {
                    service.logout();

                    return(Ok());
                }
            }
            catch (NullReferenceException)
            {
                return(BadRequest());
            }

            return(Unauthorized());
        }
コード例 #3
0
        public IHttpActionResult GetAllContacts(string campaignId, [FromUri] SalesForceCredentials credentials, [FromUri] string[] fields, [FromUri] int top = 0, [FromUri] bool translate = true)
        {
            if (!ModelState.IsValid)
            {
                return(Unauthorized());
            }

            crmService = new SalesForceService();

            if (crmService.Validate(credentials))
            {
                var contacts = crmService.GetContactsInCampaign(campaignId, translate, top, fields);

                return(Ok(contacts));
            }
            else
            {
                return(Unauthorized());
            }
        }
コード例 #4
0
        public IHttpActionResult GetAllCampaigns([FromUri] SalesForceCredentials credentials, [FromUri] bool translate = false)
        {
            if (!ModelState.IsValid)
            {
                return(Unauthorized());
            }

            crmService = new SalesForceService();

            if (crmService.Validate(credentials))
            {
                var campaigns = crmService.GetCampaigns(translate);

                return(Ok(campaigns));
            }
            else
            {
                return(Unauthorized());
            }
        }
コード例 #5
0
        public IHttpActionResult GetAllContacts(string campaignId, [FromUri] SalesForceCredentials credentials, [FromUri] string[] fields, [FromUri] int top = 0, [FromUri] bool translate = true)
        {
            try
            {
                service = new SalesForceService();

                if (service.Validate(credentials))
                {
                    var contacts = service.GetContactsInCampaign(campaignId, translate, top, fields);
                    service.logout();

                    return(Ok(contacts));
                }
            }
            catch (NullReferenceException)
            {
                return(BadRequest());
            }

            return(Unauthorized());
        }
コード例 #6
0
        public IHttpActionResult GetAllCampaigns([FromUri] SalesForceCredentials credentials, [FromUri] bool translate = false)
        {
            try
            {
                service = new SalesForceService();

                if (service.Validate(credentials))
                {
                    var campaigns = service.GetCampaigns(translate);
                    service.logout();

                    return(Ok(campaigns));
                }
            }
            catch (NullReferenceException)
            {
                return(BadRequest());
            }

            return(Unauthorized());
        }
 public OpportunitiesController()
 {
     _dbConnector       = new SfdcDatabaseConnector();
     _salesForceService = new SalesForceService();
 }
コード例 #8
0
 public LeadsController()
 {
     _dbConnector       = new SfdcDatabaseConnector();
     _salesForceService = new SalesForceService();
 }
コード例 #9
0
        private readonly SalesforceRepository _repository; // Responsible for performing Saleforce operations

        public OpportunityLineitemsController()
        {
            _repository = new SalesforceRepository();
            _client     = new SalesForceService();
        }