void Handle(Input.Clear Action)
        {
            Cleaner cleaner = new Cleaner();
            string[] tables = this.Tables.Where(x => x.Selected).Select(x => x.FullName).ToArray();

            cleaner.Clear(tables);
        }
Esempio n. 2
0
        public void Import(ExcelPackage Package, bool ClearDatabase)
        {
            Clr clr = new Clr();

            if (ClearDatabase) {
                Cleaner cleander = new Cleaner();

                cleander.Clear();
            }

            Dictionary<ulong, object> objects = new Dictionary<ulong, object>();
            List<ImporterRelation> relations = new List<ImporterRelation>();

            Db.Transact(() => {
                for (int i = 2; i <= Package.Workbook.Worksheets.Count; i++) {
                    ExcelWorksheet sheet = Package.Workbook.Worksheets[i];

                    this.ExportTable(sheet, objects, relations);
                }

                foreach (ImporterRelation r in relations) {
                    this.ApplyRelation(objects, r);
                }
            });
        }