點(diǎn)歌系統(tǒng)實(shí)訓(xùn)指導(dǎo)書_第1頁(yè)
點(diǎn)歌系統(tǒng)實(shí)訓(xùn)指導(dǎo)書_第2頁(yè)
點(diǎn)歌系統(tǒng)實(shí)訓(xùn)指導(dǎo)書_第3頁(yè)
點(diǎn)歌系統(tǒng)實(shí)訓(xùn)指導(dǎo)書_第4頁(yè)
點(diǎn)歌系統(tǒng)實(shí)訓(xùn)指導(dǎo)書_第5頁(yè)
已閱讀5頁(yè),還剩17頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

[]草稿[ 版本歷 技能提 知識(shí)點(diǎn)準(zhǔn) 系統(tǒng)架 主要功 系統(tǒng)用 數(shù)據(jù)庫(kù)設(shè) 系統(tǒng)登 系統(tǒng)主窗 系統(tǒng)注 綜合運(yùn)用ADO.NET技術(shù)數(shù)據(jù)C#C#用 窗請(qǐng) 反窗改變狀態(tài)通知改工具類工具類存取數(shù)KTVKTV點(diǎn)歌系歌曲點(diǎn)歌 查刪插播 歌曲管登全部用歌曲列順<<包含<<包含<<包含<<包含歌 <<包含<<包含

插播歌窗歌曲點(diǎn)登

<<包含<<包含<<包含<<包含<<包含<<包含

歌曲管 字?jǐn)?shù)點(diǎn)管理全部用

<<包含<<包含<<包含<<包含

