Ejemplo n.º 1
0
        /// <summary>
        /// 修改选择的信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AlterClubPeobutton_Click(object sender, EventArgs e)
        {
            int seIndex = dataGridView1.CurrentCell.RowIndex;

            if (dataGridView1.Rows[seIndex].Cells[3].Value.ToString() == "")
            {
                MessageBox.Show("请输入第 " + (seIndex + 1).ToString() + "行数据");
                return;
            }
            if (MessageBox.Show("确认修改 " + dataGridView1.Rows[seIndex].Cells[2].Value.ToString() + " 在 " +
                                dataGridView1.Rows[seIndex].Cells[1].Value.ToString() + " 的职务为 " +
                                dataGridView1.Rows[seIndex].Cells[3].Value.ToString(), "提示", MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning) == DialogResult.OK)
            {
                if (clubBLL.Change_ClubPeoByID(dataGridView1.Rows[seIndex].Cells[0].Value.ToString(),
                                               dataGridView1.Rows[seIndex].Cells[3].Value.ToString()))
                {
                    MessageBox.Show("修改成功!");
                    this.QueryClubPeoForm_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("修改失败!");
                }
            }
        }