C++课程设计--医院门诊信息管理系统设计(MFC)

课设题目

医院门诊信息管理系统设计

课设要求

  1. 用户管理
  2. 医生基本信息的录入、修改,删除和文件导入
  3. 患者挂号信息的录入、修改、删除和文件导入
  4. 医生填写患者病历
  5. 病历信息删除和查询
  6. 按时间(天、 月、季度、年)、科室统计就诊病人数量
  7. 医生信息查询
  8. 将各类记录信息和统计报表导出到文件中

程序运行界面

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

核心代码

// statistics.cpp : implementation file
//

#include "stdafx.h"
#include "医院门诊系统.h"
#include "statistics.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// statistics dialog


statistics::statistics(CWnd* pParent /*=NULL*/)
	: CDialog(statistics::IDD, pParent)
{
	//{{AFX_DATA_INIT(statistics)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void statistics::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(statistics)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(statistics, CDialog)
	//{{AFX_MSG_MAP(statistics)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	ON_BN_CLICKED(IDC_BUTTON8, OnButton8)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// statistics message handlers

void statistics::OnButton1() 
{
	// TODO: Add your control notification handler code here
	CString str; //获取系统时间
	CTime tm; tm=CTime::GetCurrentTime();
	str=tm.Format("%m")+"月";

	FILE *file=fopen("patient.txt","r");
	int a=0;
	char x0[20];
	char x1[20];
	char x2[20];
	char x3[20];
	char x4[20];
	char x5[20];
	float count=0;
	
	CString str1="收入";
	CString str2="支出";

	while(!feof(file))
	{
		fscanf(file,"%s%s%s%s%s",&x0,&x1,&x2,&x3,&x4);
		if(strcmp(x3,str)==0)
		{
		
			count++;		
		}
	}
	fclose(file);

	CString aaa;
	aaa.Format("当天人数为:%f",count-1);

	MessageBox(aaa);

}

void statistics::OnButton2() 
{
	// TODO: Add your control notification handler code here
		// TODO: Add your control notification handler code here
	CString str; //获取系统时间
	CTime tm; tm=CTime::GetCurrentTime();
	str=tm.Format("%m")+"月";

	FILE *file=fopen("patient.txt","r");
	int a=0;
	char x0[20];
	char x1[20];
	char x2[20];
	char x3[20];
	char x4[20];
	char x5[20];
	float count=0;
	
	while(!feof(file))
	{
		fscanf(file,"%s%s%s%s%s",&x0,&x1,&x2,&x3,&x4);
		if(strcmp(x3,str)==0)
		{
		
			count++;		
		}
	}
	fclose(file);

	CString aaa;
	aaa.Format("当月人数为:%f",count-1);

	MessageBox(aaa);
}

void statistics::OnButton3() 
{
	// TODO: Add your control notification handler code here
	CString str; //获取系统时间
	CTime tm; tm=CTime::GetCurrentTime();
	str=tm.Format("%m")+"月";

	FILE *file=fopen("patient.txt","r");
	int a=0;
	char x0[20];
	char x1[20];
	char x2[20];
	char x3[20];
	char x4[20];
	char x5[20];
	float count=0;
	


	while(!feof(file))
	{
		fscanf(file,"%s%s%s%s%s",&x0,&x1,&x2,&x3,&x4);
		if(strcmp(x3,str)==0)
		{
		
			count++;		
		}
	}
	fclose(file);

	CString aaa;
	aaa.Format("当季度人数为:%f",count-1);

	MessageBox(aaa);	
}

void statistics::OnButton8() 
{
	// TODO: Add your control notification handler code here
		CString str; //获取系统时间
	GetDlgItem(IDC_EDIT3)->GetWindowText(str);
if(str=="")
{

	MessageBox("请输入科室名字!");
}
else
{
FILE *file=fopen("patient.txt","r");
	int a=0;
	char x0[20];
	char x1[20];
	char x2[20];
	char x3[20];
	char x4[20];
	char x5[20];
	float count=0;
	

	while(!feof(file))
	{
		fscanf(file,"%s%s%s%s%s",&x0,&x1,&x2,&x3,&x4);
		if(strcmp(x2,str)==0)
		{
		
			count++;		
		}
	}
	fclose(file);

	CString aaa;
	aaa.Format("该科室诊断人数为:%f",count-1);

	MessageBox(aaa);

}
	
}

项目源码

需要源码的小伙伴请前往
微信公众号:海轰Pro
回复: 海轰
O(∩_∩)O哈哈~

发布了155 篇原创文章 · 获赞 110 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/weixin_44225182/article/details/103956388