public ValidateOrderListRequest(GetOrderListMessage MyGetOrderListMessage) { _ValidateOrderListMessage = new ValidateOrderListMessage(); int i = 0; foreach (Order MyOrder in MyGetOrderListMessage._OrderListMessage.Result.OrderList) { ValidateOrder MyValidateOrder = new ValidateOrder(); MyValidateOrder.CarrierName = "CarrierName"; MyValidateOrder.TrackingNumber = "TrackingNumber"; MyValidateOrder.TrackingUrl = "TrackingUrl"; MyValidateOrder.OrderNumber = MyOrder.OrderNumber; int j = 0; foreach (OrderLine MyOrderLine in MyOrder.OrderLineList) { ValidateOrderLine MyValidateOrderLine = new ValidateOrderLine(); MyValidateOrderLine.SellerProductId = MyOrderLine.SellerProductId; MyValidateOrderLine.ProductCondition = (ProductConditionEnum)MyOrderLine.ProductCondition; MyValidateOrder.OrderLineList[j] = MyValidateOrderLine; } _ValidateOrderListMessage.OrderList[i] = MyValidateOrder; } _Token = MyGetOrderListMessage._Token; }
public void SetAreaCode(string areaCode) { if (!ValidateOrder.IsNumeric(areaCode)) { throw new ApplicationException("AreaCode must be numeric!"); } AreaCode = areaCode; }
public void SetCreatedAt(string date) { if (!ValidateOrder.IsValidDate(date)) { throw new ApplicationException("Date is not in correct format!"); } CreatedAt = date; }
public void SetCountryCode(string countryCode) { if (!ValidateOrder.IsNumeric(countryCode)) { throw new ApplicationException("CountryCode must be numeric!"); } CountryCode = countryCode; }
public void SetEmail(string email) { if (!ValidateOrder.IsValidEmail(email)) { throw new ApplicationException("Document must have 11 or 14 characters!"); } Email = email; }
public void SetType(string type) { if (!ValidateOrder.IsValidCustomerType(type)) { throw new ApplicationException("Accepted values for Type are: individual and company!"); } Type = type; }
public void SetZipCode(string zipCode) { if (!ValidateOrder.IsNumeric(zipCode)) { throw new ApplicationException("Zip code must be numeric!"); } ZipCode = zipCode; }
public void SetDocument(string document) { if (!ValidateOrder.IsValidDocument(document)) { throw new ApplicationException("Document must have 11 or 14 characters!"); } Document = document; }
public void SetLine1(string line1) { if (!ValidateOrder.IsValidLine1(line1)) { throw new ApplicationException("Line1 must be in the format 'número, rua, bairro'!"); } Line1 = line1; }
public void SetNumber(string number) { if (!ValidateOrder.IsNumeric(number)) { throw new ApplicationException("Number must be numeric!"); } Number = number; }
public void SetStatus(string status) { if (!ValidateOrder.IsValidAddressStatus(status)) { throw new ApplicationException("Status must be active or deleted!"); } Status = status; }
public void SetStatus(string status) { if (!ValidateOrder.IsValidChargeStatus(status)) { throw new ApplicationException("Charge status must be pending, paid, canceled, processing, failed, overpaid or underpaid!"); } Status = status; }
public async Task Handle(PlaceOrder placeOrder, IMessageHandlerContext context) { log.Info($"Sending order {placeOrder.OrderId} to validation."); await Task.Delay(1000).ConfigureAwait(false); var validateOrder = new ValidateOrder { OrderId = placeOrder.OrderId, Sender = context.ReplyToAddress }; await context.SendLocal(validateOrder) .ConfigureAwait(false); }
public bool Validate(ValidateOrder data) { if (data.OrderId == Guid.Empty || data.RestaurantId == Guid.Empty || data.CustomerId == Guid.Empty) { return(false); } for (int i = 0; i < data.Items.Length; i++) { if (data.Items[i].MenuItemId == Guid.Empty) { return(false); } } return(true); }
public async Task <IActionResult> PutOrders(Guid id, Order order) { // validate id's and that OrderTotal matches sum of all orderitems if (order == null || id != order.Id || !ValidateOrder.TotalCost(order)) { return(BadRequest()); } var isUpdated = await _ordersRepository.UpdateOrderAsync(order); if (isUpdated) { return(Ok(id)); } else { return(NoContent()); } }
/// <summary> /// Create a new order /// </summary> /// <param name="order"></param> /// <returns>Order</returns> public async Task <Order> CreateOrderAsync(Order order) { // Validate order! if (ValidateOrder.OrderData(order)) { // If ordertotal and sum of all items doesn't match, return null, order not valid! if (!ValidateOrder.TotalCost(order)) { return(null); } // Set order status to 1 order.StatusId = 1; // Save _context.Orders.Add(order); await _context.SaveChangesAsync(); return(order); } return(null); }
private void btnCash_Click(object sender, RoutedEventArgs e) { validateOrder = new ValidateOrder(); Main.GetCurrent().SetLayoutRoot(validateOrder); }