Imitation 10086 telecommunications business platform

content

Configuration Environment

Frames

module analysis

Four major sectors

function code snippet

Voice broadcast

database call

display time

overall framework

Full code:


Full code link at the end of the article 

Configuration Environment

VC++6.0

Dongjin voice card

Access database

ADO interface technology

        In VC++6.0, we created a new MFC (Microsoft Basic Class Library) and wrote various program statements, and finally realized a complete campus service system.

        Microsoft Visual C++ 6.0, referred to as VC6.0, is a C++ compiler launched by Microsoft in 1998. It integrates MFC 6.0, including Standard Edition, Professional Edition and Enterprise Edition. Issuing has been widely used in the development of large and small projects to this day.

MFC (Microsoft Foundation Classes, Microsoft Foundation Classes) is a class library provided by Microsoft, which encapsulates Windows API in the form of C++ classes and contains an application framework to reduce the workload of application developers . It contains a large number of Windows handle wrapper classes and wrapper classes of many Windows built-in controls and components.

        A voice card, also known as a voice board, is a computer and telephone voice processing device, which is a computer plug-in used on a computer and capable of voice processing. With the rapid development of voice card technology, as the most critical hardware equipment in the CTI system, voice cards have developed rapidly in China's communication market in recent years, and their application fields include post and telecommunications, information services, office automation, finance, public security, medical care , commerce, entertainment, transportation, industrial production and social life, etc., its market prospects are broad.

        Microsoft Office Access is a relational database management system published by Microsoft. It combines two features of MicrosoftJet Database Engine and graphical user interface, and is one of the system programs of Microsoft Office. Microsoft Office Access is a database management system that Microsoft combines the graphical user interface of the database engine with software development tools. MS ACCESS stores data in its own format in the Access Jet based database engine. It can also directly import or link data stored in other applications and databases. Software developers and data architects can use Microsoft Access to develop application software, and "power users" can use it to build software applications. Like other office applications, ACCESS supports the Visual Basic macro language, which is an object-oriented programming language that can reference various objects, including DAOs (Data Access Objects), ActiveX Data Objects, and many other ActiveX components. Visual objects are used to display tables and reports, and their methods and properties are in the VBA programming environment. VBA code modules can declare and call Windows operating system functions.

        ADO (ActiveX Data Objects) is a program object used to represent the data structure and data contained in the user database. In the Microsoft Visual Basic editor, you can use ADO objects and ADO add-ons (called Microsoft ADO Extensions for DLL and Security (ADOX)) to create or modify tables and queries, to verify databases, or to access external data sources. You can also use ADO in code to manipulate data in the database. ADO (ActiveX Data Objects, ActiveX Data Objects) is an application programming interface (API) proposed by Microsoft to access data in relational or non-relational databases. For example, if you want to write an application that provides data to a web page from a DB2 or Oracle database, you can include the ADO program in an HTML file that is an Active Server Page (ASP). When a user requests a web page from a website, the returned web page also includes the corresponding data in the data, which is the result of using the ADO code.

Frames

 

module analysis

Four major sectors

(1) The first section is for all-in-one card services. There are two modules under the one-card service: balance inquiry and recharge service. After entering the one-card service, you need to enter the card number and password first, and then select the next service. After selecting the recharge service, you can charge any amount and press "#" to confirm the recharge. After the recharge is successful, the final balance will be broadcast to the user. After checking the balance or recharging, you can return to the corresponding previous level and choose to broadcast the balance or recharge service, and continue to return to the previous level to return to the original section.

(2) The second section is the reservation service for sports venues. There are three types of sports: badminton, volleyball and basketball. Sports venues can choose the main hall and the sub hall. The sports venues can be used from 6:00 pm to 7:00 pm, 7:00 pm to 8:00 pm, and 8:00 pm to 9:00 pm. The selection process is to select the ball first, then the venue, and finally the time period. During the selection process, you can return to the corresponding previous level for re-selection. After the reservation is successful, you can return to the previous level to continue to reserve the venue. If you continue to return to the previous level, you can return to the original board.

(3) The third section is entertainment services. Entertainment services include song services and interactive services. After entering the song request module, the types of songs that can be selected include family affection, love and friendship. After entering the interactive module, you can choose from the following types of services: learn about China University of Petroleum (East China), learn about communication engineering and psychotherapy. After returning to the previous level, you can continue to select the service type. Continue to return to the previous level to return to the original board.

(4) The fourth section is the mental health test for college students. This module will play eight questions, each with four or five options. The system will calculate the final score according to the selected options, and then judge the final result based on the score and feed it back to the user. Return to the previous level to return to the original module.

function code snippet

Voice broadcast

