func (p *Customer) Transaction(transactions []interface{}) { transactionResult := new(df.List) for _, transaction := range transactions { var tran map[string]interface{} = transaction.(map[string]interface{}) res := p.executeEachTransaction(tran) transactionResult.Add(res) } p.context.JSON(200, dfweb.SetNormalFetchResult(transactionResult)) }
func (p *SysTable) Fetch(data map[string]interface{}) { cbx := cb.CreateSysTableCB() cbx.Query().SetDelFlag_Equal(0) p.SetupCriteria(cbx, data) cbx.Query().AddOrderBy_TableName_Asc().AddOrderBy_Key1_Asc().AddOrderBy_Key2_Asc() res, err := bhv.SysTableBhv_I.SelectList(cbx, p.tx) if err != nil { panic(err.Error()) } list := p.ResultToMap(res) p.context.JSON(200, dfweb.SetNormalFetchResult(list)) }
func (p *Employee) Fetch(data map[string]interface{}) { cbx := cb.CreateEmployeeCB() cbx.SetupSelect_UserTable() cbx.Query().SetDelFlag_Equal(0) p.SetupCriteria(cbx, data) //add Order By res, err := bhv.EmployeeBhv_I.SelectList(cbx, p.tx) if err != nil { panic(err.Error()) } list := p.ResultToMap(res) p.context.JSON(200, dfweb.SetNormalFetchResult(list)) }
func (p *Customer) Fetch(data map[string]interface{}) { cbx := cb.CreateCustomerCB() cbx.Query().SetDelFlag_Equal(0) p.SetupCriteria(cbx, data) //add Order By cbx.Query().AddOrderBy_CusCd_Asc() res, err := bhv.CustomerBhv_I.SelectList(cbx, p.tx) if err != nil { panic(err.Error()) } list := p.ResultToMap(res) p.context.JSON(200, dfweb.SetNormalFetchResult(list)) }
func (p *SysTable) GetDbs() { cbx := cb.CreateSysTableCB() cbx.Query().SetDelFlag_Equal(0) cbx.Query().SetTableName_Equal("DbName") cbx.Query().AddOrderBy_Key1_Asc() res, err := bhv.SysTableBhv_I.SelectList(cbx, p.tx) if err != nil { panic(err.Error()) } reslist := new(df.List) for _, ent := range res.List.GetAsArray() { entx := ent.(*entity.SysTable) cmap := make(map[string]string) cmap["value"] = entx.GetKey1() cmap["label"] = entx.GetKey1() reslist.Add(cmap) } p.context.JSON(200, dfweb.SetNormalFetchResult(reslist)) }
func (p *Employee) getSecData() { cbx := cb.CreateUserTableCB() cbx.Query().SetDelFlag_Equal(0) cbx.Query().SetTableName_Equal("section") cbx.Query().AddOrderBy_Key1_Asc() res, err := bhv.UserTableBhv_I.SelectList(cbx, p.tx) if err != nil { panic(err.Error()) } reslist := new(df.List) cmap := make(map[string]interface{}) cmap["value"] = 0 cmap["label"] = "" reslist.Add(cmap) for _, ent := range res.List.GetAsArray() { entx := ent.(*entity.UserTable) cmap := make(map[string]interface{}) cmap["value"] = entx.GetId() cmap["label"] = entx.GetS1Data().String reslist.Add(cmap) } p.context.JSON(200, dfweb.SetNormalFetchResult(reslist)) }