示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            password = textBox4.Text;
            password2 = textBox5.Text;
            if (password == string.Empty || password2 == string.Empty)
            {
                MessageBox.Show("请输入密码", "提示");
                return;
            }
            using (sqlAdapter sqladp = new sqlAdapter())
            {
                password = MD5Create(password);
                string sql = "select ans from [user] where username = '******'";
                string ans = sqladp.ExecuteScalar(sql) as string;
                if (ans == textBox3.Text)
                {
                    sql = "update [user] set password='******' where username='******'";
                    sqladp.ExecuteScalar(sql);
                    MessageBox.Show("修改密码成功!", "消息");

                }
                else
                {
                    MessageBox.Show("验证失败!", "消息");
                }
            }
        }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     using (sqlAdapter sqladp = new sqlAdapter())
     {
         string sql = "update [user] set autho='" + comboBox2.Text + "' where username='******'";
         sqladp.ExecuteScalar(sql);
     }
     MessageBox.Show("修改成功!", "消息");
 }
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     userid = textBox1.Text;
     if (userid == string.Empty)
     {
         MessageBox.Show("请输入用户名", "提示");
         return;
     }
     for (int i = 0; i < userid.Length; i++)
     {
         if (userid[i] == '\'')
         {
             MessageBox.Show("用户名不存在!", "提示信息");
             return;
         }
     }
     using (sqlAdapter sqladp = new sqlAdapter())
     {
         string sql = "select quest from [user] where username = '******'";
         string quest = sqladp.ExecuteScalar(sql) as string;
         textBox2.Text = quest;
     }
 }
