private void simpleButtonAdd_Click(object sender, EventArgs e) { var newAddSIPAccount = new AddSIPAccount(); var dialog = new PopupDialog(newAddSIPAccount, "Add SIP Account"); dialog.ShowDialog(); if (newAddSIPAccount.SIPId > 0) { WaitDialog.Show("Loading Component..."); LoadSIPAccount(); WaitDialog.Close(); MessageBox.Show("Successfully Saved!", "Bright Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); gvSIPAccount.SelectRow("id", newAddSIPAccount.SIPId); WaitDialog.Close(); } }
private void simpleButtonEdit_Click(object sender, EventArgs e) { if (gvSIPAccount.RowCount < 1) return; var sipaccount = gvSIPAccount.GetFocusedRow() as sip_accounts; var EditSIPAccount = new AddSIPAccount(sipaccount.id); var dialog = new PopupDialog(EditSIPAccount, "Edit SIP EditSIPAccount"); dialog.ShowDialog(); if (sipaccount.id > 0) { WaitDialog.Show("Loading Component..."); LoadSIPAccount(); gvSIPAccount.SelectRow("id", sipaccount.id); WaitDialog.Close(); } }