private void AddDayAction(GXDLMSActivityCalendar c, GXDLMSDayProfile target, int index, ListView li)
        {
            GXDLMSDayProfileAction          item = new GXDLMSDayProfileAction();
            GXDLMSActivityCalendarActionDlg dlg  = new GXDLMSActivityCalendarActionDlg(item, Target.Parent.GetObjects(ObjectType.ScriptTable));

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                List <GXDLMSDayProfileAction> items = new List <GXDLMSDayProfileAction>();
                if (target.DaySchedules != null)
                {
                    items.AddRange(target.DaySchedules);
                }
                items.Add(item);
                target.DaySchedules = items.ToArray();
                if (index == 5)
                {
                    ActiveDaysList_SelectedIndexChanged(null, null);
                }
                else
                {
                    PassiveDaysList_SelectedIndexChanged(null, null);
                }
                errorProvider1.SetError(li, Properties.Resources.ValueChangedTxt);
                c.UpdateDirty(index, target.DaySchedules);
            }
        }
        private void EditDayAction(int index, ListViewItem li, ListView lv)
        {
            GXDLMSDayProfileAction          item = (GXDLMSDayProfileAction)li.Tag;
            GXDLMSActivityCalendarActionDlg dlg  = new GXDLMSActivityCalendarActionDlg(item, Target.Parent.GetObjects(ObjectType.ScriptTable));

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                if (index == 5)
                {
                    ActiveDaysList_SelectedIndexChanged(null, null);
                }
                else
                {
                    PassiveDaysList_SelectedIndexChanged(null, null);
                }
                errorProvider1.SetError(lv, Properties.Resources.ValueChangedTxt);
                Target.UpdateDirty(index, item);
            }
        }