private void btnAddJob_Click(object sender, EventArgs e) { frmAddOrEdit frmAdd = new frmAddOrEdit(); frmAdd.ShowDialog(); //重新顯示資料 gvJobGridView.DataSource = null; gvJobGridView.DataSource = Jobs.JobDatas; }
private void btnEditJob_Click(object sender, EventArgs e) { string JobId = GetJobIdFromSelectRow(); if (!string.IsNullOrEmpty(JobId)) { frmAddOrEdit frmAdd = new frmAddOrEdit(JobId); frmAdd.ShowDialog(); gvJobGridView.DataSource = null; gvJobGridView.DataSource = Jobs.JobDatas; } else { MessageBox.Show("請選擇一筆 Job 資料。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }