Exemple #1
0
        public int InitializeConsoleSPRutility(string projectName, string fileToOpen, string lstComponents)
        {
            try
            {
                syncUtility = new SPRSynchronizationUtility(logFile, projectName, "SPRUtil");
                syncUtility.UpdateMdbFile(fileToOpen);
                List <string> lstitems;
                if (lstComponents.Contains(','))
                {
                    string[] arr = lstComponents.Split(',');
                    lstitems = new List <string>(arr);
                }
                else
                {
                    lstitems = new List <string>();
                    lstitems.Add(lstComponents);
                }

                syncUtility.MDBSynchronization(lstitems);
                SaveLoggingFile();
                return(0);
            }
            catch (Exception ex)
            {
                logFile.WriteLine("Please check the parameters : " + ex.Message);
                return(1);
            }
        }
        public int InitializeConsoleSPRutility(string projectName, string fileToOpen, string lstComponents)
        {
            try
            {
                syncUtility = new SPRSynchronizationUtility(logFile, projectName, "SPRUtil");
                syncUtility.UpdateMdbFile(fileToOpen);
                List<string> lstitems;
                if (lstComponents.Contains(','))
                {
                    string[] arr = lstComponents.Split(',');
                    lstitems = new List<string>(arr);
                }
                else
                {
                    lstitems = new List<string>();
                    lstitems.Add(lstComponents);
                }

                syncUtility.MDBSynchronization(lstitems);
                SaveLoggingFile();
                return 0;
            }
            catch (Exception ex)
            {
                logFile.WriteLine("Please check the parameters : " + ex.Message);
                return 1;
            }
        }
Exemple #3
0
        private void clistboxScopes_SelectedIndexChanged(object sender, EventArgs e)
        {
            string scope = string.Empty, app = string.Empty;

            // Based on the selected scope, serach for its configuration.
            foreach (object scopeChecked in clistboxScopes.CheckedItems)
            {
                DirectoryInfo appDataDir        = new DirectoryInfo(_dataPath);
                string        filterFilePattern = String.Format("Configuration." + scopeChecked + ".*.xml");
                FileInfo[]    filterFiles       = appDataDir.GetFiles(filterFilePattern);

                foreach (FileInfo file in filterFiles)    // Each scope must have only one configuration file.
                {
                    string   fileName = Path.GetFileNameWithoutExtension(file.Name);
                    string[] names    = fileName.Split('.');
                    if (names.Length == 3)
                    {
                        scope = names[1];
                        app   = names[2];
                    }
                    else
                    {
                        logFile.WriteLine("Please check the configuration file name : " + fileName);
                    }
                    break;
                }

                if (string.IsNullOrEmpty(scope) || string.IsNullOrEmpty(app))
                {
                    logFile.WriteLine("Configuration file Not Found : Configuration.{0}.{1}.xml");
                    return;
                }
                // Based on the Scope and app selected, do all the settings.
                syncUtility = new SPRSynchronizationUtility(logFile, scope, app);

                // Load all the objects from the corresponding dictionary.
                List <org.iringtools.library.DataObject> objects = syncUtility.GetObjects();

                clistboxCommodities.Items.Clear();
                foreach (org.iringtools.library.DataObject obj in objects)
                {
                    clistboxCommodities.Items.Add(obj.objectName);
                }
                for (int i = 0; i < clistboxCommodities.Items.Count; i++)
                {
                    clistboxCommodities.SetItemChecked(i, true);
                }
            }
            if (clistboxScopes.CheckedItems.Count == 0)
            {
                clistboxCommodities.Items.Clear();
            }
        }
        private void clistboxScopes_SelectedIndexChanged(object sender, EventArgs e)
        {
            string scope =string.Empty, app = string.Empty;
            // Based on the selected scope, serach for its configuration.
            foreach (object scopeChecked in clistboxScopes.CheckedItems)
            {
                DirectoryInfo appDataDir = new DirectoryInfo(_dataPath);
                string filterFilePattern = String.Format("Configuration." + scopeChecked + ".*.xml");
                FileInfo[] filterFiles = appDataDir.GetFiles(filterFilePattern);

                foreach (FileInfo file in filterFiles)    // Each scope must have only one configuration file.
                {
                    string fileName = Path.GetFileNameWithoutExtension(file.Name);
                    string[] names = fileName.Split('.');
                    if (names.Length == 3)
                    {
                         scope = names[1];
                         app = names[2];
                    }
                    else
                    {
                        logFile.WriteLine("Please check the configuration file name : " + fileName);
                    }
                    break;
                }

                if (string.IsNullOrEmpty(scope) || string.IsNullOrEmpty(app))
                {
                    logFile.WriteLine("Configuration file Not Found : Configuration.{0}.{1}.xml");
                    return;
                }
                // Based on the Scope and app selected, do all the settings.
                syncUtility = new SPRSynchronizationUtility(logFile,scope,app);

                // Load all the objects from the corresponding dictionary.
                List<org.iringtools.library.DataObject> objects = syncUtility.GetObjects();

                clistboxCommodities.Items.Clear();
                foreach (org.iringtools.library.DataObject obj in objects)
                {
                    clistboxCommodities.Items.Add(obj.objectName);
                }
                for (int i = 0; i < clistboxCommodities.Items.Count; i++)
                {
                    clistboxCommodities.SetItemChecked(i, true);
                }
            }
            if (clistboxScopes.CheckedItems.Count == 0)
            {
                clistboxCommodities.Items.Clear();
            }
        }