Example #1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != -1)
            {
                if (e.ColumnIndex == 1)
                {
                    DataRow         dr  = (DataRow)this.dataGridView1.Rows[e.RowIndex].Tag;
                    TianjiaYuanGong add = new TianjiaYuanGong(dr);
                    add.Text = "查看用户信息";

                    add.ShowDialog();
                    if (add.DialogResult == DialogResult.OK)
                    {
                        ReFresh();
                    }
                }
                if (e.ColumnIndex == 3)
                {
                    if (MessageBox.Show("确定删除吗?", "提示信息", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    {
                        DataRow dr = (DataRow)this.dataGridView1.Rows[e.RowIndex].Tag;
                        //删除
                        int i = DBSQL.UserSQL.deleteUser(dr["Id"].ToString());
                        if (i > 0)
                        {
                            MessageBox.Show("删除成功!");
                            ReFresh();
                        }
                    }
                }
            }
        }
Example #2
0
        private void skinButton1_Click(object sender, EventArgs e)
        {
            TianjiaYuanGong tianJiaYuanGong = new TianjiaYuanGong();

            tianJiaYuanGong.ShowDialog();
            if (tianJiaYuanGong.DialogResult == DialogResult.OK)
            {
                this.ReFresh();
            }
        }