⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yszmcxdlg.cpp

📁 这是一套学校设备管理系统的源码 里面有树形结构使用的很棒的方法
💻 CPP
📖 第 1 页 / 共 5 页
字号:
		    strcpy(zje,tzm.zje);
		    strcpy(rkfs,tzm.rkfs);
		    strcpy(sfdzp,tzm.sfdzp);
		    strcpy(ssbm,tzm.ssbm);
		    strcpy(jbr,tzm.jbr);
		    strcpy(ghdw,tzm.ghdw);
		    strcpy(rkn,tzm.rkn);
		    strcpy(rky,tzm.rky);
		    strcpy(rkr,tzm.rkr);
			m_result.SetRow(rowl);
			m_result.SetCol(0L);
			m_result.SetText(kcbh);
			m_result.SetCol(1L);
			m_result.SetText(sbmc);
			m_result.SetCol(2L);
			m_result.SetText(wpdj);
			m_result.SetCol(3L);
			m_result.SetText(wpsl);
			m_result.SetCol(4L);
			m_result.SetText(zje);
			m_result.SetCol(5L);
			strcpy(buf,rkn);
			strcat(buf,"年");
			strcat(buf,rky);
			strcat(buf,"月");
			strcat(buf,rkr);
			strcat(buf,"日");
			m_result.SetText(buf);
			m_result.SetCol(6L);
			m_result.SetText(xhgg);
			m_result.SetCol(7L);
			m_result.SetText(jbr);
			m_result.SetCol(8L);
			m_result.SetText(gdbh);
			m_result.SetCol(9L);
			m_result.SetText(sfdzp);
			m_result.SetCol(10L);
			m_result.SetText(cjpp);
			m_result.SetCol(11L);
			m_result.SetText(ghdw);
			m_result.SetCol(12L);
			m_result.SetText(ssbm);
			m_result.SetCol(13L);
			m_result.SetText(rkfs);
            fclose(fpe);
          }
		}
    }
}

BEGIN_EVENTSINK_MAP(Cyszmcxdlg, CDialog)
    //{{AFX_EVENTSINK_MAP(Cyszmcxdlg)
	ON_EVENT(Cyszmcxdlg, IDC_result, 70 /* RowColChange */, OnRowColChangeresult, VTS_NONE)
	ON_EVENT(Cyszmcxdlg, IDC_result, 69 /* SelChange */, OnSelChangeresult, VTS_NONE)
	ON_EVENT(Cyszmcxdlg, IDC_result, -601 /* DblClick */, OnDblClickresult, VTS_NONE)
	ON_EVENT(Cyszmcxdlg, IDC_result, -602 /* KeyDown */, OnKeyDownresult, VTS_PI2 VTS_I2)
	ON_EVENT(Cyszmcxdlg, IDC_cond, -602 /* KeyDown */, OnKeyDowncond, VTS_PI2 VTS_I2)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

void Cyszmcxdlg::OnRowColChangeresult() 
{
	// TODO: Add your control notification handler code here
	int i;

	i = 0;
}

void Cyszmcxdlg::OnSelChangeresult() 
{
	// TODO: Add your control notification handler code here
    int i;
	long l;
	CString str;
	int end_sbrk_recs,end_sbck_recs;
	
	l = m_result.GetRowSel();
	str = m_result.GetClip();

	FILE *rfpe,*cfpe;
	rfpe = fopen("c:\\xxsbgl\\sbrkzm.dat","rb");
	if (rfpe == NULL)
		end_sbrk_recs = 0;
	else{
    }
	cfpe = fopen("c:\\xxsbgl\\sbckzm.dat","rb");
	if (cfpe == NULL)
		end_sbck_recs = 0;
	else{
    }

}

void Cyszmcxdlg::OnDblClickresult() 
{
	// TODO: Add your control notification handler code here
    Onxiugai();	
}

