Пример #1
0
        /**********************************************************/

        private void btnNewSchedule_Click(object sender, EventArgs e)
        {
            frmOADRNewScheduleView newSchedule = new frmOADRNewScheduleView();

            DialogResult result = newSchedule.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }

            oadrOptScheduleModel optScheduleModel = newSchedule.getOptScheduleModel();

            ListViewItem lvi = new ListViewItem(optScheduleModel.Name);

            lvi.SubItems.Add(optScheduleModel.OptID);
            lvi.SubItems.Add("False");
            lstSchedules.Items.Add(lvi);

            m_scheduleLvi.Add(optScheduleModel.OptID, lvi);

            m_schedulesByOptId.Add(optScheduleModel.OptID, optScheduleModel);

            // createOptSchedules(optScheduleModel);
        }
Пример #2
0
        /********************************************************************************/

        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lstSchedules.SelectedItems.Count == 0)
            {
                return;
            }

            string optID = lstSchedules.SelectedItems[0].SubItems[1].Text;

            oadrOptScheduleModel optScheduleModel = m_schedulesByOptId[optID];

            frmOADRNewScheduleView newSchedule = new frmOADRNewScheduleView();

            newSchedule.loadOadrOptScheduleModel(optScheduleModel);

            DialogResult result = newSchedule.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }

            // update the model
            optScheduleModel = newSchedule.getOptScheduleModel(optScheduleModel);

            m_schedulesByOptId[optID] = optScheduleModel;

            ListViewItem lvi = m_scheduleLvi[optID];

            lvi.SubItems[0].Text = optScheduleModel.Name;

            // m_schedulesByOptId.Add(optScheduleModel.OptID, optScheduleModel);
        }