コード例 #1
0
 /// <summary>
 /// 新建公司
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnNew_Click(object sender, EventArgs e)
 {
     using (frmAgentAssitant fa = new frmAgentAssitant())
     {
         fa.Flag = "NEW";
         if (fa.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             loadAgents();
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// 修改公司
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (dgvAgents.SelectedRows.Count != 1)
     {
         MessageBox.Show("请选择一行记录后进行修改操作", this.funName, MessageBoxButtons.OK);
         return;
     }
     using (frmAgentAssitant fa = new frmAgentAssitant())
     {
         fa.Flag    = "UPDATE";
         fa.AgentID = (int)dgvAgents.SelectedRows[0].Cells[0].Value;
         if (fa.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             loadAgents();
         }
     }
 }