Exemplo n.º 1
0
func (p *ShippingInsteadList) _onStatusEvent(trackNumber int64, status string, tab string) (string, string) {
	err := orderservice.ChangeOrderStatus(trackNumber, status)
	if err != nil {
		panic(err.Error())
	}
	return "redirect", "/order/list/" + tab
}
Exemplo n.º 2
0
func (p *OrderList) _onStatusEvent(trackNumber int64, status string, tab string) *exit.Exit {
	err := orderservice.ChangeOrderStatus(trackNumber, status)
	if err != nil {
		panic(err.Error())
	}
	return route.RedirectDispatch(route.GetRefererFromURL(p.Request()), "/order/list")
}
Exemplo n.º 3
0
// shipping instead order's status changed to delivering
func (p *OrderList) OnShippingInsteadOrderPrint(trackNumber int64) (string, string) {
	if err := orderservice.ChangeOrderStatus(trackNumber, "delivering"); err != nil {
		panic(err)
	}
	return "redirect", fmt.Sprintf("/order/shippinginsteadprint/%v", trackNumber)
}
Exemplo n.º 4
0
// OnPrint set order's status to `todeliver` then go to print page.
func (p *OrderList) OnPrint(trackNumber int64) (string, string) {
	if err := orderservice.ChangeOrderStatus(trackNumber, "todeliver"); err != nil {
		panic(err.Error())
	}
	return "redirect", fmt.Sprintf("/order/print/%v", trackNumber)
}