Example #1
0
        public void ConnectToCrm(CrmParameter crmParameter)
        {
            CrmServiceClient conn;

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            if (string.IsNullOrEmpty(crmParameter.ConnectionString))
            {
                throw new Exception($"Connection parameter is missing: {crmParameter}");
            }

            conn = new CrmServiceClient(crmParameter.ConnectionString);

            if (crmParameter.UserName is null)
            {
                crmParameter.UserName = conn.OAuthUserId;
            }

            try
            {
                OrganizationService = (IOrganizationService)conn.OrganizationWebProxyClient != null ? conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
            }
            catch (Exception e)
            {
                throw new Exception("Error establishing connection to Dynamics. Inner exception: " + e.InnerException);
            }

            if (OrganizationService == null)
            {
                throw new Exception("Error establishing connection to Dynamics");
            }
        }
Example #2
0
        public CiBase(string dynamicsConnectionString, int timeoutMinutes)
        {
            var crmParameter = new CrmParameter(dynamicsConnectionString)
            {
                ConnectionTimeOutMinutes = timeoutMinutes
            };

            ConnectToCrm(crmParameter);
        }
Example #3
0
 public DataImport(CrmParameter crmParameter, string[] targetDataReplaceInputFileNames) : base(crmParameter)
 {
     _transformData = new TransformData();
     _transformData.AddTransformsFromFile(targetDataReplaceInputFileNames);
 }
Example #4
0
 public DataExport(CrmParameter crmParameter, string fetchXmlFile) : base(crmParameter)
 {
     InitDataExport(fetchXmlFile);
 }
Example #5
0
 public SolutionTool(CrmParameter crmParameter) : base(crmParameter)
 {
 }
Example #6
0
 public CiBase(CrmParameter crmParameter)
 {
     CrmParameter = crmParameter;
     ConnectToCrm(crmParameter);
 }
Example #7
0
        public CiBase(string dynamicsConnectionString)
        {
            var crmParameter = new CrmParameter(dynamicsConnectionString);

            ConnectToCrm(crmParameter);
        }
Example #8
0
 public AutoNumber(CrmParameter crmParameter) : base(crmParameter)
 {
 }
Example #9
0
 public PluginManager(CrmParameter crmParameter) : base(crmParameter)
 {
 }
Example #10
0
 public RecordManager(CrmParameter crmParameter) : base(crmParameter)
 {
 }