/// <summary> /// Action:将所点菜品增加到点菜列表 /// </summary> public void AddFoodAction() { if (string.IsNullOrEmpty(View.foodName)) { View.ShowMessage("请选输入菜品名称"); return; } if (View.Amount <= 0) { View.ShowMessage("点菜的份数至少要是一份"); return; } if (View.IsExistInList(View.foodName)) { View.ShowMessage($"菜品【{View.foodName}】已经在您的菜单中"); return; } var foodServ = new FoodServices(); var food = foodServ.GetFoodDetailByName(View.foodName); if (food.ID == 0) { View.ShowMessage($"抱歉,本餐厅没有菜品【{View.foodName}】"); return; } View.AddFoodToList(food); }
/// <summary> /// 本餐厅所有菜品 /// </summary> /// <returns></returns> public List <string> GetFoodNameList() { var foodServ = new FoodServices(); var foodNameList = foodServ.GetFoodNameList(); return(foodNameList); }
public UWaterlooAPI(string apikey) { m_apikey = apikey; m_client = new HttpClient(); m_client.BaseAddress = new Uri("https://api.uwaterloo.ca"); FoodServices = new FoodServices(m_apikey, m_client); Feds = new Feds(m_apikey, m_client); Courses = new Courses(m_apikey, m_client); Awards = new Awards(m_apikey, m_client); Events = new Events(m_apikey, m_client); Blogs = new Blogs(m_apikey, m_client); News = new News(m_apikey, m_client); Opportunities = new Opportunities(m_apikey, m_client); Services = new Services(m_apikey, m_client); Weather = new Weather(m_apikey, m_client); Terms = new Terms(m_apikey, m_client); Resources = new Resources(m_apikey, m_client); Codes = new Codes(m_apikey, m_client); Buildings = new Buildings(m_apikey, m_client); PointsOfInterest = new PointsOfInterest(m_apikey, m_client); Parking = new Parking(m_apikey, m_client); Transit = new Transit(m_apikey, m_client); Directory = new Directory(m_apikey, m_client); API = new API(m_apikey, m_client); Server = new Server(m_apikey, m_client); }