From 70eb8ab6fe7ff82482cc44d346104be5c9edba8b Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Sun, 11 Nov 2018 18:40:57 +0100 Subject: Import Export with clean commands --- sqlite.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sqlite.go') diff --git a/sqlite.go b/sqlite.go index d8dfbef..f7bea62 100644 --- a/sqlite.go +++ b/sqlite.go @@ -495,21 +495,26 @@ func SaveImportsToDB(cus []Customer, prs []Project, tsk []Task) { fmt.Println(nli," Tasks:",len(tsk)) fmt.Println(sub("")) if isInterSure(nli+" Are You sure to Import them all?") { + i := 0 for _,c := range cus { id := SaveCustomer(c) cusids=append(cusids,IdMap{c.Id,id}) + i++ } - fmt.Println(cusids) + //fmt.Println(cusids) prs = ChangeCustomerIds(cusids,prs) for _,p := range prs { id := SaveProject(p) prids=append(prids,IdMap{p.Id,id}) + i++ } - fmt.Println(prids) + //fmt.Println(prids) tsk = ChangeProjectIds(prids,tsk) for _,t := range tsk { SaveTask(t) + i++ } + fmt.Println(nli,i,"items imported") fmt.Println(frame(posR(),false)) }else{ fmt.Println(frame(negR(),false)) -- cgit v1.2.3