Exemplo n.º 1
0
        private void save_button_Click(object sender, EventArgs e)
        {
            alarm.comment = set_info_richTextBox.Text;
            alarm.solved  = checkBox1.Checked;
            Repository.Repository.UpdateAlarm(alarm);

            form = null;
            Close();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 显示告警窗体
        /// </summary>
        /// <param name="alarm">告警信息</param>
        public static void ShowAlarmInformationForm(Alarm alarm)
        {
            if (form == null)
            {
                form = new AlarmInformationForm();
            }

            form.SetData(alarm);
            form.Activate();
            form.Show();
        }
Exemplo n.º 3
0
        private void alarmDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if ((alarmDataGridView.CurrentCell != null) &&
                (alarmDataGridView.CurrentCell.ColumnIndex == 0) ||
                (alarmDataGridView.Rows.Count == 0))
            {
                return;
            }

            if ((alarmDataGridView.CurrentRow == null) ||
                (alarmDataGridView.CurrentRow.Tag == null))
            {
                return;
            }

            var alarm = alarmDataGridView.CurrentRow.Tag as Alarm;

            AlarmInformationForm.ShowAlarmInformationForm(alarm);
        }
Exemplo n.º 4
0
 private void AlarmInfoForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     form = null;
 }
Exemplo n.º 5
0
 private void close_button_Click(object sender, EventArgs e)
 {
     form = null;
     Close();
 }