C# 在订单状态更改时添加注释,nopcommerce 3.0来源
有人能帮我吗?我正试图让它在订单状态更改时向系统添加注释,到目前为止,我让它添加注释,但它显示为订单状态ID号,而不是其字符串引用 代码插入OrderController.csC# 在订单状态更改时添加注释,nopcommerce 3.0来源,c#,asp.net,asp.net-mvc-4,nopcommerce,C#,Asp.net,Asp.net Mvc 4,Nopcommerce,有人能帮我吗?我正试图让它在订单状态更改时向系统添加注释,到目前为止,我让它添加注释,但它显示为订单状态ID号,而不是其字符串引用 代码插入OrderController.cs int osid = order.OrderStatusId; //order notes, notifications order.OrderNotes.Add(new OrderNote() { Note = string.Format("Order status h
int osid = order.OrderStatusId;
//order notes, notifications
order.OrderNotes.Add(new OrderNote()
{
Note = string.Format("Order status has been changed to {0}", osid.ToString()),
DisplayToCustomer = false,
CreatedOnUtc = DateTime.UtcNow
});
我接下来的步骤是什么?我现在已经完成了 我只需要传递字符串变量order.OrderStatus,而不是ID 修订代码
order.OrderStatusId = model.OrderStatusId;
var os = order.OrderStatus;
//order notes, notifications
order.OrderNotes.Add(new OrderNote()
{
Note = string.Format("Order status has been changed to {0}", os.ToString()),
DisplayToCustomer = false,
CreatedOnUtc = DateTime.UtcNow
});
你的问题不清楚?显示便笺的代码在哪里?@Falaque添加便笺的代码是order.OrderNotes.Add(new OrderNote(),括号内的部分是添加到便笺的信息。我的意思是,在UI中,您需要查看使用了哪个引用,order.OrderStatusId或order.OrderNotes。