public void checkSizeLevel(BE.SizeOfDish wantedSize, BE.SizeOfDish currentDishSize) { if (wantedSize > currentDishSize) { throw new Exception("אין לנו מנה בגודל כזה"); } }
/// <summary> /// בודק האם המנה שרוצים להוסיף תקינה מבחינת כשרות וגודל /// </summary> /// <param name="newOrderDish">המנה שרוצים להוסיף</param> /// <param name="currentDishSize">גודל המנה שקיים במערכת</param> /// <param name="currentDishKosher">רמת הכשרות הקיימת במערכת</param> public void checkKosherSizeLevel(BE.OrderedDish newOrderDish, BE.SizeOfDish currentDishSize, BE.Kosher currentDishKosher) { try { checkKosherLevel(newOrderDish.dishLevelOfKosher, currentDishKosher); checkSizeLevel(newOrderDish.dishSize, currentDishSize); } catch (Exception) { throw; } }
static BE.OrderedDish init_order_dish(uint order_id, uint dish_id, uint number_of_same_dish, BE.Kosher level, BE.SizeOfDish size) { BE.OrderedDish ordered_dish = new BE.OrderedDish(); ordered_dish.orderId = order_id; ordered_dish.dishID = dish_id; ordered_dish.numberOfSameDish = number_of_same_dish; ordered_dish.dishLevelOfKosher = level; ordered_dish.dishSize = size; return(ordered_dish); }