Ejemplo n.º 1
0
        private void vip_Load(object sender, EventArgs e)
        {
            Mysqlcom my = new Mysqlcom();
            if (!my.conn)
            {
                MessageBox.Show("数据库连接失败:" + my.error);
                return;
            }

            MySqlDataReader mydr = my.er("select SHID,SHname from wa_shop");
            if (mydr == null)
            {
                MessageBox.Show("店铺读取失败:" + my.error);
                this.Close();
                return;
            }
            sid.Clear();
            while (mydr.Read())
            {
                sid.Add((int)mydr["SHID"]);
                comboBox1.Items.Add(mydr["SHname"].ToString());
            }

            comboBox1.Items.Add("全部");

            mydr.Close();

            comboBox1.Text = "全部";
        }
Ejemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            int selrow;
            try
            {
                selrow = dataGridView1.SelectedCells[0].RowIndex;
            }
            catch (Exception)
            {

                MessageBox.Show("没有选择任何行!", "错误");
                return;
            }
            Mysqlcom my = new Mysqlcom();

            if (!my.conn)
            {
                MessageBox.Show("数据库连接失败:" + my.error);
                return;
            }

            if (my.enq("update wa_vip set vipid='" + dataGridView1.Rows[selrow].Cells[2].Value + "',Telphone='" + dataGridView1.Rows[selrow].Cells[3].Value + "',ShenFenHao='" + dataGridView1.Rows[selrow].Cells[4].Value + "',ChunKuan='" + dataGridView1.Rows[selrow].Cells[5].Value + "',XianJin='" + dataGridView1.Rows[selrow].Cells[6].Value + "',XaoFei='" + dataGridView1.Rows[selrow].Cells[7].Value + "',credate='" + dataGridView1.Rows[selrow].Cells[8].Value + "',discount='" + dataGridView1.Rows[selrow].Cells[9].Value + "',JiFen='" + dataGridView1.Rows[selrow].Cells[10].Value + "',mark='" + dataGridView1.Rows[selrow].Cells[11].Value + "',state='" + dataGridView1.Rows[selrow].Cells[12].Value + "',fromID='" + dataGridView1.Rows[selrow].Cells[13].Value + "' where VID=" + dataGridView1.Rows[selrow].Cells[0].Value) == -1)
            {
                MessageBox.Show("会员修改失败:" + my.error);
                return;
            }
            MessageBox.Show("修改成功!");
        }
Ejemplo n.º 3
0
        private void search_Load(object sender, EventArgs e)
        {
            Mysqlcom my = new Mysqlcom();
            if (!my.conn)
            {
                MessageBox.Show("数据库连接失败:" + my.error);
                return;
            }

            MySqlDataReader mydr = my.er("select SHID,SHname from wa_shop");
            if (mydr == null)
            {
                MessageBox.Show("店铺读取失败:" + my.error);
                this.Close();
                return;
            }
            sid.Clear();
            while (mydr.Read())
            {
                sid.Add((int)mydr["SHID"]);
                comboBox1.Items.Add(mydr["SHname"].ToString());
            }

            comboBox1.Items.Add("全部");

            mydr.Close();

            int i = 0;
            for (i = 0; i < sid.Count; i++) if (Comdata.shopnum == (int)sid[i]) break;
            comboBox1.SelectedIndex = i;
        }
Ejemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            int selrow;
            try
            {
                selrow = dataGridView1.SelectedCells[0].RowIndex;
            }
            catch (Exception)
            {

                MessageBox.Show("没有选择任何行!", "错误");
                return;
            }

            if (MessageBox.Show("确认要删除该会员?", "删除会员", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {

                Mysqlcom my = new Mysqlcom();

                if (!my.conn)
                {
                    MessageBox.Show("数据库连接失败:" + my.error);
                    return;
                }

                if (my.enq("delete from wa_vip where VID="+dataGridView1.Rows[selrow].Cells[0].Value ) == -1)
                {
                    MessageBox.Show("会员删除失败:" + my.error);
                    return;
                }
                ds.Tables["wa_wash"].Rows.RemoveAt(selrow);

            }
        }
Ejemplo n.º 5
0
        private void button3_Click(object sender, EventArgs e)
        {
            int selrow;
            try
            {
                selrow = dataGridView1.SelectedCells[0].RowIndex;
            }
            catch (Exception)
            {

                MessageBox.Show("没有选择任何行!", "错误");
                return;
            }
            Mysqlcom my = new Mysqlcom();

            if (!my.conn)
            {
                MessageBox.Show("数据库连接失败:" + my.error);
                return;
            }

            if (my.enq("update wa_login set password='******',team='" + dataGridView1.Rows[selrow].Cells[3].Value + "',logdate='" + dataGridView1.Rows[selrow].Cells[4].Value + "',loginIP='" + dataGridView1.Rows[selrow].Cells[5].Value + "' where UID=" + dataGridView1.Rows[selrow].Cells[0].Value) == -1)
            {
                MessageBox.Show("工号修改失败:" + my.error);
                return;
            }
            MessageBox.Show("修改成功!");
        }