本文整理汇总了C#中OrderStatus类的典型用法代码示例。如果您正苦于以下问题:C# OrderStatus类的具体用法?C# OrderStatus怎么用?C# OrderStatus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrderStatus类属于命名空间,在下文中一共展示了OrderStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Confirm
public void Confirm()
{
if (Status != OrderStatus.Draft)
throw new InvalidOperationException("Only draft orders can be confirmed.");
Status = OrderStatus.Confirmed;
}
示例2: FlagAsShipped
internal void FlagAsShipped()
{
if (Status != OrderStatus.ReadyToShip)
throw new InvalidOperationException("Only confirmed orders can be shipped.");
Status = OrderStatus.ReadyToShip;
}
示例3: Shipped
public void Shipped()
{
if (Status != OrderStatus.Confirmed)
throw new InvalidOperationException("Order not confirmed!");
Status = OrderStatus.Confirmed;
}
示例4: AddOrderHistory
public void AddOrderHistory(int id, string ticker, decimal price, decimal volume, OrderType type, int period, int tick, OrderStatus status)
{
this.EnqueueCallback(delegate
{
StateManager.AddArchiveOrder(id, ticker, price, volume, type, period, tick, status);
});
}
示例5: ChangeOrderStatus
public void ChangeOrderStatus(int orderId, OrderStatus newStatus)
{
OrderDB orderDB = new OrderDB();
Order order = orderDB.GetById(orderId);
order.StatusID = newStatus;
order.Update();
}
示例6: CompleteOrder
public void CompleteOrder(Guid id)
{
if (OrderStatus.SameValueAs(OrderStatus.InProgress) || OrderStatus.SameValueAs(OrderStatus.Completed))
OrderStatus = OrderStatus.Completed;
else
throw new InvalidOperationException("This order has been canceled and can not be completed.");
}
示例7: Record
private void Record(string notificationType, string code, OrderStatus status)
{
using (var writer = new StreamWriter(new FileStream(Configuration.OrderLog, FileMode.Append)))
{
writer.WriteLine("{0}: {1} {2}", notificationType, code, status);
}
}
示例8: Order
public Order(int id, string customerid, int employeeid, DateTime orderdate, DateTime requireddate,
DateTime shippeddate, int shipvia, double freight, string shipname, string shipaddress, string shipcity,
string shiparegion, string shippostalcode, string shipcountry, List<OrderDetails> details)
{
ID = id;
CustomerID = customerid;
EmployeeID = employeeid;
OrderDate = orderdate;
RequiredDate = requireddate;
ShippedDate = shippeddate;
ShipVia = shipvia;
Freight = freight;
ShipName = shipname;
ShipAddress = shipaddress;
ShipCity = shipcity;
ShipRegion = shiparegion;
ShipPostalCode = shippostalcode;
ShipCountry = shipcountry;
Details = details;
if (orderdate.Equals(DateTime.MinValue))
Status = OrderStatus.NEW;
else if (ShippedDate.Equals(DateTime.MinValue))
Status = OrderStatus.NOTSHIPPED;
else
Status = OrderStatus.SHIPPED;
}
示例9: EmitCancelReject
protected void EmitCancelReject(
Order order,
OrderStatus status,
string message
)
{
}
示例10: OrderDetailsReceivedImpl
public OrderDetailsReceivedImpl(string customerId, string orderId, DateTime created, OrderStatus status)
{
CustomerId = customerId;
OrderId = orderId;
Created = created;
Status = status;
}
示例11: GetOrderStatusStr
public string GetOrderStatusStr(OrderStatus orderStatus)
{
switch (orderStatus)
{
case OrderStatus.ChuShou:
{
return "出售中";
}
case OrderStatus.ShenHe:
{
return "审核中";
}
case OrderStatus.GongShi:
{
return "公示";
}
case OrderStatus.NotComplete:
{
return "订单未完成";
}
case OrderStatus.ShenHeFail:
{
return "审核失败";
}
default:
{
return "未知状态";
}
}
}
示例12: Order
public Order(Guid userId, ICollection<OrderItem> items, NpDepartment npDepartment, OrderStatus status)
{
UserId = userId;
OrderItems = items;
NpDepartment = npDepartment;
Status = status;
}
示例13: FlagAsReadyToShip
internal void FlagAsReadyToShip()
{
if (Status != OrderStatus.Draft)
throw new InvalidOperationException("Only draft orders can be confirmed.");
Status = OrderStatus.ReadyToShip;
}
示例14: OrderStatusFilter
public OrderStatusFilter(OrderStatus orderStatus)
{
switch (orderStatus)
{
case OrderStatus.Pending:
this.value = "pending";
break;
case OrderStatus.Processing:
this.value = "processing";
break;
case OrderStatus.OnHold:
this.value = "on-hold";
break;
case OrderStatus.Completed:
this.value = "completed";
break;
case OrderStatus.Cancelled:
this.value = "cancelled";
break;
case OrderStatus.Refunded:
this.value = "refunded";
break;
case OrderStatus.Failed:
this.value = "failed";
break;
}
}
示例15: GetBestCustomersReport
/// <summary>
/// Get best customers
/// </summary>
/// <param name="createdFromUtc">Order created date from (UTC); null to load all records</param>
/// <param name="createdToUtc">Order created date to (UTC); null to load all records</param>
/// <param name="os">Order status; null to load all records</param>
/// <param name="ps">Order payment status; null to load all records</param>
/// <param name="ss">Order shipment status; null to load all records</param>
/// <param name="orderBy">1 - order by order total, 2 - order by number of orders</param>
/// <param name="pageIndex">Page index</param>
/// <param name="pageSize">Page size</param>
/// <returns>Report</returns>
public virtual IPagedList<BestCustomerReportLine> GetBestCustomersReport(DateTime? createdFromUtc,
DateTime? createdToUtc, OrderStatus? os, PaymentStatus? ps, ShippingStatus? ss, int orderBy,
int pageIndex = 0, int pageSize = 214748364)
{
int? orderStatusId = null;
if (os.HasValue)
orderStatusId = (int)os.Value;
int? paymentStatusId = null;
if (ps.HasValue)
paymentStatusId = (int)ps.Value;
int? shippingStatusId = null;
if (ss.HasValue)
shippingStatusId = (int)ss.Value;
var query1 = from c in _customerRepository.Table
join o in _orderRepository.Table on c.Id equals o.CustomerId
where (!createdFromUtc.HasValue || createdFromUtc.Value <= o.CreatedOnUtc) &&
(!createdToUtc.HasValue || createdToUtc.Value >= o.CreatedOnUtc) &&
(!orderStatusId.HasValue || orderStatusId == o.OrderStatusId) &&
(!paymentStatusId.HasValue || paymentStatusId == o.PaymentStatusId) &&
(!shippingStatusId.HasValue || shippingStatusId == o.ShippingStatusId) &&
(!o.Deleted) &&
(!c.Deleted)
select new { c, o };
var query2 = from co in query1
group co by co.c.Id into g
select new
{
CustomerId = g.Key,
OrderTotal = g.Sum(x => x.o.OrderTotal),
OrderCount = g.Count()
};
switch (orderBy)
{
case 1:
{
query2 = query2.OrderByDescending(x => x.OrderTotal);
}
break;
case 2:
{
query2 = query2.OrderByDescending(x => x.OrderCount);
}
break;
default:
throw new ArgumentException("Wrong orderBy parameter", "orderBy");
}
var tmp = new PagedList<dynamic>(query2, pageIndex, pageSize);
return new PagedList<BestCustomerReportLine>(tmp.Select(x => new BestCustomerReportLine
{
CustomerId = x.CustomerId,
OrderTotal = x.OrderTotal,
OrderCount = x.OrderCount
}),
tmp.PageIndex, tmp.PageSize, tmp.TotalCount);
}