/**
	@in:
	@return:int(0|1)
	@function:删除记录
*/
int deleteRecord()
{
	int iNum = 0;//存放
	int iDeleteResult = 0;

	clearScreen();

	cout<<"  -------------------是时候整理下记录了-----------------\n"<<endl;
	cout<<"		请输入要删除记录的记录号:";
	cin>>iNum;
	if(iNum < getRecordCount())
	{
		//删除信息
		iDeleteResult = deleteRecordByNumber(iNum);
		if(iDeleteResult == 1)
		{
			//删除成功
			system("color 2f");//change color
			cout<<"\n		值得祝贺,删除成功后信息:\n"<<endl;
			showRecord();
		}else
		{
			//删除失败
			cout<<"\n		删除失败,系统遇到未知错误:"<<endl;
		system("color cf&ping -n 1 127.1>nul&color fc&ping -n 1 127.1>nul&color cf&ping -n 1 127.1>nul&color fc&ping -n 1 127.1>nul&color cf");//change color
		}
	}else
	{
		//不存在,显示错误
		cout<<"\n		没有此条记录:"<<iNum<<"不存在"<<endl;
		system("color cf&ping -n 1 127.1>nul&color fc&ping -n 1 127.1>nul&color cf&ping -n 1 127.1>nul&color fc&ping -n 1 127.1>nul&color cf");//change color
	}
	cout<<"  --------------------------------------------------\n"<<endl;
	pause();//pause
	system("color 4e");//change color
	clearScreen();//clear screen

	home();
	
	return 1;
}
Beispiel #2
0
int VUMeter::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: overThreshold(); break;
        case 1: underThreshold(); break;
        case 2: dtmfCode((*reinterpret_cast< char*(*)>(_a[1]))); break;
        case 3: setVU((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 4: setLen((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 5: setFileLen((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 6: showRecord(); break;
        case 7: hideRecord(); break;
        case 8: showPlayback(); break;
        case 9: updateThresholdTimer(); break;
        }
        _id -= 10;
    }
    return _id;
}
Beispiel #3
0
int main(int argc, const char * argv[])
{
    
    //test list
    List *StudentSystem = (List *)malloc(sizeof(List));
    initList(StudentSystem, matchRecord, cmpRecord);

    StudentRecord *studentData = (StudentRecord *)malloc(sizeof(StudentRecord));
    
    newRecord(studentData);
    
    showRecord(studentData);
    
    insertListElmtNext(StudentSystem, StudentSystem->tail, (void *)studentData);
    
    showList(StudentSystem);
    
    removeListElmtNext(StudentSystem, StudentSystem->head, (void **)&studentData);
    
    showList(StudentSystem);
    
    /*test record.h Student func
     
    Student *studentA = (Student *)malloc(sizeof(Student));
    
    newRecord(studentA);
    
    showRecord(studentA);
    
    free(studentA);
    
    if (studentA)
    {
        printf("existing %d", studentA->iNumber);
    }
    */
    return 0;
}