Example #1
0
func (this *SupplierController) UiAdd() {
	item := s.Supplier
	oItemDef, _ := itemDef.EntityDefMap[item]
	oItemDef.FillEnum(s.Category, getCategoryEnumList())
	this.Data["Service"] = "/item/add/" + item
	this.Data["Form"] = ui.BuildAddForm(oItemDef, u.TUId())
	this.Data["Onload"] = ui.BuildAddOnLoadJs(oItemDef)
	this.TplNames = "item/add.tpl"
}
Example #2
0
func (this *UiController) Add() {
	item, ok := this.Ctx.Input.Params[":hi"]
	if !ok {
		beego.Error(stat.ParamItemError)
		this.Ctx.WriteString(stat.ParamItemError)
		return
	}
	oItemDef, ok := itemDef.EntityDefMap[item]
	if !ok {
		beego.Error(fmt.Sprintf("Item %s not define", item))
		this.Ctx.WriteString(stat.ItemNotDefine)
		return
	}
	this.Data["Service"] = "/item/add/" + item
	this.Data["Form"] = ui.BuildAddForm(oItemDef, u.TUId())
	this.Data["Onload"] = ui.BuildAddOnLoadJs(oItemDef)
	this.TplNames = "item/add.tpl"
}