void CMy2Dlg::shuzibobao(CString number) //数字播报函数
{
	m_ValidCh=0;
	if(state==1 && CheckPlayEnd(m_ValidCh) )
	{
		StopPlayFile(m_ValidCh);
		if(number[j]=='1')
		{
			StartPlayFile(m_ValidCh,"1",0L);
			j++;
			state=2;
		}
		else if(number[j]=='2')
		{
			StartPlayFile(m_ValidCh,"2",0L);
			j++;
			state=2;
		}
		else if(number[j]=='3')
		{
			StartPlayFile(m_ValidCh,"3",0L);
			j++;
			state=2;
		}
		else if(number[j]=='4')
		{
			StartPlayFile(m_ValidCh,"4",0L);
			j++;
			state=2;
		}
		else if(number[j]=='5')
		{
			StartPlayFile(m_ValidCh,"5",0L);
			j++;
			state=2;
		}
		else if(number[j]=='6')
		{
			StartPlayFile(m_ValidCh,"6",0L);
			j++;
			state=2;
		}
		else if(number[j]=='7')
		{
			StartPlayFile(m_ValidCh,"7",0L);
			j++;
			state=2;
		}
		else if(number[j]=='8')
		{
			StartPlayFile(m_ValidCh,"8",0L);
			j++;
			state=2;
		}
		else if(number[j]=='9')
		{
			StartPlayFile(m_ValidCh,"9",0L);
			j++;
			state=2;
		}
		else if(number[j]=='0' && number[j-1]=='0' )
		{
			length--;
			j++;
		}
		else if(number[j]=='0')
		{
			int find=0;
			for(int k=j;k<strlen(number);k++)
			{
				if(number[k]!='0')
				{
					find=1;
				}
			}
			if(find)
			{
				StartPlayFile(m_ValidCh,"0",0L);				
				state=1;
				length--;
			}
			j++;
		}
	}

	if(state==2 && CheckPlayEnd(m_ValidCh) )
	{
		StopPlayFile(m_ValidCh);
		if(number[j-1]!='0')
		{
			if(length==5)
			{
				StartPlayFile(m_ValidCh,"wan",0L);
				length--;
			}
			else if(length==4)
			{
				StartPlayFile(m_ValidCh,"qian",0L);
				length--;
			}
			else if(length==3)
			{
				StartPlayFile(m_ValidCh,"bai",0L);
				length--;
			}
			else if(length==2)
			{
				StartPlayFile(m_ValidCh,"shi",0L);
				length--;
			}
		}
		state=1;	
	}

database call

case 72300:                                         //调用数据库的数据
		number=m_StringID;
	    length=strlen(number);
		j=0;
		state=1;
		m_ChState=61;
	case 61:                                            //余额语音播报
		if(j<=strlen(number))
			shuzibobao(number);
	    if(j==strlen(number) && CheckPlayEnd(m_ValidCh))	
		{   
			StopPlayFile(m_ValidCh);
			StartPlayFile(m_ValidCh,"yuan",0L);
			m_ChState=666;
		}
		break;

display time

CString Y,M,D,H,M1,S;                    
CTime t=CTime::GetCurrentTime();
int y=t.GetYear();
int m=t.GetMonth();
int d=t.GetDay();
int h=t.GetHour();
int m1=t.GetMinute();
  int s1=t.GetSecond();
//类内定义
	CTime t=CTime::GetCurrentTime();                     //在编辑框显示时间
	y=t.GetYear();
	m=t.GetMonth();
	d=t.GetDay();
	h=t.GetHour();
	m1=t.GetMinute();
	s1=t.GetSecond();
	Y.Format("%d",y);
	M.Format("%d",m);
	D.Format("%d",d);
	H.Format("%d",h);
	M1.Format("%d",m1);
	S.Format("%d",s1);
	m_edit1=Y+"."+M+"."+D+" | "+H+"."+M1+"."+S;

overall framework

	case 9:	                                 // 选择总业务按键
		if((code=GetDtmfCode(m_ValidCh))!=-1)
			{
		       if (code==10)
			   {
		       	   m_ChState=1;
			   }
			   if(code==1)
			   {
		       	   m_ChState=71;
			   }
			   if(code==2)
			   {
		       	   m_ChState=72;
			   }
			   if(code==3)
			   {
		       	   m_ChState=73;
			   }
			   if(code==4)
			   {
		       	   m_ChState=74;

			   }
			}
		    else if(CheckPlayEnd(m_ValidCh))
			{
			    StopPlayFile(m_ValidCh);
			    m_ChState=2;
			}
			break;

Full code:

10086 smart campus program source code based on C++, MFC, Dongjin voice card and database technology - other document resources - CSDN download 

Guess you like

Origin blog.csdn.net/yyfloveqcw/article/details/124374916