-
Notifications
You must be signed in to change notification settings - Fork 0
/
structtype.h
142 lines (127 loc) · 2.94 KB
/
structtype.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#ifndef STRUCTTYPE_H_INCLUDED
#define STRUCTTYPE_H_INCLUDED
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#include<windows.h>
#include<io.h>
#define size 1000
#define maxsize 2000000000
/*记录类型*/
typedef enum recordtype
{
nullrecord,stock,wholesale,retail,present//空类型,进货,批发,零售,赠品
}Recordtype;
/*客户类型*/
typedef enum clienttype
{
nullclient,individual,group//空类型,个人,团体
}Clienttype;
/*性别*/
typedef enum gender
{
nullgender,male,female//无,男,女
}Gender;
/*供货商*/
struct b_supply
{
int id;
char name[size];
double modify;
struct b_supply *next;
};
typedef struct b_supply Supply;
/*配件型号*/
struct c_parttype
{
int id;//配件型号编号,头结点编号为0
char name[size];//配件型号名称
int store;//配件库存
char partman[size];//制造商
int keynum;//临界数量,购买超过指定数量则有赠品
double stock_price;//进货单价
double wholesale_price;//批发单价
double retail_price;//零售单价
double modify;//单价动态修正指数
};
typedef struct c_parttype Parttype;
/*配件*/
struct b_part
{
int id;//配件编号,头结点编号为0
char name[size];//配件名称
// Parttype *c_parttype;//配件型号
// struct b_part *c_partnext;
};
typedef struct b_part Part;
/*日期*/
struct b_date
{
int month;//月
int day;//日
int hour;//时
int minute;//分
};
typedef struct b_date Date;
/*客户信息*/
struct b_client
{
int id;//客户编号,头结点编号为0
double modify;
Clienttype c_clienttype;//客户类型:个人/团体
Gender gender;//客户性别(若为个人)
char name[size];//客户名称
char unit[size];//客户单位
struct b_client *next;
};
typedef struct b_client Client;
/*礼物*/
struct Present_node
{
Part *part;
Parttype *parttype;
int amount;
struct Present_node *next;
};
typedef struct Present_node Present;
/**记录**/
struct a_record
{
int id;//记录编号,头结点编号为0
Recordtype recordtype;//记录类型:空,进货,批发,零售
Date b_date;//日期,赠品无日期
Part *b_part;//配件
Parttype *b_parttype;//配件型号
Supply *b_supply;//供货商(不需要申请空间)
Client *b_client;//客户(不需要申请空间)
int amount;//数量
double unit_price;//单价
double total_price;//总价
Present *b_present;//赠品链表
int color;//颜色,默认为0
struct a_record *b_recordnext;
};
typedef struct a_record Record;
/*数据库*/
struct B_data_part_type
{
Parttype data;
struct B_data_part_type *next;
};
typedef struct B_data_part_type Parttype_list;
struct A_data_part
{
Part data;
struct A_data_part *next;
Parttype_list *type_list;
};
typedef struct A_data_part Part_list;
extern int monthday[13];
extern double money;
extern Part_list *datapart;
extern Supply *datasupply;
extern Client *dataclient;
extern Record *recordall;
#endif // STRUCTTYPE_H_INCLUDED