-
Notifications
You must be signed in to change notification settings - Fork 0
/
order.h
92 lines (90 loc) · 2.38 KB
/
order.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#pragma once
#include<iostream>
#include<stdio.h>
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<stdlib.h>
#include<math.h>
#include<iomanip>
using namespace std;
extern int c_order;
class Order_class{
private:
char order_id[7];
char commodity_id[7];
double amount;
int number;//大于0整数
char seller_id[7];
char buyer_id[7];
char date[15];
int commodity_status;
static int order_cnt;
public:
int get_cnt()
{
return order_cnt;
}
int set_cnt(int i)
{
order_cnt=i;
}
char* get_orderid()
{
return order_id;
}
char* get_commodityid()
{
return commodity_id;
}
char* get_sellerid()
{
return seller_id;
}
char* get_buyerid()
{
return buyer_id;
}
char* get_date()
{
return date;
}
int get_commoditystatus()
{
return commodity_status;
}
double get_amount()
{
return amount;
}
void set_commoditystatus(int status)
{
commodity_status=status;
}
int get_number()
{
return number;
}
void add_cnt()
{
++order_cnt;
}
void set_order(char orderid[7],char commodityid[21],double amount_,int num,char date_[15],char sellerid[7],char buyerid[7],int status )
{
strcpy(order_id,orderid);
strcpy(commodity_id,commodityid);
strcpy(seller_id,sellerid);
strcpy(buyer_id,buyerid);
strcpy(date,date_);
amount=amount_;
number=num;
commodity_status=status;
}
};
void read_order(Order_class *order);
void Print_orderList(Order_class * order);
void Print_buyerorder(Order_class*order, char buyerid[15]);
void Print_sellerorder(Order_class*order, char sellerid[15]);
void Print_allorder(Order_class*order);
void write_order(Order_class* order, const char* src);
void Admin_Deleteorder(Order_class * order, char id[7]);