private void ShowAccountForm() { myTreeNode tn = tvNodes.SelectedNode as myTreeNode; if (tn == null) { return; } EditAccount account = new EditAccount(this, tn); account.ShowDialog(); }
/// <summary> /// 修改数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridUpdate_Click(object sender, EventArgs e) { if (dgvData.DataSource != null) { DataGridViewCellCollection row = dgvData.CurrentRow.Cells; if (row.Count > 5) { AccoutnModel model = new AccoutnModel(); model.AccountCode = Convert.ToInt32(row[0].Value); model.AccountTitle = row[1].Value.ToString(); model.AccountName = row[2].Value.ToString(); model.AccountPwd = row[3].Value.ToString(); model.AccountWebsite = row[4].Value.ToString(); model.AccountRemark = row[5].Value.ToString(); model.AccountGroupCode = Convert.ToInt32(row[6].Value); myTreeNode tn = tvNodes.SelectedNode as myTreeNode; EditAccount account = new EditAccount(this, tn, model); account.ShowDialog(); } } }