Exemple #1
0
        public void CreateLoadTableText(ConvertDbFtoSql xamlconvert)
        {
            UpdateModel modelupdate = new UpdateModel();

            modelupdate.UpdateModelProgressBarProgress(xamlconvert);
            float proc = 100.0f / xamlconvert.ListViewDbfView.Dispatcher.Invoke(() => xamlconvert.ListViewDbfView.SelectedItems.Count);

            if (xamlconvert.ListViewDbfView != null)
            {
                foreach (Dbf shema in xamlconvert.ListViewDbfView.Dispatcher.Invoke(() => xamlconvert.ListViewDbfView.SelectedItems))
                {
                    try
                    {
                        modelupdate.UpdateModelProgressBarProgress(xamlconvert, shema.NameTable, proc);
                        DbSchema shem = new DbSchema(ConectionString.ConectString.SqlConection, DbPlatform.SqlServer2008);
                        shem.Alter(basetable => Logic.LogicApplication.CreateTableSql(basetable, shema));
                        Logic.LogicApplication.SaveContentsToSqlTable(shema);
                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show(exception.Message);
                    }
                }
            }
            modelupdate.UpdateModelProgressBarProgress(xamlconvert);
        }