Example #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     frmTMEdit edit = new frmTMEdit();
     edit.Owner = this;
     edit.OpType = "add";
     edit.ShowDialog();
     if (edit.IsReutrn)
         BindGridView();
 }
Example #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection gv = this.dgPhone.SelectedRows;
            if (gv.Count == 0)
            {
                MessageBox.Show("��ѡ���¼��", "����", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            string id = gv[0].Cells[0].Value.ToString();
            if (string.IsNullOrEmpty(id))
            {
                MessageBox.Show("��ѡ���¼��", "����", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            frmTMEdit edit = new frmTMEdit();
            edit.OpType = "edit";
            edit.ID = id;
            edit.ShowDialog();
            if (edit.IsReutrn)
                BindGridView();
        }