示例#4
0
 private void button1_Click(object sender, EventArgs e)
 {
     addoricode = textBox1.Text;
     addorigin = textBox2.Text.Replace("'", "''");
     if (addoricode == string.Empty || addorigin == string.Empty)
     {
         MessageBox.Show("请输入数据", "提示");
         return;
     }
     try
     {
         using (sqlAdapter sqladp = new sqlAdapter())
         {
             string sql = "insert into [ori] values ('" + addoricode + "','" + addorigin + "')";
             sqladp.ExecuteScalar(sql);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("错误", "消息");
         return;
     }
     MessageBox.Show("添加成功!","消息");
 }
示例#5
0
        private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
        {
            comboBox7.Items.Clear();
            comboBox8.Items.Clear();
            comboBox10.Items.Clear();
            comboBox11.Items.Clear();
            comboBox12.Items.Clear();
            comboBox9.Items.Clear();
            modtrack = comboBox6.Text;
            modscode = modacode + modtrack;

            List<DataTable> dt;
            List<ComboBox> CB = new List<ComboBox>(6);
            CB.Add(comboBox7);
            CB.Add(comboBox8);
            CB.Add(comboBox9);
            CB.Add(comboBox10);
            CB.Add(comboBox11);
            CB.Add(comboBox12);
            DataSet modOrigin = new DataSet();
            try
            {
                using (sqlAdapter sqladp = new sqlAdapter())
                {
                    sqladp.getDataSet("select origin from [ori],song where ori.oricode=song.oricode and scode='" + modscode + "'",out modOrigin);
                    modorigin = modOrigin.Tables[0].Rows[0][0].ToString();

                    sqladp.getDataTables(out dt, "select lyric from [song] where scode='" + modscode + "'",
                        "select sname from [song] where scode='" + modscode + "'", "select arranger from [song] where scode='" + modscode + "'",
                        "select style from [song] where scode='" + modscode + "'", "select vocal from [song] where scode='" + modscode + "'",
                        "select distinct origin from [ori]");
                    string sql = "select oricode from [ori] where origin = '" + modorigin + "'";
                    modoricode = sqladp.ExecuteScalar(sql) as string;
                }
                Program.fillIn(ref dt, ref CB);

                comboBox12.SelectedIndex = comboBox12.Items.IndexOf(modorigin);
            }
            catch(Exception) { MessageBox.Show("无此曲目", "提示"); }
        }
示例#6
0
        private void button4_Click(object sender, EventArgs e)
        {
            modlyric2 = comboBox7.Text.Replace("'", "''");
            modsname2 = comboBox8.Text.Replace("'", "''");
            modarranger2 = comboBox9.Text.Replace("'", "''");
            modstyle2 = comboBox10.Text.Replace("'", "''");
            modvocal2 = comboBox11.Text.Replace("'", "''");
            modorigin2 = comboBox12.Text.Replace("'", "''");
            if (modlyric2 != modlyric)
            {
                using (sqlAdapter sqladp = new sqlAdapter())
                {
                    sqladp.ExecuteScalar("update [song] set lyric='" + modlyric2 + "' where scode='" + modscode + "'");
                }
                MessageBox.Show("修改作词成功!", "消息");
            }
            if (modsname2 != modsname)
            {
                using (sqlAdapter sqladp = new sqlAdapter())
                {
                    sqladp.ExecuteScalar("update [song] set sname='" + modsname2 + "' where scode='" + modscode + "'");
                }
                MessageBox.Show("修改歌曲名成功!", "消息");
            }
            if (modarranger2 != modarranger)
            {
                using (sqlAdapter sqladp = new sqlAdapter())
                {
                    sqladp.ExecuteScalar("update [song] set arranger='" + modarranger2 + "' where scode='" + modscode + "'");
                }
                MessageBox.Show("修改编曲成功!", "消息");
            }
            if (modstyle2 != modstyle)
            {
                using (sqlAdapter sqladp = new sqlAdapter())
                {
                    sqladp.ExecuteScalar("update [song] set style='" + modstyle2 + "' where scode='" + modscode + "'");
                }
                MessageBox.Show("修改曲风成功!", "消息");
            }
            if (modvocal2 != modvocal)
            {
                using (sqlAdapter sqladp = new sqlAdapter())
                {
                    sqladp.ExecuteScalar("update [song] set vocal='" + modvocal2 + "' where scode='" + modscode + "'");
                }
                MessageBox.Show("修改歌手成功!", "消息");
            }

            using (sqlAdapter sqladp = new sqlAdapter())
            {
                modoricode2 = sqladp.ExecuteScalar("select oricode from [ori] where origin = '" + modorigin2 + "'") as string;
            }
            if (modoricode2 != modoricode)
            {
                using (sqlAdapter sqladp = new sqlAdapter())
                {
                    sqladp.ExecuteScalar("update [song] set oricode='" + modoricode2 + "' where scode='" + modscode + "'");
                }
                MessageBox.Show("修改原曲成功!", "消息");
            }
        }
示例#7
0
        private void button1_Click(object sender, EventArgs e)
        {
            userid = textBox2.Text;
            password = textBox3.Text;
            password2 = textBox4.Text;
            if (password != password2)
            {
                MessageBox.Show("两次密码输入不一致!", "提示信息");
                return;
            }
            if (userid == string.Empty)
            {
                MessageBox.Show("请输入用户名", "提示");
                return;
            }
            if (userid.Contains("\'"))
            {
                MessageBox.Show("非法用户名!", "警告");
                return;
            }
            if (password == string.Empty || password2==string.Empty)
            {
                MessageBox.Show("请输入密码", "提示");
                return;
            }
            if (textBox5.Text == string.Empty || textBox6.Text == string.Empty)
            {
                MessageBox.Show("请输入找回密码必要的信息", "提示");
                return;
            }
            password = MD5Create(password);
            ////////////////////////////////////////////////////////////////
            using (sqlAdapter sqladp = new sqlAdapter())
            {
                string sql = "select username from [user] where username = '******'";
                object obj = sqladp.ExecuteScalar(sql);
                //对数据库查询出的值进行判断
                if (obj != null)
                {
                    MessageBox.Show("用户名已存在!", "提示信息");
                    return;
                }
                else
                {
                    sql = "insert into [user] values ('" + userid + "','" + password + "','3 ','" + textBox5.Text + "','" + textBox6.Text + "')";
                    sqladp.ExecuteScalar(sql);
                    MessageBox.Show("注册成功!", "提示信息");
                    this.Dispose();
                    return;
                    /*if (password == obj.ToString())
                    {

                        //MessageBox.Show("登录成功", "提示");
                        DataPool.currentID = userid;
                        DataPool.currentMD5Password = obj.ToString();
                        //this.Visible = false;
                        this.Dispose();

                    }
                    else
                        MessageBox.Show("密码错误", "提示");

                     */
                }

            }
            ////////////////////////////////////////////////////////////////////
        }
示例#8
0
        private void Form2_Load(object sender, EventArgs e)
        {
            Form1 Form1 = new Form1();
            Form1.ShowDialog();

            if (!Form1.IsDisposed)
                return;
            //if (DataPool.currentID == "")
            //    return;

            using (sqlAdapter sqladp = new sqlAdapter())
            {
                string sql = "select count(scode) from gas ";
                int ssum = Convert.ToUInt16(sqladp.ExecuteScalar(sql));
                toolStripStatusLabel1.Text = "目前歌曲数:" + ssum;
                sql = "select count(username) from [user] ";
                int peoplesum = Convert.ToUInt16(sqladp.ExecuteScalar(sql));
                toolStripStatusLabel3.Text = "注册人数:" + peoplesum;
                sql = "select autho from [user] where username = '******'";
                string autho = sqladp.ExecuteScalar(sql) as string;
                DataPool.currentAutho = autho;

                switch (autho)
                {
                    case "3":
                        添加原曲ToolStripMenuItem.Enabled = false;
                        添加ToolStripMenuItem.Enabled = false;
                        删除ToolStripMenuItem.Enabled = false;
                        修改ToolStripMenuItem.Enabled = false;
                        break;
                    case "2":
                        删除ToolStripMenuItem.Enabled = false;
                        修改ToolStripMenuItem.Enabled = false;
                        break;
                }

                DataSet ds;
                sqladp.getDataSet("SELECT origin FROM ori",out ds);

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    comboBox1.Items.Add(ds.Tables[0].Rows[i][0]);
                }
                comboBox1.SelectedIndex = 0;
            }

            //    clerkNameText.Text = "当前管理员 " + DataPool.currentID;
               //     statusStrip1.Items.Insert(1, new ToolStripSeparator());
        }
