Пример #1
0
        private void FillActualState()
        {
            Lifelength actualState;

            if (currentDetail != null)
            {
                if (currentDetail is BaseDetail)
                {
                    actualState        = currentDetail.GetLifelength(dateTimePickerDate.Value);
                    actualStateRecords = currentDetail.GetActualSettingRecords(dateTimePickerDate.Value);
                }
                else
                {
                    actualState        = ((BaseDetail)currentDetail.Parent).GetLifelength(dateTimePickerDate.Value);
                    actualStateRecords = ((BaseDetail)currentDetail.Parent).GetActualSettingRecords(dateTimePickerDate.Value);
                }
            }
            else
            {
                actualState        = ((BaseDetail)currentDirective.Parent).GetLifelength(dateTimePickerDate.Value);
                actualStateRecords = ((BaseDetail)currentDirective.Parent).GetActualSettingRecords(dateTimePickerDate.Value);
            }
            if (actualState != null)
            {
                textBoxHours.Text  = UsefulMethods.HoursToString(actualState.Hours);
                textBoxCycles.Text = actualState.Cycles.ToString();
            }
            actualStateChanged = false;
        }
Пример #2
0
        /// <summary>
        /// Обновляет элементы ListView
        /// </summary>
        public override void UpdateItems()
        {
            ItemsHash.Clear();
            ListViewItemList.Clear();
            ItemsListView.Items.Clear();
            selectedItemsList.Clear();
            List <AbstractRecord> records = new List <AbstractRecord>();

            records.AddRange(currentDetail.GetActualSettingRecords());
            records.AddRange(currentDetail.GetTransferRecords());
            records.AddRange(currentDetail.GetDetailDirectivesPerformances());

            AddItems(records.ToArray());
            SetTotalText();
        }