查詢修改歌刪除歌usingusingusingSystem.Collections.Generic; usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;usingSystem.Threading;namespaceMyKTVServer{publicpartialclassFrmLogin:{public{}privatevoidbtnCancel_Click(objectsender,EventArgs{}privatevoidbtnLogin_Click(objectsender,EventArgs{ifValidateInput()){stringmessage提示信調(diào)用方法,判斷booluserExist=ValidateUser(this.txtUserName.Text.Trim(),this.txtPwd.Text.Trim(),refmessage);if{FrmAdminadminForm=newFrmAdmin();}{MessageBox.Show(message,提示MessageBoxButtons.OK,}}}///判斷用戶輸///<returns>是否通過(guò)驗(yàn)證</returns>privateboolValidateInput(){boolresultfalse;//是否通過(guò)驗(yàn)if(this.txtUserName.Text.Trim()=={}elseif(this.txtPwd.Text.Trim()=={ ","提示",MessageBoxButtons.OK,}{result=}return}///判斷用戶是否//////privateboolValidateUser(stringname,stringpwd,refstring{boolresultfalse;//表示是否找到該用判斷用戶名是否存StringBuildersb=newStringBuilder();sb.AppendFormat("selectcount(*)fromadmin_infowhereDBHelperdbHelper=newmandcommand=new {ifConvert.ToInt32(command.ExecuteScalar1){//判 是否存sb.Remove(0,sb.AppendFormat("selectcount(*)fromadmin_infowhereadmin_name='{0}'andadmin_pwd='{1}'",name,{

mandText=if(Convert.ToInt32(command.ExecuteScalar())=={}{}}

result=message 錯(cuò)誤catch(Exception{message服務(wù)器發(fā)生錯(cuò)誤,請(qǐng)稍后再試!發(fā)生異息 }}else沒(méi)找到的{message}}catch(Exception{message="服務(wù)器發(fā)生錯(cuò)誤,請(qǐng)稍后再試!發(fā)生異常提示信 }{}return}//窗體加載時(shí) 資源路privatevoidLoginForm_Load(objectsender,EventArgs{ DBHelperdbHelper=newstringsql="selectresource_pathfromresource_pathwhereresource_type='singer_photo'";mandcommand= mand(sql, {KTVUtil.singerPhotoPath=}catch(Exception{ 資源路徑發(fā)生錯(cuò)誤!","錯(cuò)誤",MessageBoxButtons.OK,MessageBoxIcon.Error); }{}sql="selectresource_pathfromresource_pathwhereresource_typemandText={KTVUtil.songPath=}catch(Exception{ 資源路徑發(fā)生錯(cuò)誤!","錯(cuò)誤",MessageBoxButtons.OK,MessageBoxIcon.Error); }{}}}}privateprivatevoidbtnAdd_Click(objectsender,EventArgs{if{歌曲類型

獲得要添加的stringsongName=this.txtSongName.Text.Trim(歌曲名stringsongNameABthis.txtSongNameAB.Text.Trim();歌曲名的拼音縮intsongWordCountthis.txtSongName.Text.Trim().Length;//歌曲名長(zhǎng)intsongTypeId=Convert.ToInt32(this.cboSongType.SelectedValue);////移動(dòng)文件到指定File.Copy(this.ofdSongFile.FileName,KTVUtil.songPath+"\\"+this.ofdSongFile.SafeFileName,true);//添加歌曲信息到數(shù)據(jù)StringBuildersqlnewStringBuilder();//插入數(shù)據(jù)用的SQL語(yǔ)sql.Append("INSERTINTOsong_infosql.AppendFormat("VALUESsongName,songNameAB,songWordCount,songTypeId,this.singerId,DBHelperdbHelper=newmandcommand= {intresultcommand.ExecuteNonQuery(插入數(shù)if(result=={MessageBox.Show("添加成功!提示MessageBoxButtons.OK,}{MessageBox.Show("添加失敗,請(qǐng)聯(lián)系管理員!提示",MessageBoxButtons.OK,MessageBoxIcon.Error);}}catch(Exception{MessageBox.Show("MessageBox.Show("系統(tǒng)發(fā)生錯(cuò)誤!提示MessageBoxButtons.OK,}{}}}privatevoidbtnOK_Click(objectsender,EventArgs{if{stringsingerNamethis.txtName.Text.TrimintsingerTypeIdConvert.ToInt32(this.cboType.SelectedValue);//stringsingerSexthis.rdoMale.Checked男女stringsingerPhotoUrl= //歌 件stringdescriptionthis.txtDescription.Text.Trim();////移動(dòng)歌 File.Copy(this.picPhoto.ImageLocation,KTVUtil.singerPhotoPath++singerPhotoUrl, ine(KTVUtil.singerPhotoPath+"\\"+DBHelperdbHelper=newDBHelper();StringBuildersb=newStringBuilder();插入歌手信息的SQL語(yǔ)sb.Append("insertintosinger_info(singer_name,singertype_id,singer_gender,singer_photo_url,singer_description)");sb.AppendFormat("values('{0}',{1},'{2}','{3}','{4}')",singerName,singerTypeId,singerSex,singerPhotoUrl,description);mandcommand= {intresult=command.ExecuteNonQuery();if(result==1){MessageBox.Show("添加成功!提示MessageBoxButtons.OK,清空界}{MessageBox.Show("添加失敗,請(qǐng)重試!提示",MessageBoxButtons.OK,MessageBoxIcon.Information);}}catch(Exception{MessageBox.Show("服務(wù)器錯(cuò)誤!提示MessageBoxButtons.OK, }{}}}privateprivatevoidbtnSearch_Click(objectsender,EventArgs{}//////privatevoid{StringBuildersqlnewStringBuilder();查詢用的SQLSQLsql.Append("fromsinger_infoassinnerjoinsinger_typeastons.singertype_id=t.singertype_id");////如果歌 if(txtSingerName.Text.Trim()!=""&&Convert.ToInt64(cboSingerType.SelectedValue)!=-1){sql.AppendFormat("wheres.singer_namelike'%{0}%'ands.singertype_id={1}",txtSingerName.Text.Trim(),}elseif(txtSingerName.Text.Trim()!={sql.AppendFormat("wheres.singer_namelike'%{0}%'",}elseif(Convert.ToInt64(cboSingerType.SelectedValue)!=-{sql.AppendFormat("wheres.singertype_id={0}",} //if(ds.Tables["singer_info"]!={}mandText=sql.ToString();adapter.Fill(ds,"singer_info");this.dgvSingerList.DataSource=ds.Tables["singer_info"];}privatevoidprivatevoidbtnSearch_Click(objectsender,EventArgs{}privatevoid{StringBuildersqlnewStringBuilder();查詢用的SQL語(yǔ)SQL語(yǔ)句的前半部sql.Append("fromsong_infoassinnerjoinsong_typeastons.songtype_id=t.songtype_id");如果歌曲名和歌曲類型都不為空,增加兩個(gè)查詢條件if(txtSongName.Text.Trim()!=""&&Convert.ToInt64(cboSongType.SelectedValue)1){sql.AppendFormat("wheres.song_namelike'%{0}%'ands.songtype_id={1}",txtSongName.Text.Trim(),}elseif(txtSongName.Text.Trim()!={sql.AppendFormat("wheres.song_namelike'%{0}%'",}elseif(Convert.ToInt64(cboSongType.SelectedValue)!=-{{sql.AppendFormat("wheres.songtype_id={0}",}//if(ds.Tables["song_info"]!={}mandText=sql.ToString();adapter.Fill(ds,"song_info");this.dgvSongList.DataSource=ds.Tables["song_info"];}privateprivatevoidbtnSave_Click(objectsender,EventArgs{//如果新路徑為空,提if th.Text.Trim()=={MessageBox.Show("請(qǐng)選擇新路徑!提示",MessageBoxButtons.OK,MessageBoxIcon.Information);}{if(MessageBox.Show("確定要修改路徑嗎?","操作提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)DialogResult.Yes){//將原路徑下的文 stringfilesDirectory.GetFiles(KTVUtil.songPath);stringfileName="";//文件名(不含路徑)stringdest 目標(biāo)文件名(含路徑foreach(stringsourcein{fileName=dest=this.txtNe th.Text.Trim()+"\\"+fileName;File.Copy(source,dest);}修改數(shù)據(jù)庫(kù)DBHelperdbHelper=newstringsql=string.Format("Updateresource_pathsetresource_path='{0}'whereresource_type='song'", mandcommand= {intresult=command.ExecuteNonQuery();if(result==1){//刪除 中的文Directory.Delete(KTVUtil.songPath,MessageBox.Show("保存成功!操作結(jié)果",MessageBoxButtons.OK,MessageBoxIcon.Information);KTVUtil.songPath= th.Text.Trim();修改KTVUtil中的歌曲路徑 }}catch(Exception{MessageBox.Show("系統(tǒng)發(fā)生錯(cuò)誤,請(qǐng)稍后再試!提示",MessageBoxButtons.OK,MessageBoxIcon.Information); }{}}}}}privateprivatev

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論