示例#9
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox2.Text == "" || comboBox4.Text == "" || comboBox6.Text == "" || comboBox3.Text == "" || comboBox8.Text == "" || comboBox9.Text == "")
            {
                MessageBox.Show("请填写完整带“*”的数据", "提示");
                return;
            }
            //________________________________________________________________________________________________
            addacode = comboBox2.Text;
            addaname = comboBox4.Text.Replace("'", "''");
            addtime = comboBox5.Text;
            addgcode = addacode.Substring(0, 4);
            addtrack = comboBox6.Text;
            addscode = addacode + addtrack;
            addgname = comboBox3.Text.Replace("'", "''");
            addorigin = comboBox12.Text;
            addsname = comboBox8.Text.Replace("'", "''");
            addarranger = comboBox9.Text.Replace("'", "''");
            addlyric = comboBox7.Text.Replace("'", "''");
            addvocal = comboBox11.Text.Replace("'", "''");
            addstyle = comboBox10.Text.Replace("'", "''");

            using (sqlAdapter sqladp = new sqlAdapter())
            {

                string sql = "select oricode from [ori] where origin = '" + addorigin + "'";
                addoricode = sqladp.ExecuteScalar(sql) as string;
                if (addoricode == null)
                {
                    MessageBox.Show("没有找到原曲!", "消息提示");
                    Form9 Form9 = new Form9();
                    Form9.ShowDialog();
                    return;
                }

                sql = "select acode from [album] where acode = '" + addacode + "'";
                object obj = sqladp.ExecuteScalar(sql);

                if (obj == null)
                {
                    sql = "insert into [album] values ('" + addacode + "','" + addaname + "','" + addtime + "',@cover)";
                    sqladp.setCommand(sql);
                    sqladp.Command.Parameters.Add("cover", SqlDbType.Image);
                    sqladp.Command.Parameters["cover"].Value = imagebytes;
                    sqladp.Command.ExecuteNonQuery();
                }

                sql = "select gcode from [group] where gcode = '" + addgcode + "'";
                obj = sqladp.ExecuteScalar(sql);
                //对数据库查询出的值进行判断
                if (obj == null)
                {
                    sql = "insert into [group] values ('" + addgname + "','" + addgcode + "')";
                    sqladp.ExecuteScalar(sql);

                }

                try
                {
                    sql = "insert into [song] values ('" + addsname + "','" + addtrack + "','" + addarranger + "','" + addlyric + "','" + addvocal + "','" + addoricode + "','" + addstyle + "','" + addscode + "','" + DataPool.currentID + "')";
                    sqladp.ExecuteScalar(sql);

                    sql = "insert into [gas] values ('" + addgcode + "','" + addacode + "','" + addscode + "')";
                    sqladp.ExecuteScalar(sql);

                    MessageBox.Show("提交成功!", "提示信息");
                }
                catch (Exception)
                {
                    MessageBox.Show("错误", "提示信息");
                    return;
                }
            }
        }
示例#10
0
 private void button4_Click(object sender, EventArgs e)
 {
     string autho;
     using (sqlAdapter sqladp = new sqlAdapter())
     {
         string sql = "select autho from [user] where username = '******'";
         autho = sqladp.ExecuteScalar(sql) as string;
     }
     if (autho == "1" || autho == "0")
     {
         Form12 Form12 = new Form12();
         Form12.ShowDialog();
     }
     else
     {
         MessageBox.Show("权限不足", "提示");
         return;
     }
 }
