当前位置:文档之家› 合同管理系统课程设计(大一)

合同管理系统课程设计(大一)


b[k].content << " " << b[k].y1 << " " << b[k].m1 << " " << b[k].d1 << " " << b[k].y2 << " " << b[k].m2 << " " << b[k].d2 << " " << b[k].m << " " << b[k].y3 << " " << b[k].m3 << " " << b[k].d3; cout << "删除成功" << endl; cout << "============" << endl; } else { cout << "未找到" << endl; cout << "============" << endl; for (k = 1; k <= i - 1; k++) { b[k] = a[k]; x << endl << b[k].num << " " << b[k].a << " " << b[k].b << " " << b[k].content << " " << b[k].y1 << " " << b[k].m1 << " " << b[k].d1 << " " << b[k].y2 << " " << b[k].m2 << " " << b[k].d2 << " " << b[k].m << " " << b[k].y3 << " " << b[k].m3 << " " << b[k].d3; } } x.close(); } void contract::change() { ifstream f("contract.txt", ios::in); int i = 0;
合同.cpp
#include "contract.h" void contract::add() { ifstream f("contract.txt", ios::in);
int numx = 0; string ax; string bx; string contentx; int y1x, y2x, y3x, m1x, m2x, m3x, d1x, d2x, d3x; int mx; while (f >> numx >> ax >> bx >> contentx >> y1x >> m1x >> d1x >> y2x >> m2x >> d2x >> mx >> y3x >> m3x >> d3x); numx++; f.close(); ofstream a("contract.txt", ios::out | ios::app); cout << "合同编号为:"; cout << numx << endl; cout << "请输入甲方姓名:"; cin >> ax; cout << "请输入乙方姓名:"; cin >> bx; cout << "请输入合同内容:"; cin >> contentx; cout << "请输入开始时间:"; cin >> y1x >> m1x >> d1x; cout << "请输入结束时间:"; cin >> y2x >> m2x >> d2x; cout << "请输入金额:"; cin >> mx; cout << "请输入签订日期:"; cin >> y3x >> m3x >> d3x; cout << "已增加" << endl; a << endl << numx << " " << ax << " " << bx << " " << contentx << " " << y1x << " " << m1x << " " << d1x << " " << y2x << " " << m2x << " " << d2x << " " << mx
<< " " << b[k].d3; }cout << "修改成功"; cout << "=========" << endl; } else { cout << "未找到" << endl; cout << "=========" << endl; for (k = 1; k <= i; k++) { b[k] = a[k]; x << endl << b[k].num << " " << b[k].a << " " << b[k].b << " " << b[k].content << " " << b[k].y1 << " " << b[k].m1 << " " << b[k].d1 << " " << b[k].y2 << " " << b[k].m2 << " " << b[k].d2 << " " << b[k].m << " " << b[k].y3 << " " << b[k].m3 << " " << b[k].d3; } } x.close(); } void contract::browse() { ifstream f("contract.txt", ios::in); int i = 0; int numx; string ax;
{ q = 1; break; } } if (q) { for (k = 1; k <= i; k++) { if (j == a[k].num) { cout << "合同编号为:"; cout << a[k].num << endl; cout << "请输入甲方姓名:"; cin >> a[k].a; cout << "请输入乙方姓名:"; cin >> a[k].b; cout << "请输入合同内容:"; cin >> a[k].content; cout << "请输入开始时间:"; cin >> a[k].y1 >> a[k].m1 >> a[k].d1; cout << "请输入结束时间:"; cin >> a[k].y2 >> a[k].m2 >> a[k].d2; cout << "请输入金额:"; cin >> a[k].m; cout << "请输入签订日期:"; cin >> a[k].y3 >> a[k].m3 >> a[k].d3; } } for (k = 1; k <= i; k++) { b[k] = a[k]; x << endl << b[k].num << " " << b[k].a << " " << b[k].b << " " << b[k].content << " " << b[k].y1 << " " << b[k].m1 << " " << b[k].d1 << " " << b[k].y2 << " " << b[k].m2 << " " << b[k].d2 << " " << b[k].m << " " << b[k].y3 << " " << b[k].m3
ofstream x("contract.txt", ios::out); int j; cout << "请输入合同编号:"; cin >> j; int k = 0; int q = 0; for (k = 1; k <= i; k++) { if (j == a[k].num) { q = 1; break; } } if (q) { for (k = 1; k <= i; k++) { int w; if (j == a[1].num) { for (w = 1; w <= i - 1; w++)b[w] = a[w + 1]; break; } else if (j == a[i].num) { for (w = 1; w <= i - 1; w++) b[w] = a[w]; break; } else if (j == a[k].num) { for (w = 1; w < i; w++) { if (w < k)b[w] = a[w]; else if (w >= k)b[w] = a[w + 1]; } break; } } for (k = 1; k <= i - 1; k++) x << endl << b[k].num << " " << b[k].a << " " << b[k].b << " " <<
合同管理系统课程设计
该课程设计应用数组的形式对数据进行处理,仅供参考,个人所有,禁止转载。 课程设计要求: 基本要求:能从文件读出合同信息,并能将信息保存到文件 合同的基本信息包括:合同编号、合同签订甲方、合同签订乙方、合同内容、合同有效 期限(开始时间) 、合同有效期限(结束时间) 、金额、签订日期 功能要求: 1)增加和删除合同、修改合同 2)查询到期合同 3)根据甲方或者乙方查询合同 4)所有合同浏览(以签订日期排序显示) 5)按自然月为单位输出该月签订的合同数量。
以下为代码:
合同.h
#ifndef CONTRACT #define CONTRACT #include <string> #include <iostream> #include <fstrLeabharlann Baiduam> #include <time.h> #include <windows.h> //取系统时间要用到 //取系统时间要用到 //取系统时间要用到
#pragma warning( disable : 4996 ) using namespace std; class contract {
int num; string a; string b; string content; int y1, y2, y3, m1, m2, m3, d1, d2, d3; int m; public: contract() :num(0), a("0"), b("0"), content("0"), y1(0), m1(0), d1(0), y2(0), m2(0), d2(0), m(0), y3(0), m3(0), d3(0) {}; void add(); void remove(); void change(); void browse(); void find(); void find1(); void find2(); }; #endif //增加 //删除 //修改 //浏览 //根据人查找 //查询到期合同 //查询月份合同
<< " " << y3x << " " << m3x << " " << d3x; a.close(); } void contract::remove() { ifstream f("contract.txt", ios::in); int i = 0; int numx; string ax; string bx; string contentx; int y1x, y2x, y3x, m1x, m2x, m3x, d1x, d2x, d3x; int mx; contract a[100]; contract b[100]; while (f >> numx >> ax >> bx >> contentx >> y1x >> m1x >> d1x >> y2x >> m2x >> d2x >> mx >> y3x >> m3x >> d3x) { i++; a[i].num = numx, a[i].a = ax, a[i].b = bx, a[i].content = contentx, a[i].y1 = y1x, a[i].y2 = y2x, a[i].y3 = y3x, a[i].m1 = m1x, a[i].m2 = m2x, a[i].m3 = m3x, a[i].d1 = d1x, a[i].d2 = d2x, a[i].d3 = d3x, a[i].m = mx; } f.close();
int numx; string ax; string bx; string contentx; int y1x, y2x, y3x, m1x, m2x, m3x, d1x, d2x, d3x; int mx; contract a[100]; contract b[100]; while (f >> numx >> ax >> bx >> contentx >> y1x >> m1x >> d1x >> y2x >> m2x >> d2x >> mx >> y3x >> m3x >> d3x) { i++; a[i].num = numx, a[i].a = ax, a[i].b = bx, a[i].content = contentx, a[i].y1 = y1x, a[i].y2 = y2x, a[i].y3 = y3x, a[i].m1 = m1x, a[i].m2 = m2x, a[i].m3 = m3x, a[i].d1 = d1x, a[i].d2 = d2x, a[i].d3 = d3x, a[i].m = mx; } f.close(); ofstream x("contract.txt", ios::out); int j; cout << "请输入要修改的合同编号:"; cin >> j; int k = 0; int q = 0; for (k = 1; k <= i; k++) { if (j == a[k].num)
相关主题