up
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"github.com/xuri/excelize/v2"
|
||||
)
|
||||
|
||||
@@ -20,6 +19,11 @@ type Srv struct {
|
||||
func (s *Srv) Companies() ([]company.Company, error) {
|
||||
var res []company.Company
|
||||
err := run.DB.Select(&res, "SELECT * FROM company order by 1")
|
||||
if err != nil {
|
||||
slog.Error("Companies SELECT error", "error", err)
|
||||
} else {
|
||||
slog.Info("Companies SELECT success", "count", len(res), "data", res)
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
|
||||
@@ -31,7 +35,13 @@ func (s *Srv) CreateCompany(name, memberNumber, username, password string) error
|
||||
Password: password,
|
||||
}
|
||||
|
||||
return c.Create()
|
||||
err := c.Create()
|
||||
if err != nil {
|
||||
slog.Error("CreateCompany INSERT error", "error", err)
|
||||
} else {
|
||||
slog.Info("CreateCompany INSERT success", "name", name)
|
||||
}
|
||||
return err
|
||||
}
|
||||
func (s *Srv) EditCompany(id float64, name, memberNumber, username, password string) error {
|
||||
c := &company.Company{
|
||||
@@ -46,7 +56,7 @@ func (s *Srv) EditCompany(id float64, name, memberNumber, username, password str
|
||||
}
|
||||
|
||||
func (s *Srv) UploadExcel() string {
|
||||
dialog := application.OpenFileDialog()
|
||||
dialog := run.APP.Dialog.OpenFile()
|
||||
// dialog.AddFilter("Excel Dosyaları", "*.xls;*.xlsx;*.ods")
|
||||
dialog.AddFilter("Excel 97-2003", "*.xls")
|
||||
dialog.AddFilter("Excel 2007+", "*.xlsx")
|
||||
@@ -271,8 +281,5 @@ func (s *Srv) Rpa(companyID float64, month float64, year float64, devMode bool)
|
||||
}
|
||||
|
||||
func emitLog(logMessage string) {
|
||||
run.APP.Events.Emit(&application.WailsEvent{
|
||||
Name: "logProcess",
|
||||
Data: logMessage,
|
||||
})
|
||||
run.APP.Event.Emit("logProcess", logMessage)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user