示例#1
0
 static void Main(string[] args)
 {
     if (args.Length > 0)
     {
         if (args[0] != "/all")
         {
             var connector = new CRMConnector();
             connector.CreateChangleLogForSolution(args[0]);
         }
     }
     else
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.Run(new MainForm());
     }
 }
        public static void Main()
        {
            var userName            = ConfigurationManager.AppSettings.Get("userName");
            var password            = ConfigurationManager.AppSettings.Get("password");
            var soapOrgServiceUri   = ConfigurationManager.AppSettings.Get("soapOrgServiceUri");
            var sqlConnectionString = ConfigurationManager.AppSettings.Get("sqlConnectionString");

            using (var crmConnector = new CRMConnector(userName, password, soapOrgServiceUri))
            {
                crmConnector.Execute();
                var crmConnectionState = (CRMConnectionState)crmConnector.GetConnectState();
                if (crmConnectionState.IsConnect)
                {
                    using (var sqlConnector = new SQLConnector(sqlConnectionString))
                    {
                        sqlConnector.Execute();
                        var sqlConnectionState = (SQLConnectionState)sqlConnector.GetConnectState();
                        if (sqlConnectionState.IsConnect)
                        {
                            var orgService    = (IOrganizationService)crmConnectionState.Proxy;
                            var sqlConnection = sqlConnectionState.SqlConnection;

                            // Извлечение
                            var retriever    = new Retriever(sqlConnection);
                            var allRetrieved = retriever.Execute();

                            // Обновление
                            var updater    = new Updater(orgService, sqlConnection);
                            var allUpdated = updater.Execute(allRetrieved);

                            // Удаление
                            var deleter = new Deleter(orgService, sqlConnection);
                            deleter.Execute(allRetrieved);
                        }
                    }
                }
            }
        }
示例#3
0
 public void TestCRMConnection()
 {
     CRMConnector.CRMConnectorTest();
 }