📄 studentview.cpp
字号:
{
m_Dlg_XjDjjc->ShowWindow(SW_HIDE);
}
if(m_Dlg_XjXfx !=NULL)
{
m_Dlg_XjXfx->ShowWindow(SW_HIDE);
}
if(m_Dlg_Yh !=NULL)
{
m_Dlg_Yh->ShowWindow(SW_HIDE);
}
switch(nID)
{
case IDD_DLG_BY_BYS:
if(m_Dlg_ByBys !=NULL)
{
m_Dlg_ByBys->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_ByBys =new CByBysDlg(this);
m_Dlg_ByBys->m_parent = this;
m_Dlg_ByBys->Create(IDD_DLG_BY_BYS,this);
m_Dlg_ByBys->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_BY_BYS,"查看毕业生",9);
}
break;
case IDD_DLG_BY_CL:
if(m_Dlg_ByCl !=NULL)
{
m_Dlg_ByCl->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_ByCl =new CByClDlg(this);
m_Dlg_ByCl->m_parent = this;
m_Dlg_ByCl->Create(IDD_DLG_BY_CL,this);
m_Dlg_ByCl->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_BY_CL,"毕业处理",1);
}
break;
case IDD_DLG_BY_JYS:
if(m_Dlg_ByJys !=NULL)
{
m_Dlg_ByJys->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_ByJys =new CByJysDlg(this);
m_Dlg_ByJys->m_parent = this;
m_Dlg_ByJys->Create(IDD_DLG_BY_JYS,this);
m_Dlg_ByJys->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_BY_JYS,"查看结业生",2);
}
break;
case IDD_DLG_CJ_CX:
if(m_Dlg_CjCx !=NULL)
{
m_Dlg_CjCx->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_CjCx =new CCjCxDlg(this);
m_Dlg_CjCx->m_parent = this;
m_Dlg_CjCx->Create(IDD_DLG_CJ_CX,this);
m_Dlg_CjCx->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_CJ_CX,"成绩查询",3);
}
break;
case IDD_DLG_CJ_RK:
if(m_Dlg_CjRk !=NULL)
{
m_Dlg_CjRk->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_CjRk =new CCjRkDlg(this);
m_Dlg_CjRk->m_parent = this;
m_Dlg_CjRk->Create(IDD_DLG_CJ_RK,this);
m_Dlg_CjRk->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_CJ_RK,"成绩登记入库",4);
}
break;
case IDD_DLG_DA_DJXS:
if(m_Dlg_DaDjxs !=NULL)
{
m_Dlg_DaDjxs->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_DaDjxs =new CDaDjxsDlg(this);
m_Dlg_DaDjxs->m_parent = this;
m_Dlg_DaDjxs->Create(IDD_DLG_DA_DJXS,this);
m_Dlg_DaDjxs->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_DA_DJXS,"登记学生",5);
}
break;
case IDD_DLG_DA_CX:
if(m_Dlg_DaCx !=NULL)
{
m_Dlg_DaCx->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_DaCx =new CDaCxDlg(this);
m_Dlg_DaCx->m_parent = this;
m_Dlg_DaCx->Create(IDD_DLG_DA_CX,this);
m_Dlg_DaCx->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_DA_CX,"学生信息查询",6);
}
break;
case IDD_DLG_XJ_DJJC:
if(m_Dlg_XjDjjc !=NULL)
{
m_Dlg_XjDjjc->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_XjDjjc =new CXjDjjcDlg(this);
m_Dlg_XjDjjc->m_parent = this;
m_Dlg_XjDjjc->Create(IDD_DLG_XJ_DJJC,this);
m_Dlg_XjDjjc->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_XJ_DJJC,"登记奖惩",7);
}
break;
case IDD_DLG_XJ_XFX:
if(m_Dlg_XjXfx !=NULL)
{
m_Dlg_XjXfx->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_XjXfx =new CXjXfxDlg(this);
m_Dlg_XjXfx->m_parent = this;
m_Dlg_XjXfx->Create(IDD_DLG_XJ_XFX,this);
m_Dlg_XjXfx->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_XJ_XFX,"修复学处理",8);
}
break;
case IDD_DLG_YH:
if(m_Dlg_Yh !=NULL)
{
m_Dlg_Yh->ShowWindow(SW_SHOW);
}
else
{
m_Dlg_Yh =new CYhDlg(this);
m_Dlg_Yh->m_parent = this;
m_Dlg_Yh->Create(IDD_DLG_YH,this);
m_Dlg_Yh->ShowWindow(SW_SHOW);
m_listCtrlGN.SetImageList(imageList,0);
m_listCtrlGN.InsertItem(IDD_DLG_YH,"用户管理",0);
}
break;
default:
return false;
}
m_listCtrlGN.Invalidate();
return true;
}
void CStudentView::OnMenuByBys()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_BY_BYS);
}
void CStudentView::OnMenuByCl()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_BY_CL);
}
void CStudentView::OnMenuCjCx()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_CJ_CX);
}
void CStudentView::OnMenuCjRk()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_CJ_RK);
}
void CStudentView::OnMenuDaCx()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_DA_CX);
}
void CStudentView::OnMenuDaDjxs()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_DA_DJXS);
}
void CStudentView::OnMenuXjDjjc()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_XJ_DJJC);
}
void CStudentView::OnMenuXjXfx()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_XJ_XFX);
}
void CStudentView::OnMenuYh()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_YH);
}
void CStudentView::OnMenuiByJys()
{
// TODO: Add your command handler code here
this->OpenGNDlg(IDD_DLG_BY_JYS);
}
void CStudentView::OnClickListGn(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
int index = m_listCtrlGN.GetSelectionMark();
if(index<0)
{
return;
}
if(m_Dlg_ByBys !=NULL)
{
m_Dlg_ByBys->ShowWindow(SW_HIDE);
}
if(m_Dlg_ByCl !=NULL)
{
m_Dlg_ByCl->ShowWindow(SW_HIDE);
}
if(m_Dlg_ByJys !=NULL)
{
m_Dlg_ByJys->ShowWindow(SW_HIDE);
}
if(m_Dlg_CjCx !=NULL)
{
m_Dlg_CjCx->ShowWindow(SW_HIDE);
}
if(m_Dlg_CjRk !=NULL)
{
m_Dlg_CjRk->ShowWindow(SW_HIDE);
}
if(m_Dlg_DaCx !=NULL)
{
m_Dlg_DaCx->ShowWindow(SW_HIDE);
}
if(m_Dlg_DaDjxs !=NULL)
{
m_Dlg_DaDjxs->ShowWindow(SW_HIDE);
}
if(m_Dlg_XjDjjc !=NULL)
{
m_Dlg_XjDjjc->ShowWindow(SW_HIDE);
}
if(m_Dlg_XjXfx !=NULL)
{
m_Dlg_XjXfx->ShowWindow(SW_HIDE);
}
if(m_Dlg_Yh !=NULL)
{
m_Dlg_Yh->ShowWindow(SW_HIDE);
}
CString st=m_listCtrlGN.GetItemText(index,0);
if(st.Compare("登记奖惩") ==0)
{
if(m_Dlg_XjDjjc !=NULL)
{
m_Dlg_XjDjjc->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("修复学处理") ==0)
{
if(m_Dlg_XjXfx !=NULL)
{
m_Dlg_XjXfx->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("登记学生") ==0)
{
if(m_Dlg_DaDjxs !=NULL)
{
m_Dlg_DaDjxs->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("学生信息查询") ==0)
{
if(m_Dlg_DaCx !=NULL)
{
m_Dlg_DaCx->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("毕业处理") ==0)
{
if(m_Dlg_ByCl !=NULL)
{
m_Dlg_ByCl->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("查看毕业生") ==0)
{
if(m_Dlg_ByBys !=NULL)
{
m_Dlg_ByBys->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("查看结业生") ==0)
{
if(m_Dlg_ByJys !=NULL)
{
m_Dlg_ByJys->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("成绩登记入库") ==0)
{
if(m_Dlg_CjRk !=NULL)
{
m_Dlg_CjRk->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("成绩查询") ==0)
{
if(m_Dlg_CjCx !=NULL)
{
m_Dlg_CjCx->ShowWindow(SW_SHOW);
}
}
else if(st.Compare("用户管理") ==0)
{
if(m_Dlg_Yh !=NULL)
{
m_Dlg_Yh->ShowWindow(SW_SHOW);
}
}
*pResult = 0;
}
void CStudentView::OnClickCommandbutton1()
{
// TODO: Add your control notification handler code here
CloseAllGNDlg();
if(IsGNInMenu(ID_MENU_XJ_DJJC))
{
OpenGNDlg(IDD_DLG_XJ_DJJC);
m_Dlg_XjDjjc->ShowWindow(SW_HIDE);
}
if(IsGNInMenu(ID_MENU_XJ_XFX))
{
OpenGNDlg(IDD_DLG_XJ_XFX);
m_Dlg_XjXfx->ShowWindow(SW_HIDE);
}
}
void CStudentView::OnClickCommandbutton2()
{
// TODO: Add your control notification handler code here
CloseAllGNDlg();
if(IsGNInMenu(ID_MENU_DA_CX))
{
OpenGNDlg(IDD_DLG_DA_CX);
m_Dlg_DaCx->ShowWindow(SW_HIDE);
}
if(IsGNInMenu(ID_MENU_DA_DJXS))
{
OpenGNDlg(IDD_DLG_DA_DJXS);
m_Dlg_DaDjxs->ShowWindow(SW_HIDE);
}
}
void CStudentView::OnClickCommandbutton3()
{
// TODO: Add your control notification handler code here
CloseAllGNDlg();
if(IsGNInMenu(ID_MENU_BY_CL))
{
OpenGNDlg(IDD_DLG_BY_CL);
m_Dlg_ByCl->ShowWindow(SW_HIDE);
}
if(IsGNInMenu(ID_MENU_BY_BYS))
{
OpenGNDlg(IDD_DLG_BY_BYS);
m_Dlg_ByBys->ShowWindow(SW_HIDE);
}
if(IsGNInMenu(ID_MENUI_BY_JYS))
{
OpenGNDlg(IDD_DLG_BY_JYS);
m_Dlg_ByJys->ShowWindow(SW_HIDE);
}
}
void CStudentView::OnClickCommandbutton4()
{
// TODO: Add your control notification handler code here
CloseAllGNDlg();
if(IsGNInMenu(ID_MENU_CJ_CX))
{
OpenGNDlg(IDD_DLG_CJ_CX);
m_Dlg_CjCx->ShowWindow(SW_HIDE);
}
if(IsGNInMenu(ID_MENU_CJ_RK))
{
OpenGNDlg(IDD_DLG_CJ_RK);
m_Dlg_CjRk->ShowWindow(SW_HIDE);
}
}
void CStudentView::CloseAllGNDlg()
{
if(m_Dlg_ByBys !=NULL)
{
m_Dlg_ByBys->DestroyWindow();
m_Dlg_ByBys = NULL;
LVFINDINFO info;
info.psz = "查看毕业生";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_ByCl !=NULL)
{
m_Dlg_ByCl->DestroyWindow();
m_Dlg_ByCl = NULL;
LVFINDINFO info;
info.psz = "毕业处理";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_ByJys !=NULL)
{
m_Dlg_ByJys->DestroyWindow();
m_Dlg_ByJys = NULL;
LVFINDINFO info;
info.psz = "查看结业生";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_CjCx !=NULL)
{
m_Dlg_CjCx->DestroyWindow();
m_Dlg_CjCx = NULL;
LVFINDINFO info;
info.psz = "成绩查询";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_CjRk !=NULL)
{
m_Dlg_CjRk->DestroyWindow();
m_Dlg_CjRk = NULL;
LVFINDINFO info;
info.psz = "成绩登记入库";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_DaCx !=NULL)
{
m_Dlg_DaCx->DestroyWindow();
m_Dlg_DaCx = NULL;
LVFINDINFO info;
info.psz = "学生信息查询";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_DaDjxs !=NULL)
{
m_Dlg_DaDjxs->DestroyWindow();
m_Dlg_DaDjxs = NULL;
LVFINDINFO info;
info.psz = "登记学生";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_XjDjjc !=NULL)
{
m_Dlg_XjDjjc->DestroyWindow();
m_Dlg_XjDjjc = NULL;
LVFINDINFO info;
info.psz = "登记奖惩";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_XjXfx !=NULL)
{
m_Dlg_XjXfx->DestroyWindow();
m_Dlg_XjXfx = NULL;
LVFINDINFO info;
info.psz = "修复学处理";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
if(m_Dlg_Yh !=NULL)
{
m_Dlg_Yh->DestroyWindow();
m_Dlg_Yh = NULL;
LVFINDINFO info;
info.psz = "用户管理";
info.flags = LVFI_STRING;
this->m_listCtrlGN.DeleteItem(this->m_listCtrlGN.FindItem(&info)) ;
}
}
bool CStudentView::IsGNInMenu(UINT nID)
{
CMenu *menu = this->GetParent()->GetMenu(),*tmenu;
int count = menu->GetMenuItemCount(),tcount;
for(int i=0;i<count;i++)
{
if(menu->GetMenuItemID(i) == -1)
{
tmenu = menu->GetSubMenu(i);
tcount = tmenu->GetMenuItemCount();
for(int j=0;j<tcount;j++)
{
if(tmenu->GetMenuItemID(j) == nID)
{
return true;
}
}
}
else
{
if(menu->GetMenuItemID(i) == nID)
{
return true;
}
}
}
return false;
}
void CStudentView::StartPrintPreview()
{
this->OnFilePrintPreview();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -