C++課程設計--小區物業管理系統設計(MFC)

課設題目

小區物業管理系統設計

課設要求

設計內容
        對某小區的物業管理進行調研和需求分析,設計業主信息和房屋信息,實現小區物業管理(包括物業費,電梯費,水費,暖氣費等)。系統可設置收費標準,物業費、電梯費和暖氣費收取均根據房屋面積計算得到。主要功能包括:

  1. 用戶管理
  2. 房屋信息和業主信息的錄入、 修改、刪除和文件導入
  3. 季度費用信息的手工錄入,修改、刪除和文件導入
  4. 按樓號+房號查詢業主交費信息
  5. 小區房 屋維修記錄的錄入、刪除和查詢
  6. 按樓號、季度統計未交費的房號,並輸出房號,業主姓名,電話和費用,保存到文件中
  7. 小區公告管理

程序運行界面

在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述

部分源碼

void CFangwuManDlg::OnButton5() 
{
	CString strtemp;
	GetDlgItem(IDC_EDIT1)->GetWindowText(strtemp);
	Cfangwu *  ptr = Cfangwu::Gethbinfo(strtemp.GetBuffer(100));
	strtemp.ReleaseBuffer();
	
	if(ptr != NULL)
	{
		GetDlgItem(IDC_EDIT1)->SetWindowText(ptr->szzkz);
		GetDlgItem(IDC_EDIT2)->SetWindowText(ptr->name);
		GetDlgItem(IDC_EDIT3)->SetWindowText(ptr->yezhu);
		GetDlgItem(IDC_EDIT4)->SetWindowText(ptr->phone);
		GetDlgItem(IDC_EDIT5)->SetWindowText(ptr->mianji);
		
	}
	else
		AfxMessageBox("無記錄");
	
}

void CFangwuManDlg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	Cfangwu st;
	memset(&st,0,sizeof(st));
	
	CString strtemp;
	GetDlgItem(IDC_EDIT1)->GetWindowText(strtemp);
	strcpy(st.szzkz,strtemp);
	
	GetDlgItem(IDC_EDIT2)->GetWindowText(strtemp);
	strcpy(st.name,strtemp);
	
	GetDlgItem(IDC_EDIT3)->GetWindowText(strtemp);
	strcpy(st.yezhu,strtemp);
	
	GetDlgItem(IDC_EDIT4)->GetWindowText(strtemp);
	strcpy(st.phone,strtemp);
	
	GetDlgItem(IDC_EDIT5)->GetWindowText(strtemp);
	strcpy(st.mianji,strtemp);
	
	
	if(Cfangwu::inputhb(st))
	{
		AfxMessageBox("添加成功");
	}
	else
	{
		AfxMessageBox("添加失敗。確定該信息已經存在");
	}
}

void CFangwuManDlg::OnButton2() 
{
	// TODO: Add your control notification handler code here
	CString strtemp;
	GetDlgItem(IDC_EDIT1)->GetWindowText(strtemp);
	Cfangwu *  ptr = Cfangwu::Gethbinfo(strtemp.GetBuffer(100));
	strtemp.ReleaseBuffer();
	
	if(ptr != NULL)
	{
		
		GetDlgItem(IDC_EDIT2)->GetWindowText(strtemp);
		strcpy(ptr->name,strtemp);
		
		GetDlgItem(IDC_EDIT3)->GetWindowText(strtemp);
		strcpy(ptr->yezhu,strtemp);
		
		GetDlgItem(IDC_EDIT4)->GetWindowText(strtemp);
		strcpy(ptr->phone,strtemp);
		
		GetDlgItem(IDC_EDIT5)->GetWindowText(strtemp);
		strcpy(ptr->mianji,strtemp);
		
		
		AfxMessageBox("修改成功");
	}
	else
		AfxMessageBox("無記錄");
}

void CFangwuManDlg::OnButton6() 
{
	CString strtemp;
	GetDlgItem(IDC_EDIT1)->GetWindowText(strtemp);
	Cfangwu *  ptr = Cfangwu::Gethbinfo(strtemp.GetBuffer(100));
	strtemp.ReleaseBuffer();
	
	vector<Cfangwu> * pall = Cfangwu::GetAllhb();
	if (ptr != NULL)
	{
		vector<Cfangwu>::iterator it;
		for (it = pall->begin(); it != pall->end() ; it++)
		{
			if(strcmp((*it).szzkz, ptr->szzkz) == 0)
			{
				pall->erase(it);
				AfxMessageBox("刪除成功");
				return;
			}
		}
	}
	else
	{
		AfxMessageBox("不存在該信息");
	}
	
}

void CFangwuManDlg::OnButton10() 
{
	// TODO: Add your control notification handler code here
	CListCtrl *plist = (CListCtrl *)GetDlgItem(IDC_LIST1);
	plist->DeleteAllItems();
	
	
	
	CString strtemp;
	int i = 0;
	int iall = 0;
	
	vector<Cfangwu> *VEC1 = Cfangwu::GetAllhb();
	for(i = 0; i < VEC1->size(); i++)
	{
		Cfangwu st = VEC1->at(i);
		
		strtemp.Format("%d",iall+1);
		plist->InsertItem(iall,"");
		plist->SetItemText(iall,0,strtemp);
		
		
		plist->SetItemText(iall,1,st.szzkz);
		plist->SetItemText(iall,2,st.name);
		plist->SetItemText(iall,3,st.yezhu);
		plist->SetItemText(iall,4,st.phone);
		plist->SetItemText(iall,5,st.mianji);
		iall+=1;
		
	}
}

項目源碼

需要源碼的小夥伴請前往
微信公衆號:海轟Pro
回覆: 海轟
O(∩_∩)O哈哈~

發佈了162 篇原創文章 · 獲贊 112 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章