public override string ToString() { return("Dish ID: " + DishID.ToString() + "\n Dish name: " + DishName + "\n Dish size: " + DishSize.ToString() + "\n Dish price: " + DishPrice.ToString() + "\n Kashrut level: " + KashrutLevel.ToString() + "\n Preparing time: " + PreparingTime.Hours.ToString() + ":" + PreparingTime.Minutes.ToString()); }
public override int GetHashCode() { int hashcode = 0; unchecked { hashcode = (hashcode * 397) ^ (!__isset.OrderID ? 0 : (OrderID.GetHashCode())); hashcode = (hashcode * 397) ^ (!__isset.DishID ? 0 : (DishID.GetHashCode())); hashcode = (hashcode * 397) ^ (!__isset.Quantity ? 0 : (Quantity.GetHashCode())); hashcode = (hashcode * 397) ^ (!__isset.BakerID ? 0 : (BakerID.GetHashCode())); } return(hashcode); }
/// <summary> /// Compares this instance to a specified Dish and returns an indication /// of their relative values. /// </summary> /// /// <param name="obj"> /// The Dish to compare with this instance. /// </param> /// /// <returns> /// A 32-bit signed integer that indicates whether this instance precedes, follows, /// or appears in the same position in the sort order as the value parameter.Value /// Condition Less than zero This instance precedes obj. Zero This instance has /// the same position in the sort order as obj. Greater than zero This instance /// follows obj.-or- obj is null. ///</returns> public int CompareTo(object obj) { return(DishID.CompareTo(((Dish)obj).DishID)); }
/// < /// mary> /// Initializes a new instance of the Branch class to the value indicated /// by the given parameters. /// </summary> /// /// <param name="orderID">The OrderID of the ordered order.</param> /// <param name="dishID"> The DishID of the ordered dish.</param> /// <param name="amount"> Amount of dishes orderd.</param> ///public Ordered_Dish(int orderID=0, int dishID=0, int amount=0) //{ // ItemID = 0; // OrderID = orderID; // DishID = dishID; // Amount = amount; //} /// <summary> /// Converts the value of this instance to its equivalent string representation. /// </summary> /// /// <returns> /// The string representation of the ordered-dish's properties. /// </returns> public override string ToString() { return(ItemID.ToString() + " " + OrderID.ToString() + " " + DishID.ToString() + " " + Amount.ToString()); }