예제 #1
0
        /// <summary>
        /// 新增字典信息
        /// </summary>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            ZDFrm zdFrm = new ZDFrm();

            zdFrm.ShowDialog();
            if (zdFrm.DialogResult == DialogResult.OK)
            {
                this.ziDianTableAdapter.Fill(this.settingDataSet1.ZiDian);
            }
        }
예제 #2
0
 /// <summary>
 /// 修改字典信息
 /// </summary>
 private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         //选中数据的主键ID
         int selectRow = (int)dataGridView1.SelectedRows[0].Cells[0].Value;
         if (selectRow > 0)
         {
             ZDFrm zdFrm = new ZDFrm();
             //传值
             zdFrm.IntZD = selectRow;
             zdFrm.ShowDialog();
             if (zdFrm.DialogResult == DialogResult.OK)
             {
                 this.ziDianTableAdapter.Fill(this.settingDataSet1.ZiDian);
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("无效的选中行!");
     }
 }