Ejemplo n.º 1
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 7)
     {
         var ok = MessageBox.Show("是否删除用户" + Mlist[e.RowIndex].m_name + "?", "是否删除", MessageBoxButtons.OKCancel,
                                  MessageBoxIcon.Question);
         if (ok == DialogResult.OK)
         {
             try
             {
                 AllValue.db.Execute("DELETE FROM manager WHERE m_id=@m_id", Mlist[e.RowIndex]);
                 MessageBox.Show("删除成功");
             }
             catch (Exception exception)
             {
                 Console.WriteLine(exception);
                 MessageBox.Show("删除失败");
             }
         }
     }
     else
     {
         var useredit = new UserEditForm(Mlist[e.RowIndex]);
         useredit.ShowDialog();
     }
 }
Ejemplo n.º 2
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            var usernew = new UserEditForm(null, 1);

            usernew.ShowDialog();
        }