void Cyszmcxdlg::Ondayin() 
{
	// TODO: Add your control notification handler code here
	
  FILE *fpe;
  FILE *tofpe;
  char buf[500];
  char buf1[100];
  int line_num;
  int ret;
  long l;
  int num,i,j,k;
  char bu[500];
  int flag;
  char buf2[200];
  int t;
  float x,y,f;
  int pages;
  int num_of_recs_in_a_page;
  int order;
  CString str;

  fpe = fopen("c:\\xxsbgl\\yszmcxqd.txt","rb");
  tofpe = fopen("c:\\xxsbgl\\prttxt.txt","wb");
  pages = end_result_recs/20;
  if (end_result_recs%20 != 0){
	  pages ++;
  }
  order = 1;

  int year,month,day;

  time_t ltime;    
  struct tm *pti;
  char tmpbuf[100];
  
  time(&ltime);    
  pti = gmtime(&ltime);
  year = pti->tm_year + 1900;
  month = 1 + pti->tm_mon;
  day = pti->tm_mday;
  if (pages == 0)
    pages = 1;
  for (i=0;i<pages;i++){
	  if (i == pages-1){
          num_of_recs_in_a_page = end_result_recs%20;
		  if (num_of_recs_in_a_page == 0)
			  num_of_recs_in_a_page = 20;
		  if (end_result_recs == 0)
			  num_of_recs_in_a_page = 0;
      }
	  else{
		  num_of_recs_in_a_page = 20;
      }
      fprintf(tofpe,"newpage\r\n");
      fprintf(tofpe,"font\r\n");
      fprintf(tofpe,"黑体\r\n");
      fprintf(tofpe,"0.7\r\n");
      fprintf(tofpe,"text\r\n");
      fprintf(tofpe,"10\r\n");
      fprintf(tofpe,"1\r\n");
	  if (g_yszm_flag == 1){
        fprintf(tofpe,"原 始 帐 目 查 询 清 单\r\n");
	  }
	  else{
        if (g_zm_chaxun_flag == KUCUN)
          fprintf(tofpe,"库 存 帐 目 查 询 清 单\r\n");
		else
          fprintf(tofpe,"入 库 帐 目 查 询 清 单\r\n");
	  }
      ret = get_a_line(fpe,buf);
      while (ret != -1){
        fprintf(tofpe,"%s\r\n",buf);
        ret = get_a_line(fpe,buf);
	  }
	  fseek(fpe,0L,SEEK_SET);
	  fprintf(tofpe,"font\r\n");
	  fprintf(tofpe,"宋体\r\n");
	  fprintf(tofpe,"0.3\r\n");

      for (j=0;j<num_of_recs_in_a_page;j++){
		  l = order;
		  m_result.SetRow(l);
		  m_result.SetCol(8L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 2.1;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(0L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  t = atoi(buf);
		  itoa(t,buf,10);
		  fprintf(tofpe,"text\r\n");
	      x = 4.1;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(1L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 5.6;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
		  if (strlen(buf) > 23)
			  buf[23] = 0;
	      fprintf(tofpe,"%s\r\n",buf);

		  m_result.SetCol(2L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 10.1;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(3L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 12;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(4L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 14;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(10L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 16.5;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(5L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 19.2;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(13L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 21.6;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(12L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 23.7;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);
		  
		  m_result.SetCol(7L);
		  str = m_result.GetText();
		  strcpy(buf,str.GetBuffer(50));
		  fprintf(tofpe,"text\r\n");
	      x = 26.1;
	      fprintf(tofpe,"%f\r\n",x);
	      y = 3.8 + j*0.7;
	      fprintf(tofpe,"%f\r\n",y);
	      fprintf(tofpe,"%s\r\n",buf);

		  order ++;
	  }

	  GetDlgItemText(IDC_tjzsl,buf,20);
	  fprintf(tofpe,"text\r\n");
	  x = 5;
	  fprintf(tofpe,"%f\r\n",x);
	  y = 2.3;
	  fprintf(tofpe,"%f\r\n",y);
	  fprintf(tofpe,"%s\r\n",buf);

	  GetDlgItemText(IDC_tjzje,buf,20);
	  fprintf(tofpe,"text\r\n");
	  x = 13;
	  fprintf(tofpe,"%f\r\n",x);
	  y = 2.3;
	  fprintf(tofpe,"%f\r\n",y);
	  fprintf(tofpe,"%s\r\n",buf);

	  fprintf(tofpe,"text\r\n");
	  x = 23.2;
	  fprintf(tofpe,"%f\r\n",x);
	  y = 2.3;
	  fprintf(tofpe,"%f\r\n",y);
	  itoa(year,buf,10);
	  fprintf(tofpe,"%s\r\n",buf);

	  fprintf(tofpe,"text\r\n");
	  x = 24.9;
	  fprintf(tofpe,"%f\r\n",x);
	  y = 2.3;
	  fprintf(tofpe,"%f\r\n",y);
	  itoa(month,buf,10);
	  fprintf(tofpe,"%s\r\n",buf);

	  GetDlgItemText(IDC_tjzje,buf,20);
	  fprintf(tofpe,"text\r\n");
	  x = 25.9;
	  fprintf(tofpe,"%f\r\n",x);
	  y = 2.3;
	  fprintf(tofpe,"%f\r\n",y);
	  itoa(day,buf,10);
	  fprintf(tofpe,"%s\r\n",buf);
      
	  GetDlgItemText(IDC_sbs,buf1,50);
	  get_status();
	  SetDlgItemText(IDC_sbs,buf1);
	  line_num = 0;
	  strcpy(buf,"");
	  if ((s_qrksj_flag == 1)||(s_jrksj_flag == 1))
	    strcat(buf,"入库时间:");
	  if (s_qrksj_flag == 1){
	    strcat(buf,"从");
		GetDlgItemText(IDC_rkn,buf1,6);
	    strcat(buf,buf1);
	    strcat(buf,"年");
		GetDlgItemText(IDC_qrky,buf1,6);
	    strcat(buf,buf1);
	    strcat(buf,"月");
		GetDlgItemText(IDC_qrkr,buf1,6);
		if (strlen(buf1) == 0)
	      strcat(buf,"1");
		else
	      strcat(buf,buf1);
	    strcat(buf,"日");
	  }
	  if (s_jrksj_flag == 1){
	    strcat(buf,"到");
		GetDlgItemText(IDC_jrkn,buf1,6);
	    strcat(buf,buf1);
	    strcat(buf,"年");
		GetDlgItemText(IDC_jrky,buf1,6);
	    strcat(buf,buf1);
	    strcat(buf,"月");
		GetDlgItemText(IDC_jrkr,buf1,6);
		if (strlen(buf1) == 0)
	      strcat(buf,"31");
		else
	      strcat(buf,buf1);
	    strcat(buf,"日");
	  }
	  else{
	    if (s_qrksj_flag == 1)
	      strcat(buf,"起");
	  }

	  if (s_sbs_flag == 1){
	    if (strlen(buf) == 0)
	      strcat(buf,"设备类型:等于");
	    else
	      strcat(buf,"    设备类型:等于");
		GetDlgItemText(IDC_sbs,buf1,40);
	    strcat(buf,buf1);       
	  }

	  if (s_sbmc_flag == 1){
	    if (strlen(buf) == 0)
	      strcat(buf,"设备名称:包含");
	    else
	      strcat(buf,"    设备名称:包含");
		GetDlgItemText(IDC_sbmc,buf1,40);
	    strcat(buf,buf1);       
	  }

	  if (strlen(buf) != 0){
	    fprintf(tofpe,"text\r\n");
	    x = 5;
	    fprintf(tofpe,"%f\r\n",x);
	    y = 18;
	    fprintf(tofpe,"%f\r\n",y);
	    fprintf(tofpe,"%s\r\n",buf);
		line_num ++;
	  }

      strcpy(buf,"");
	  if ((s_qrkbh_flag == 1)||(s_jrkbh_flag == 1)){
	    strcat(buf,"入库编号:");
	  }
	  if (s_qrkbh_flag == 1){
	    strcat(buf,"从");
		GetDlgItemText(IDC_qrkbh,buf1,10);
	    strcat(buf,buf1);
	  }
	  if (s_jrkbh_flag == 1){
	    strcat(buf,"到");
		GetDlgItemText(IDC_jrkbh,buf1,10);
	    strcat(buf,buf1);
	  }
	  else{
	    if (s_qrkbh_flag == 1)
	      strcat(buf,"起");
	  }

	  if ((s_qgdbh_flag == 1)||(s_jgdbh_flag == 1)){
		if (strlen(buf) == 0)
	      strcat(buf,"固定编号:");
		else
	      strcat(buf,"    固定编号:");
	  }
	  if (s_qgdbh_flag == 1){
	    strcat(buf,"从");
		GetDlgItemText(IDC_qgdbh,buf1,10);
	    strcat(buf,buf1);
	  }
	  if (s_jgdbh_flag == 1){
	    strcat(buf,"到");
		GetDlgItemText(IDC_jgdbh,buf1,10);
	    strcat(buf,buf1);
	  }
	  else{
	    if (s_qgdbh_flag == 1)
	      strcat(buf,"起");
	  }

	  if ((s_qwpdj_flag == 1)||(s_jwpdj_flag == 1)){
		if (strlen(buf) == 0)
	      strcat(buf,"物品单价:");
		else
	      strcat(buf,"    物品单价:");
	  }
	  if (s_qwpdj_flag == 1){
	    strcat(buf,"从");
		GetDlgItemText(IDC_qwpdj,buf1,10);
	    strcat(buf,buf1);
	  }
	  if (s_jwpdj_flag == 1){
	    strcat(buf,"到");
		GetDlgItemText(IDC_jwpdj,buf1,10);
	    strcat(buf,buf1);
	  }
	  else{
	    if (s_qwpdj_flag == 1)
	      strcat(buf,"起");
	  }

	  if (strlen(buf) != 0){
	    fprintf(tofpe,"text\r\n");
	    x = 5;
	    fprintf(tofpe,"%f\r\n",x);
	    y = 18+line_num*0.8;
	    fprintf(tofpe,"%f\r\n",y);
	    fprintf(tofpe,"%s\r\n",buf);
		line_num ++;
	  }

      strcpy(buf,"");
      if (s_ssbm_flag == 1){
		  strcat(buf,"所属部门:等于");
		  GetDlgItemText(IDC_ssbm,buf1,20);
	      strcat(buf,buf1);
	  }

	  if (s_dzp_flag == 1){
		GetDlgItemText(IDC_dzp,buf1,40);
		if (strcmp(buf1,"是") == 0){
			if (strlen(buf) == 0)
			  strcat(buf,"低值品");
			else
			  strcat(buf,"    低值品");
		}
		else{
			if (strlen(buf) == 0)
			  strcat(buf,"非低值品");
			else
			  strcat(buf,"    非低值品");
		}
	  }

      if (s_jbr_flag == 1){
		  if (strlen(buf) == 0)
		    strcat(buf,"经办人:等于");
		  else
		    strcat(buf,"    经办人:等于");
		  GetDlgItemText(IDC_jbr,buf1,10);
	      strcat(buf,buf1);
	  }

      if (s_rkfs_flag == 1){
		  if (strlen(buf) == 0)
		    strcat(buf,"入库方式:等于");
		  else
		    strcat(buf,"    入库方式:等于");
		  GetDlgItemText(IDC_rkfs,buf1,10);
	      strcat(buf,buf1);
	  }

	  if (strlen(buf) != 0){
	    fprintf(tofpe,"text\r\n");
	    x = 5;
	    fprintf(tofpe,"%f\r\n",x);
	    y = 18+line_num*0.8;
	    fprintf(tofpe,"%f\r\n",y);
	    fprintf(tofpe,"%s\r\n",buf);
		line_num ++;
	  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -