private void btnSave_Click(object sender, EventArgs e) { if (maintainMode == MaintainMode.Create) { DBConnInfoRepo.GetInstance().Add(connInfo); } else { DBConnInfoRepo.GetInstance().Update(connInfo); } Close(); }
private void RefreshDGVDBConnectInfo() { DBConnInfoList = DBConnInfoRepo.GetInstance().Get(); DGVDBConnectInfo.DataSource = DBConnInfoList; DGVDBConnectInfo.AutoResizeColumns(); }
private void 刪除ToolStripMenuItem_Click(object sender, EventArgs e) { DBConnInfoRepo.GetInstance().Delete((DBConnInfo)DGVDBConnectInfo.CurrentRow.DataBoundItem); RefreshDGVDBConnectInfo(); }