示例#11
0
        private void button5_Click(object sender, EventArgs e)
        {
            userid = textBox1.Text;
            password = textBox2.Text;

            if (userid == string.Empty)
            {
                MessageBox.Show("请输入用户名", "提示");
                return;
            }

            for (int i = 0; i < userid.Length; i++)
            {
                if (userid[i] == '\'')
                {
                    MessageBox.Show("用户名不存在!", "提示");
                    return;
                }
            }

            using (sqlAdapter sqladp = new sqlAdapter())
            {
                string sql = "select password from [user] where username = '******'";
                object obj = sqladp.ExecuteScalar(sql);

                if (obj == null)
                {
                    MessageBox.Show("用户名不存在!", "提示");
                    return;
                }
                else
                {
                    if (psCt(password) == obj.ToString())
                    {
                        DataPool.currentID = userid;
                        DataPool.currentMD5Password = obj.ToString();
                        //this.Visible = false;
                        sql = "select autho from [user] where username = '******'";
                        string autho = sqladp.ExecuteScalar(sql) as string;

                        if (autho == "0")
                        {
                            Form10 Form10 = new Form10();
                            Form10.ShowDialog();
                        }
                        else
                        {
                            MessageBox.Show("权限不足", "提示");
                            return;
                        }
                    }
                    else
                    {
                        MessageBox.Show("密码错误", "提示");
                    }
                }
            }
        }
示例#12
0
        private void button1_Click(object sender, EventArgs e)
        {
            userid = textBox1.Text;
            password = textBox2.Text;

            if (userid == string.Empty)
            {
                MessageBox.Show("请输入用户名", "提示");
                return;
            }
            if(userid.Contains("\'"))
            {
                MessageBox.Show("用户名非法!", "提示");
                return;
            }

            try
            {
                using (sqlAdapter sqladp = new sqlAdapter())
                {
                    string sql = "select password from [user] where username = '******'";

                    string obj = sqladp.ExecuteScalar(sql) as string;

                    if (obj == null)
                        // user from kamiro website
                    //{
                    //    using (sqlAdapter sqlKamiro = new sqlAdapter(DataPool.conkamiro))
                    //    {
                    //        sql = "select password from [userTable] where userName = '******'";
                    //        string kamiropass = sqlKamiro.ExecuteScalar(sql) as string;
                    //        if (psHd(password) == kamiropass)
                    //        {
                    //            DataPool.currentID = userid;
                    //            DataPool.currentMD5Password = obj;
                    //            //this.Visible = false;
                    //            MessageBox.Show("欢迎来自KCM的账号!", "消息");

                    //            doRememberPasswd();

                    //            this.Dispose();

                    //        }
                    //        else
                                MessageBox.Show("密码错误", "提示");
                        //}
                    //}
                    else
                        // user of this program
                    {
                        if (psCt(password) == obj)
                        {

                            //MessageBox.Show("登录成功", "提示");
                            DataPool.currentID = userid;
                            DataPool.currentMD5Password = obj;
                            //this.Visible = false;

                            doRememberPasswd();

                            this.Dispose();

                        }
                        else
                            MessageBox.Show("密码错误", "提示");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("连接失败!", "提示");
                Trace.Write(ex.StackTrace);
                return;
            }
        }
示例#13
0
        private void button2_Click(object sender, EventArgs e)
        {
            using (sqlAdapter sqladp = new sqlAdapter())
            {
                string sql = "delete from [gas] where scode='" + modscode + "'";
                sqladp.ExecuteScalar(sql);

                sql = "delete from [song] where scode='" + modscode + "'";
                sqladp.ExecuteScalar(sql);

                sql = " select gcode from gas where gcode='" + modgcode + "'";
                object obj = sqladp.ExecuteScalar(sql);

                if (obj == null)
                {
                    sql = "delete from [group] where gcode='" + modgcode + "'";
                    sqladp.ExecuteScalar(sql);
                }

                sql = " select acode from gas where acode='" + modacode + "'";
                object obj1 = sqladp.ExecuteScalar(sql);

                if (obj1 == null)
                {
                    sql = "delete from [album] where acode='" + modacode + "'";
                    sqladp.ExecuteScalar(sql);
                }
            }
            MessageBox.Show("已删除", "提示");
            this.Dispose();
        }