Exemple #1
0
        private void 批次修改發生日期ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ServiceDataRow     sdr = (ServiceDataRow)dataGridViewX1.CurrentRow.DataBoundItem;
            ChangeDateTimeForm ctf = new ChangeDateTimeForm("發生日期", sdr.OccurDate);
            DialogResult       dr  = ctf.ShowDialog();

            if (dr == System.Windows.Forms.DialogResult.Yes)
            {
                foreach (DataGridViewRow row in dataGridViewX1.SelectedRows)
                {
                    sdr           = (ServiceDataRow)row.DataBoundItem;
                    sdr.OccurDate = ctf.ChangeTime.ToShortDateString();
                }
            }
        }
        private void 批次修改發生日期ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ServiceDataRow sdr = (ServiceDataRow)dataGridViewX1.CurrentRow.DataBoundItem;
            ChangeDateTimeForm ctf = new ChangeDateTimeForm("發生日期", sdr.OccurDate);
            DialogResult dr = ctf.ShowDialog();

            if (dr == System.Windows.Forms.DialogResult.Yes)
            {
                foreach (DataGridViewRow row in dataGridViewX1.SelectedRows)
                {
                    sdr = (ServiceDataRow)row.DataBoundItem;
                    sdr.OccurDate = ctf.ChangeTime.ToShortDateString();
                }
            }
        }