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 }
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") }
// 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) }
// 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) }