private void btn_forward_Click(object sender, RoutedEventArgs e)
        {
            App.Current.Properties[Constants.ApplicationProperties.CurrentStep] = Constants.ApplicationProperties.Steps.step4;
            App.Current.Properties[Constants.ApplicationProperties.NextStep] = Constants.ApplicationProperties.Steps.step5;

            var snc = new SNC_DataAccess();
            var attach = new SNC_AttachmentDataAccess();
            var fileDataAccess = new FileDataAccess();
            var tableName = App.Current.Properties[Constants.ApplicationProperties.SelectedTable].ToString();

            var fileUploadOption = (bool)App.Current.Properties[Constants.ApplicationProperties.CSVFileUpload];
            var csvUploadColumn = (string)App.Current.Properties[Constants.ApplicationProperties.CSVUploadColumn];
            var dsFile = fileDataAccess.GetCSVFile(viewModel.CSVFilePath, viewModel.CSVFileName);

            foreach (DataRow row in dsFile.Tables[0].Rows)
            {
                var parameters = GetParameters(row);              
                var UID = snc.CreateSNCObject(tableName, parameters);
                try
                {
                    if (fileUploadOption)
                        attach.AttachFile(UID, row[csvUploadColumn].ToString());
                }
                catch { }
            }
            NavigationService.Navigate(new FinishedView(dsFile.Tables[0].Rows.Count, dsFile.Tables[0].Rows.Count));
        }
        public TableSelectViewModel()
        {
            //App.Current.Properties[0]
            var snc = new SNC_DataAccess();
            var tables = snc.GetTables();

            if (tables == null)
                tables = new List<Table>();
            this.AllTables = new ObservableCollection<Table>(tables);
        }
        public CSVMatchViewModel()
        {
            CurrentTable = App.Current.Properties[Constants.ApplicationProperties.SelectedTable].ToString();
            var snc = new SNC_DataAccess();
            var columns = snc.GetColumns(CurrentTable);

            if (columns == null)
                columns = new List<string>();
            var fm = new FileDataAccess();
            var csvColumns = fm.GetCSVColumns(App.Current.Properties[Constants.ApplicationProperties.CSVFileLocation].ToString());

            this.ColumnSet = MatchLists(csvColumns, columns);
            this.CSVFileName = GetCSVFileName();
            this.CSVFilePath = GetCSVFilePath();

            string test = string.Empty;
            foreach (var column in columns)
                test += (column + ",");
        }
        private void btn_forward_Click(object sender, RoutedEventArgs e)
        {
            App.Current.Properties[Constants.ApplicationProperties.CurrentStep] = Constants.ApplicationProperties.Steps.step4;
            App.Current.Properties[Constants.ApplicationProperties.NextStep] = Constants.ApplicationProperties.Steps.step5;

            var snc = new SNC_DataAccess();
            var attach = new SNC_AttachmentDataAccess();
            var tableName = App.Current.Properties[Constants.ApplicationProperties.SelectedTable].ToString();
            var columns = snc.GetColumns(tableName); 
            var documents = (List<string>)App.Current.Properties[Constants.ApplicationProperties.SelectedDocs];

            foreach (var document in documents)
            {
                List<Parameters> parameters = new List<Parameters>();
                foreach (var column in columns)
                    if (column != "sys_id")
                        parameters.Add(new Models.Parameters { name = column, value = "test" });
                var UID = snc.CreateSNCObject(tableName, parameters);
                attach.AttachFile(UID, document);
            }
            NavigationService.Navigate(new FinishedView());
        }