public int tb_computerLogin(tb_computer compay, int intFalg) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = null; switch (intFalg) { case 1: strAdd = "select * from tb_computer where cmp_name='" + compay.strcmp_name + "' and cmp_Falg='" + 0 + "'"; break; case 2: strAdd = "select * from tb_computer where cmp_name='" + compay.strcmp_name + "'and cmp_Paww='" + compay.strcmp_Paww + "' and cmp_Falg='" + 0 + "'"; break; } oledcmd = new SqlCommand(strAdd, oledCon); oleRed = oledcmd.ExecuteReader(); if (oleRed.HasRows) { intResult++; } return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public void tbMusicnfoFill(object obj) { try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "select * from tb_computer where cmp_Falg='" + 0 + "'"; oledcmd = new SqlCommand(strAdd, oledCon); oleRed = oledcmd.ExecuteReader(); ListView lv = (ListView)obj; lv.Items.Clear(); while (oleRed.Read()) { ListViewItem lv1 = new ListViewItem(oleRed[0].ToString()); lv1.SubItems.Add(oleRed[1].ToString()); lv.Items.Add(lv1); } oleRed.Close(); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); } }
public string tbFillName(string strResult) { string Result = null; try { string strSelect = null; getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); strSelect = "select Music_filepath from tb_musicinfo where Music_code= '" + strResult + "'"; oledcmd = new SqlCommand(strSelect, oledCon); oleRed = oledcmd.ExecuteReader(); oleRed.Read(); if (oleRed.HasRows) { Result = oleRed[0].ToString(); } oleRed.Close(); return(Result); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(Result); } }
public int tbMusicnfoUpdate(tb_musicinfo tb_aut) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "update tb_musicinfo set "; strAdd += "MusicC_name='" + tb_aut.strMusicC_name + "',"; strAdd += "Music_author='" + tb_aut.strMusic_author + "',Music_Kind='" + tb_aut.strMusic_Kind + "',"; strAdd += "Music_chinse='" + tb_aut.strMusic_chinse + "',Music_filepath='" + tb_aut.strMusic_filepath + "',"; strAdd += "Music_Ping='" + tb_aut.strMusic_Ping + "',Music_date='" + tb_aut.daMusic_date + "',"; strAdd += "Music_falg ='" + tb_aut.intMusic_falg + "' where Music_code='" + tb_aut.strMusic_code + "'"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int tbMusicnfoID() { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "select Max(Music_code) from tb_musicinfo"; oledcmd = new SqlCommand(strAdd, oledCon); oleRed = oledcmd.ExecuteReader(); oleRed.Read(); if (oleRed.HasRows) { if (oleRed[0].ToString() == "") { intResult = 1; } else { intResult = Convert.ToInt32(oleRed[0].ToString()) + 1; } } return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int tbFill(object obj, string strResult, int intFalg) { int intResult = 0; try { string strSelect = null; getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); switch (intFalg) { case 1: //Êý×Ö strSelect = "select * from tb_musicinfo where Music_code like '%" + strResult + "%'"; break; case 2: //Æ´Òô strSelect = "select * from tb_musicinfo where Music_Ping like '%" + strResult + "%'"; break; case 3: //Ã÷ÐÇ strSelect = "select * from tb_musicinfo where Music_author like '%" + strResult + "%'"; break; case 4: //Ã÷Ãû strSelect = "select * from tb_musicinfo where MusicC_name like '%" + strResult + "%'"; break; } oledcmd = new SqlCommand(strSelect, oledCon); oleRed = oledcmd.ExecuteReader(); ListView lv = (ListView)obj; lv.Items.Clear(); while (oleRed.Read()) { ListViewItem lv1 = new ListViewItem(oleRed[0].ToString()); lv1.SubItems.Add(oleRed[1].ToString()); lv1.SubItems.Add(oleRed[2].ToString()); lv1.SubItems.Add(oleRed[3].ToString()); lv.Items.Add(lv1); intResult++; } oleRed.Close(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public void dictionaryDelete(string strFalg) { try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "delete tb_dictionary where codeID='" + strFalg + "'"; oledcmd = new SqlCommand(strAdd, oledCon); oleRed = oledcmd.ExecuteReader(); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); } }
public SqlDataReader tbFill(string obj) { try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "select * from tb_computer where cmp_ID='" + obj + "' "; oledcmd = new SqlCommand(strAdd, oledCon); oleRed = oledcmd.ExecuteReader(); return(oleRed); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(oleRed); } }
public void tb_authorinfoFill(string strFalg, object obj) { try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "select * from tb_authorinfo "; oledcmd = new SqlCommand(strAdd, oledCon); oleRed = oledcmd.ExecuteReader(); if (strFalg == "1") { ComboBox cmb = (ComboBox)obj; while (oleRed.Read()) { cmb.Items.Add(oleRed[1].ToString()); } oleRed.Close(); } if (strFalg == "2") { ListView lv = (ListView)obj; lv.Items.Clear(); while (oleRed.Read()) { ListViewItem lv1 = new ListViewItem(oleRed[0].ToString()); lv1.SubItems.Add(oleRed[1].ToString()); lv1.SubItems.Add(oleRed[2].ToString()); lv1.SubItems.Add(oleRed[4].ToString()); lv1.SubItems.Add(oleRed[5].ToString()); lv1.SubItems.Add(oleRed[3].ToString()); lv1.SubItems.Add(oleRed[6].ToString()); lv.Items.Add(lv1); } oleRed.Close(); } // } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); } }
public SqlDataReader AuthFind(string tb_aut) { try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "select * from tb_authorinfo where authorId='" + tb_aut + "'"; oledcmd = new SqlCommand(strAdd, oledCon); oleRed = oledcmd.ExecuteReader(); return(oleRed); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(oleRed); } }
public int tb_computerDelete(tb_computer compay) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "update tb_computer set "; strAdd += "cmp_Falg ='" + compay.cmp_Falg + "' where cmp_ID='" + compay.cmp_ID + "'"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int tbMusicnfoDelete(string tb_aut) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "delete tb_musicinfo where "; strAdd += "Music_code='" + tb_aut + "'"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int tb_computerAdd(tb_computer compay) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "insert into tb_computer values( "; strAdd += "'" + compay.cmp_ID + "','" + compay.cmp_name + "','" + compay.cmp_Paww + "','" + compay.cmp_DataTime + "',"; strAdd += "'" + compay.cmp_Falg + "')"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int dictionaryAdd(tb_dictionary tb_aut) { int intResult = 0; try { getConnection getCon = new getConnection(); // oledCon = new OleDbConnection(ConfigurationSettings.AppSettings["StrCon"].ToString()); oledCon = getCon.OledCon();; oledCon.Open(); string strAdd = "insert into tb_dictionary (codeID,codName,codeReam) values ( "; strAdd += "'" + tb_aut.strcodeID + "','" + tb_aut.strcodeName + "','" + tb_aut.strcodeReam + "')"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int dictionaryUpdate(tb_dictionary tb_aut) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "update tb_dictionary set "; strAdd += " codName ='" + tb_aut.strcodeName + "', codeReam='" + tb_aut.strcodeReam + "' where codeID='" + tb_aut.strcodeID + "'"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int AuthAdd(tb_authorinfo tb_aut) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "insert into tb_authorinfo values( "; strAdd += "'" + tb_aut.intauthorId + "','" + tb_aut.strauthorName + "','" + tb_aut.strauthorSex + "','" + tb_aut.daauthorbirthday + "',"; strAdd += "'" + tb_aut.strauthorGenre + "','" + tb_aut.strauthorcompany + "','" + tb_aut.strauthorRecma + "',"; strAdd += "'" + tb_aut.strauthorzjm + "','" + tb_aut.daRdateTime + "')"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }
public int AuthUpdate(tb_authorinfo tb_aut) { int intResult = 0; try { getConnection getCon = new getConnection(); oledCon = getCon.OledCon(); oledCon.Open(); string strAdd = "update tb_authorinfo set "; strAdd += "authorName='" + tb_aut.strauthorName + "',authorSex='" + tb_aut.strauthorSex + "',authorbirthday ='" + tb_aut.daauthorbirthday + "',"; strAdd += "authorGenre='" + tb_aut.strauthorGenre + "',authorcompany='" + tb_aut.strauthorcompany + "',authorRecma ='" + tb_aut.strauthorRecma + "',"; strAdd += "authorzjm='" + tb_aut.strauthorzjm + "',RdateTime='" + tb_aut.daRdateTime + "' where authorId='" + tb_aut.intauthorId + "'"; oledcmd = new SqlCommand(strAdd, oledCon); intResult = oledcmd.ExecuteNonQuery(); return(intResult); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(intResult); } }