Exemplo n.º 1
0
void CDialog_Material::OnBnClickedBtbSave()
{
	// TODO: 在此添加控件通知处理程序代码
	if(!m_date.GetDel())
		if(::MessageBox(::GetActiveWindow(),_T("此信息已经被删除了,是否重新保存恢复?"),_T("提示"),MB_YESNO) == IDNO)
			return ;
	m_name_ctrl.GetWindowText(m_date.m_name);
	if(m_date.m_name.IsEmpty())
	{
		CRuntimeMessageBox::RunMessageBox("请输入正确的材料名字");
		return;
	}
	m_modal_ctrl.GetWindowText(m_date.m_modal);
	if(m_date.m_modal.IsEmpty())
	{
		CRuntimeMessageBox::RunMessageBox("请输入正确的材料型号");
		return;
	}
	m_manufacturer_ctrl.GetWindowText(m_date.m_manufacturer);
	if(m_date.m_manufacturer.IsEmpty())
	{
		CRuntimeMessageBox::RunMessageBox("请输入正确的生产厂家");
		return;
	}
	m_unit_ctrl.GetWindowText(m_date.m_unit);
	if(m_date.m_unit.IsEmpty())
	{
		CRuntimeMessageBox::RunMessageBox("请输入正确的单位");
		return;
	}
	m_price_ctrl.GetWindowText(m_date.m_price);
	if(m_date.m_price.IsEmpty())
	{
		CRuntimeMessageBox::RunMessageBox("请输入正确的单价");
		return;
	}
	m_detail_ctrl.GetWindowText(m_date.m_detail);

	CControl_material tmp;
	tmp.SetData(&m_date);
	if (tmp.Save())
	{
		CRuntimeMessageBox::RunMessageBox("保存成功!");

		OnOK();
	}
	else
	{
		CRuntimeMessageBox::RunMessageBox("保存失败!");
	}
}
Exemplo n.º 2
0
BOOL CDialog_Material::OnInitDialog()
{
	CDialog::OnInitDialog();

	if(!m_date.GetId().empty())
	{
		if(m_date.m_unit.IsEmpty())
		{
			CControl_material tmp;
			m_date = tmp.Search_byId(m_date.GetId());
		}
		m_name_ctrl.SetWindowText(m_date.m_name);
		m_modal_ctrl.SetWindowText(m_date.m_modal);
		m_manufacturer_ctrl.SetWindowText(m_date.m_manufacturer);
		m_unit_ctrl.SetWindowText(m_date.m_unit);
		m_price_ctrl.SetWindowText(m_date.m_price);
		m_detail_ctrl.SetWindowText(m_date.m_detail);
	}
	return FALSE;
}
Exemplo n.º 3
0
void CDialog_Check::InitComobox(const int &initFlag )
{
	CDate_search condition;
	if(initFlag == -1 || initFlag == 0)
	{
		CControl_material tmpm;
		m_allMaterial = tmpm.SearchList_Material(condition);

		m_mName_ctrl.Clear();
		for (int i = 0;i< m_allMaterial.size() ;i++)
		{
			m_mName_ctrl.AddString(m_allMaterial[i].m_name);
		}
		m_mName_ctrl.SetCurSel(0);
	}
	if(initFlag == -1 || initFlag == 1)
	{
		CControl_user tmpu;
		m_allUser = tmpu.SearchList_UserInfo(condition);
		m_pName_ctrl.Clear();
		for (int i = 0;i< m_allUser.size() ;i++)
		{
			m_pName_ctrl.AddString(m_allUser[i].m_name);
		}
		m_pName_ctrl.SetCurSel(0);
	}
	if (initFlag == -1 || initFlag == 2)
	{
		CControl_class tmpc;
		m_allClass = tmpc.SearchList_Class(condition);
		m_cName_ctrl.Clear();
		for (int i = 0;i< m_allClass.size() ;i++)
		{
			m_cName_ctrl.AddString(m_allClass[i].m_name);
		}
		m_cName_ctrl.SetCurSel(0);
	}
}
Exemplo n.º 4
0
void CDialog_Material_Stats::OnBnClickedSearchBtn()
{
	// TODO: 在此添加控件通知处理程序代码

	if(BST_CHECKED == IsDlgButtonChecked( IDC_CHECK2 ))
	{
		m_tBegin_ctrl.GetWindowText(m_searcher.m_tBegin);
		m_tEnd_ctrl.GetWindowText(m_searcher.m_tEnd);
		if(m_searcher.m_tBegin.IsEmpty() || m_searcher.m_tEnd.IsEmpty())
		{
			CRuntimeMessageBox::RunMessageBox("请输入正确的时间");
			return;
		}
	}
	else
	{
		m_searcher.m_aBegin.Empty();
		m_searcher.m_tEnd.Empty();
	}
	CControl_material tmp;
	m_searchDates = tmp.SearchList_Material(m_searcher);

	FormatSearchDates(m_modal.GetCurSel());
}