コード例 #1
0
 /// <summary>
 /// 新建已纳税人
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnNew_Click(object sender, EventArgs e)
 {
     using (frmPlayerAssitant fa = new frmPlayerAssitant())
     {
         fa.Flag = "NEW";
         if (fa.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             loadPlayers();
             MessageBox.Show("新增成功", this.funName, MessageBoxButtons.OK);
         }
     }
 }
コード例 #2
0
        /// <summary>
        /// 修改已纳税人
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void benUpdate_Click(object sender, EventArgs e)
        {
            if (dgvPlayers.SelectedRows.Count != 1)
            {
                MessageBox.Show("请选择一行记录后进行操作", this.funName, MessageBoxButtons.OK);
                return;
            }

            using (frmPlayerAssitant fa = new frmPlayerAssitant())
            {
                fa.Flag        = "UPDATE";
                fa.TaxPlayerID = (int)dgvPlayers.SelectedRows[0].Cells[0].Value;
                if (fa.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    loadPlayers();
                    MessageBox.Show("更新成功", this.funName, MessageBoxButtons.OK);
                }
            }
        }