⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oracledb.h

📁 在linux平台下模拟超市的收银系统即POS机
💻 H
字号:
#ifndef ORACLE_HEAD
#define ORACLE_HEAD
#include "linklist.h"
/*员工表结构*/
typedef struct staff
{
	char id[7];
	char name[16];
	char pwd[17];
	int type;
	char remark[31];
}staff;

/*商口表结构*/
typedef struct product 
{
	char bar_code[9];
	char product_name[31];
	char unit[17];
	char spec[17];
	float sale_price;
	float purchase_price;
	int count;
	float discount;
	
}product;



/*销售表结构*/
typedef struct sale 
{
	char sale_id[19];
	char trans_id[5];
	char staff_id[7];
	char sale_date[15];
	float given_sum;
	float real_sum;
	float sale_money;
	float change;
	int sale_state;
}sale;

/*销售细节*/
typedef struct sale_detail
{
	char detail_id[19];
	char sale_id[19];
	char bar_code[15];  /*9*/
	int count;
	float sale_price;
	int sale_state;
}sale_detail;

/*出售产品*/
typedef struct saleProduct
{
	char bar_code[9];/*商品ID*/
	char product_name[31];/*产品名称*/
	char unit[17];/*规格*/
	char spec[17];/*单位*/
	float sale_price;/*单价*/
	int amount;/*卖出商品数量*/
	float money;/*金额*/
} saleProduct;

typedef struct sale_tmp
{
	char sale_id[19];
	char staff_id[7];
}sale_tmp;


typedef struct staff_indicator /*staff结构体的指示器*/
{
	short id;
	short name;
	short pwd;
	short type;
	short remark;
}staff_ind;

#endif

/*日志文件*/
int error_login(char *msg,char *fname,int len);

/*查询员工名*/
int Get_Staff_Name(char * staff_id,char * staff_name);

/*跟据条形码取得记录*/
int Get_ProductInfo_By_Barcode(char * bar_code,product * pro);
void select_staff_table(char * name);
int check_login(char * username,char * password ,int * type);
int db_connection(char * username,char * password);

/*插入到销售明细表*/
int Insert_To_Sale_Detail(char * detail_id,char * sale_id,char *bar_code,int count,float sale_price,int state);

/*去掉左右空格*/
void Trim(char * ch);

/*取得时间序列*/
int Get_Trans_Seque();
int Get_Detail_Seque();

/*插入到销售表*/
void InsertIntoSale(char *sale_id,char* trans_id,char *staff_id,char * sale_date,float sale_money,int sale_state);

/*添加销售明细*/
/*void InsertIntoSaleDetail(sale_detail * saleDetail);*/

/*减少商品库存量*/
void ReduceStock(char * barcode,int amount); /*barcode 条形码 amount 为要减少的数量*/
/*查询挂单编号*/
int Get_Hang_Bill_List(LINKLIST *linklist,char * staff_id);

/*删除一个sale表中符合sale_id的记录*/
int Delete_Bill(char *sale_id);

/*通过销售单号查询商品信息*/
int get_product_by_hang_id(char* sale_id,LINKLIST* linklist);

/*更新指定条形码的数据*/
int Update_ProductInfo_By_Barcode(char * bar_code,product * pro);


/*删除指定条形码的数据*/
int Delete_ProductInfo_By_Barcode(char * barcode);

/*根据销售编号和条形码得到销售数量和单价*/
int Get_Sale_Detail(char * sale_id,char * bar_code,int * count,float * sale_price);


/*退货完,修改出售商品状态*/
int Modify_Sale_Detail_State(char * sale_id,char * bar_code);

/*退货后修改销售商品总金额*/
void Modify_Sale_Money(char * sale_id,float money);

/*根据条码查找商品是否存在*/
int search_exist(char* barcode);

/*插入到product*/

int Insert_Into_Product(char * bar_code,char * product_name,char *unit,char *spec,float sale_price,float purchase_price,int count,float discount);

/*根据帐户ID查找用户是否存在*/
int search_staff_id_exist(char* staff_id);

/*取得指定ID的员工信息*/
int Get_Staff_By_ID(char * staff_id,staff * pStaff);

/*添加员工到staff表中*/
int Insert_Into_Staff(char * staff_id,char * staff_name,char * staff_pwd,int staff_type, char * remark);

/*更新指定ID的帐户数据*/
int Update_Staff_By_ID(char * staff_id,staff * pStaff);

/*删除指定ID的用户*/
int Delete_Staff_By_ID(char * staff_id);

/*获取商品信息总页数 返回总页码 recourNum 代表的是每页显示多少记录*/
int Get_ProductInfo_TotalPageNumber(int recourNum);

/*取得指定页码的商品信息*/
int Get_ProductInfo_By_PageNumber(LINKLIST *linklist,int page,int recourdNum);


/*获取帐户信息总页数 返回总页码 recordNum代表的是一页有多少条记录*/
int Get_Staff_TotalPageNumber(int recordNum);

/*取得指定页码的商品信息*/
int Get_Staff_By_PageNumber(LINKLIST *linklist,int page,int recourdNum);

/*按日期查找 查询销售*/
int Search_SaleInfo_By_Date(LINKLIST * linklist, char * startdate,char * enddate);


/*按员工编号查询销售*/
int Search_SaleInfo_By_StaffID(LINKLIST * linklist, char * staff_id);








⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -