public override int GetHashCode() { unchecked { var hashCode = Id.GetHashCode(); hashCode = (hashCode * 397) ^ (TransactionId != null ? TransactionId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ChargeStatus != null ? ChargeStatus.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PaymentProcessor != null ? PaymentProcessor.GetHashCode() : 0); hashCode = (hashCode * 397) ^ AddressIsActive.GetHashCode(); hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ChargeId.GetHashCode(); hashCode = (hashCode * 397) ^ AddressId.GetHashCode(); hashCode = (hashCode * 397) ^ (ShopifyId != null ? ShopifyId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ShopifyOrderId != null ? ShopifyOrderId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ShopifyOrderNumber.GetHashCode(); hashCode = (hashCode * 397) ^ (ShopifyCartToken != null ? ShopifyCartToken.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ShippingDate.GetHashCode(); hashCode = (hashCode * 397) ^ ScheduledAt.GetHashCode(); hashCode = (hashCode * 397) ^ ShippedDate.GetHashCode(); hashCode = (hashCode * 397) ^ ProcessedAt.GetHashCode(); hashCode = (hashCode * 397) ^ CustomerId.GetHashCode(); hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Hash != null ? Hash.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsPrepaid.GetHashCode(); hashCode = (hashCode * 397) ^ CreatedAt.GetHashCode(); hashCode = (hashCode * 397) ^ UpdatedAt.GetHashCode(); hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TotalPrice != null ? TotalPrice.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ShippingAddress != null ? ShippingAddress.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (BillingAddress != null ? BillingAddress.GetHashCode() : 0); return(hashCode); } }
//Adjusted Cost public static double AdjustCost(Order r, Func <Order, Freight> calcFreigt, Func <Order, ShippingDate> calcShippingDate) { Freight f = calcFreigt(r); ShippingDate s = calcShippingDate(r); Console.WriteLine("\n\nDay of Shipping : " + s.date.DayOfWeek.ToString() + "\n"); double cost = (s.date.DayOfWeek.ToString() == "Monday") ? f.cost + 1000 : f.cost + 500; ///Finall Cost return(cost); }
/// <summary> /// check the order status /// </summary> /// <returns></returns> public string GetOrderStatus() { string systime = DateTime.Now.ToString("MM/dd/yy"); string status = ""; //ShippingDate<systime if (ShippingDate.CompareTo(systime) == -1) { status = "Shipping"; } //ShippingDate>systime else if (ShippingDate.CompareTo(systime) == 1) { status = "Processing"; } return(status); }
public IEnumerator <KeyValuePair <string, string> > GetEnumerator() { yield return(new KeyValuePair <string, string>("OrderNumber", OrderNumber)); yield return(new KeyValuePair <string, string>("ShippingDate", ShippingDate.ToLongDateString())); yield return(new KeyValuePair <string, string>("StockNumber", StockNumber)); yield return(new KeyValuePair <string, string>("BayLocation", BayLocation)); yield return(new KeyValuePair <string, string>("CustomerNum", CustomerNum)); yield return(new KeyValuePair <string, string>("CustomerName", CustomerName)); yield return(new KeyValuePair <string, string>("isKit", IsKit.ToString())); yield return(new KeyValuePair <string, string>("ItemDesc1", ItemDesc1)); yield return(new KeyValuePair <string, string>("ItemDesc2", ItemDesc2)); yield return(new KeyValuePair <string, string>("ComponentItemNumber", ComponentItemNumber)); yield return(new KeyValuePair <string, string>("OrderWeight", OrderWeight.ToString())); }
public override string ToString() => ShippingDate.ToString();