topic
Design and implementation of KTV song ordering management system based on C# (12000 words)
Catalogue
2. Introduction to development technology
2.1 introduction to development tool C#
2.2 introduction to database system
3.4 development and operation environment
4.3.2 business flow analysis diagram
5.2 singer information management module
5.3 song information management module
6. System test and performance analysis
Thousands of words are omitted here https://blog.csdn.net/frank2102
functional requirement
Main functional requirements of KTV song ordering system: at the management end, it mainly realizes the management of song information, singer information and administrator information, and can modify, add, delete and query various information; The on-demand terminal mainly realizes the query and on-demand function of songs and singers.
(1) Song information, singer information and administrator information management functions:
- Addition of singer information: including number, singer name, region, gender, Pinyin, avatar picture and other information;
- Adding song information: including number, song path, song name, singer, Pinyin, number of words, song type and other information;
- Administrator information addition: including number, administrator account, password and other information;
- Deletion of song information, singer information and administrator information: realize the deletion function of song information, singer information and administrator information;
- Query of song information, singer information and administrator information: realize the function of querying relevant information according to a certain category;
- Modification of singer information, song information and administrator information: realize the modification of relevant information.
(2) Song query function:
- Query by the number of words of the song name: one word, two words, three words, four words, five words, six words, seven words, eight words, nine words, all;
- Query by language: Mandarin, Cantonese, English, Korean, Japanese, Korean, Malay and others;
- Query by singer's name;
- Query by singer gender;
- Query by phonetic alphabet;
- Query by the region of the singer;
- Query by song category: pop music, classical music, film and television Golden Songs, world famous songs, etc;
- Query by on-demand ranking;
- VIP user history song query.
(3) Song playing function:
It realizes the functions of song playing, pause, stop, full screen, forward, backward, cutting songs, priority playing, and moving songs up and down in the on-demand list.
design goal
According to the needs of users and background management, the following objectives should be achieved after the implementation of the system:
- Reduce human resource costs.
- The operation interface is beautiful, friendly, convenient and efficient.
- Through the function of exporting to Excel, you can clearly grasp the situation of users' on-demand songs.
- Through the function of importing Excel into the database, the batch import of singer and song information can be realized.
- Convenient data query: support multi condition query, classified data display, etc.
functional module
KTV song ordering system has two main modules: on-demand terminal and management terminal. The VOD end is divided into: Song query module and playback module; The management end is divided into song information management module, singer information management module and administrator information management module. The overall structure of the system is shown in Figure 4-1.
The main functions of the song query module are: including query by the number of words of the song, such as one word, two words, three words, four words, five words, six words, seven words, eight words, nine words, etc; Query by language type, such as Mandarin, Cantonese, English, Korean, Japanese, Malay, Korean and others; Query by singer's gender, such as male singer, female singer, band, etc; Query by region, such as Hong Kong and Taiwan, Europe and the United States, the mainland and others; Query by phonetic alphabet, that is, query by the first letter of each Chinese character of the song; Query by song on demand ranking, that is, ranking by the number of songs on demand; Query by song type, such as pop songs, classical music, world famous songs, children's songs, film and television Golden Songs, birthday songs, classic old songs, other songs, etc; Query according to the song ordering record of VIP users, that is, the songs ordered by VIP users will be recorded by the system to facilitate the next song ordering.
The main functions of the singer information management module are: in this function module, you can find, modify, add and delete the singer name, region, gender, Pinyin and avatar path in the singer information. You can also export the song information in the database to excel table or import Excel data into the database.
The main functions of the song information management module are: in this module, you can find, add, modify and delete the song Pinyin, song type, number of song words, song language, song on demand ranking and song path in the song information. You can also export the song information in the database to excel table or import Excel data into the database.
The main functions of the playback module are: in this module, the functions of song playback, pause, stop, full screen, forward, backward, cutting songs, priority playback, up and down of the position of songs in the on-demand list are realized.
Data flow analysis
Data flow of KTV song ordering system: customers query songs according to various query methods and play the queried songs in turn; The administrator can add, query, modify and delete singer information, song information and administrator information. The data flow is shown in Figure 4-2.
Business flow analysis
Business process of KTV song ordering system: customers can query according to various types of tracks and broadcast the queried songs on demand; In the process of playing, if the customer wants to cancel the song, select "next song" or "cut song", and the customer can also adjust the playing order of the song. When the administrator adds singer or song information, just press the Add button after inputting the corresponding information to store the information in the database to complete the addition of singer or song information; When modifying the singer or song information, click the Modify button to modify the corresponding information, and click the Save button to modify the information in the database, so as to complete the modification of the singer or song information; When deleting singer and song information, just press the delete button to delete this information from the database. The business flow is shown in Figure 4-3.
E-R diagram
System implementation (part)
Song query module
The main functions of the song query module: including query by the number of words of the song, such as one word, two words, three words, four words, five words, six words, seven words, eight words, nine words, etc; Query by language type, such as Mandarin, Cantonese, English, Korean, Japanese, Malay, Korean and others; Query by singer's gender, such as male singer, female singer, band, etc; Query by singer region, such as Hong Kong and Taiwan, Europe and the United States, the mainland and others; Query by phonetic alphabet, that is, query by the first letter of each Chinese character of the song; Query by song ranking; Query by song type, such as pop songs, classical music, classic old songs, world famous songs, children's songs, film and television Golden Songs, birthday songs, other songs, etc; Query according to the VIP song ordering record. When the VIP user logs in, the song ordering record will be automatically saved to facilitate the user's next VOD; Query by phonetic alphabet, that is, query by the first letter of each Chinese character of the song. The function of song query module is shown in Figure 5-1.
Form design
Detailed design process of song query module: interface design is to design the interface on WINFORM form, mainly using the following controls: PictureBox, Button, TextBox, DataGridView, etc. The steps of form design are as follows:
(1) Right click the system name "KTV", find the "add" option, select "Windows form", enter the form name "FrmXuanze", and click "add".
(2) Add the following main controls to the dialog box that appears:
Table 5-1 main component properties of song query form
Control type | Control ID | Main attribute settings | purpose |
PictureBox | GeShou | Set Backcolor to Transparent | Jump to the singer selection interface |
PinYin | Set Backcolor to Transparent | Jump to Pinyin song selection interface | |
YuYan | Set Backcolor to Transparent | Jump to the language song selection interface | |
LeiBie | Set Backcolor to Transparent | Jump to the category song selection interface | |
ZiShu | Set Backcolor to Transparent | Jump to the word number song selection interface | |
PaiHangBang | Set Backcolor to Transparent | Jump to the song selection interface of the leaderboard | |
Button | Btnfanhui | Set the Text property to return | Return to the song selection form |
Datagridview | Datagridview1 | Anchor property is Top, Bottom, Left, Right, SelectionMode property is FullRowSelect, DataSource binds data source. Set the Text property to "song selection". | Display the query results of users in Datagridview to facilitate users' on-demand broadcasting. |
TextBox | TxtPinYin | Set TextChanged event | The user inputs Pinyin and dynamically refreshes the text value of Datagirdview. |
Code design
The relevant implementation procedures are as follows.
//Code to display songs in the song list public void showXuanGe(string ClassName) { DataSet ds = new DataSet(); ds = KTVData.KTVDB.SelectClassName(ClassName); if (ds.Tables[0].Rows.Count < 1) { MessageBox.Show("There are no songs in this category, please reselect!", "System prompt", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } FrmXuanGe FrmXuanGe1 = new FrmXuanGe(); FrmXuanGe1.ds = ds; FrmXuanGe1.Show(); this.Close(); //Click the singer's Avatar to select the song code private void FrmAllSinger_Load(object sender, EventArgs e) { try { SqlConnection con = new SqlConnection(KTVData.ConfigClass.configValue); con.Open(); SqlCommand cmd = new SqlCommand("SELECT RName,FacePath FROM GeShou", con); List<string[]> singerInfoList = new List<string[]>(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { string[] singerInfoArray = new string[2]; singerInfoArray[0] = reader[0].ToString(); singerInfoArray[1] = reader[1].ToString(); singerInfoList.Add(singerInfoArray); } reader.Close(); con.Close(); this.textBox1.Text = singerInfoList[falg + 0][0].ToString(); this.pictureBox1.ImageLocation = singerInfoList[falg + 0][1].ToString(); this.textBox2.Text = singerInfoList[falg + 1][0].ToString(); this.pictureBox2.ImageLocation = singerInfoList[falg + 1][1].ToString(); this.textBox3.Text = singerInfoList[falg + 2][0].ToString(); this.pictureBox3.ImageLocation = singerInfoList[falg + 2][1].ToString(); this.textBox4.Text = singerInfoList[falg + 3][0].ToString(); this.pictureBox4.ImageLocation = singerInfoList[falg + 3][1].ToString(); this.textBox5.Text = singerInfoList[falg + 4][0].ToString(); this.pictureBox5.ImageLocation = singerInfoList[falg + 4][1].ToString(); this.textBox6.Text = singerInfoList[falg + 5][0].ToString(); this.pictureBox6.ImageLocation = singerInfoList[falg + 5][1].ToString(); } catch (ArgumentOutOfRangeException) { falg = 0; } }
Singer information management module
The singer information management module is subdivided into six functions: the addition of singer information, the modification of singer information, the deletion of singer information, the query of singer information, the export of singer information and the import of singer information.
Adding function of singer information: after entering the singer's name, region, gender, Pinyin and avatar path, press the Add button to store the entered information into the database to complete the function of adding singer information.
The query, deletion, modification, import and export of singer information use the same window. When you click the query button, the window will be displayed as query, which can be queried in certain ways, such as singer name, gender, region, etc. When you click delete, the window will be displayed as delete, or you can query in a certain way and then delete. When clicking the Modify button, the window of adding a singer will pop up, and the user can save the modified information. When you click export, you can export the singer information in DataGridView to excel table. When you click Import, you can import the singer information in Excel into the database. The singer information management module is shown in Figure 5-2.
Code design
The specific codes are as follows:
//Import Excel data into database public static DataTable ExcelToDataTable(string strExcelFileName, string strSheetName) { string strconn = "Provider = Microsoft.Jet.OLEDB.4.0;"+"Extended Properties=Excel 8.0;"+"Data Source =" +strExcelFileName+";"; string strExcel = string.Format("select * from[{0}$]",strSheetName); DataSet ds = new DataSet(); OleDbConnection conn = new OleDbConnection(strconn); conn.Open(); OleDbDataAdapter adapter = new OleDbDataAdapter(strExcel, strconn); adapter.Fill(ds, strSheetName); conn.Close(); return ds.Tables [strSheetName]; } public void ExcelToSql() { openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "Excel file|*.xls"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { DataTable dt =ExcelToDataTable(openFileDialog1.FileName, "Sheet1"); for (int i = 0; i < dt.Rows.Count; i++) { int pd = 0; KTVData.KTVDB.GeShouName = dt.Rows[i][0].ToString(); KTVData.KTVDB.Sex = dt.Rows[i][1].ToString(); KTVData.KTVDB.DiQu = dt.Rows[i][2].ToString(); KTVData .KTVDB.FacePath = dt.Rows[i][3].ToString(); KTVData .KTVDB.SingerPinYinCode= dt.Rows[i][4].ToString(); for (int k = 0; k < dataGridView1.Rows.Count; k++) { string sssss = dataGridView1.Rows[k].Cells[1].Value.ToString(); if (dt.Rows[i][0].ToString() == dataGridView1.Rows[k].Cells[1].Value.ToString()) { pd = 1; } } if (pd == 1) { if (MessageBox.Show("singsing star:" + dt.Rows[i][0].ToString() + " Already exists! Add or not!", "System prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { InserDB(KTVData.KTVDB.GeShouName, KTVData.KTVDB.Sex, KTVData.KTVDB.DiQu, KTVData.KTVDB.FacePath, KTVData.KTVDB.SingerPinYinCode); } pd = 0; } else { InserDB(KTVData.KTVDB.GeShouName, KTVData.KTVDB.Sex, KTVData.KTVDB.DiQu, KTVData.KTVDB.FacePath, KTVData.KTVDB.SingerPinYinCode); } } } }
Thousands of words are omitted here https://blog.csdn.net/frank2102
Resource download
Source program + database download: https://download.csdn.net/download/frank2102/19667223
Full paper Download: https://download.csdn.net/download/frank2102/19667164