-
Notifications
You must be signed in to change notification settings - Fork 0
/
DishClass.h
30 lines (29 loc) · 901 Bytes
/
DishClass.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include "DishNode.h"
#include <fstream>
class DishClass {
private:
DishNOde* head;
DishNOde* last;//指向最后一个节点
int length;
void print(Dish p);
bool OutToFile(DishNOde* p, string str);
DishNOde* SortBysorce(DishNOde* start);
DishNOde* mergeBySorce(DishNOde* left, DishNOde* right);
DishNOde* SortBySales(DishNOde* start);
DishNOde* mergeBySales(DishNOde* left, DishNOde* right);
public:
DishClass();
~DishClass();
void ShowAll();
bool GetID(int id, Dish*& dish);//查询菜谱
bool GetByName(string name, Dish*& dish);//通过菜名查询
bool AddDish(Dish dish);//增加菜谱
bool DeleteDish(int id);//删除菜谱
bool UpdataScore(int id, int addScore);//更新评分
bool UpdataSales(int id);
bool UpdataName(int id, string name);
bool UpdataPrice(int id, float name);
bool ShowByScore();
bool ShowBySales();
};