示例#1
0
        public override void EditItem(StockDetailInfo oldItem, StockDetailInfo modifiedItem)
        {
            string[]        itemsString = GetItemString(modifiedItem);
            StockDetailInfo detail      = GetDetailReferenceByDetailID(oldItem.ID);

            if (detail == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[detail];

            listViewItem.SubItems.Clear();
            listViewItem.Text = itemsString[0];
            for (int i = 1; i < itemsString.Length; i++)
            {
                listViewItem.SubItems.Add(itemsString[i]);
            }
            if (modifiedItem.Current < modifiedItem.Amount)
            {
                listViewItem.BackColor = Css.ListView.Colors.NotSatisfactoryColor;
            }
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
            SetTotalText();
        }
示例#2
0
        public override void EditItem(BaseDetailDirective oldItem, BaseDetailDirective modifiedItem)
        {
            string[]            itemsString = GetItemString(modifiedItem);
            BaseDetailDirective detail      = GetDirectiveReferenceByDirectiveID(modifiedItem.ID);

            if (detail == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[detail];

            listViewItem.SubItems.Clear();
            if (!modifiedItem.Closed)
            {
                listViewItem.ForeColor = Color.Black;
            }
            listViewItem.Text = itemsString[0];
            for (int i = 1; i < itemsString.Length; i++)
            {
                listViewItem.SubItems.Add(itemsString[i]);
            }
            listViewItem.BackColor = UsefulMethods.GetDirectiveColor(modifiedItem);

            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(modifiedItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
            SetTotalText();
        }
        public override void EditItem(AircraftFlight oldItem, AircraftFlight modifiedItem)
        {
            AircraftFlight detail = GetFlightReferenceByFlightID(oldItem.ID);

            if (detail == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[detail];

            string[] itemsString = GetItemsString(modifiedItem);
            listViewItem.SubItems.Clear();
            listViewItem.Text = itemsString[0];
            for (int i = 1; i < itemsString.Length; i++)
            {
                listViewItem.SubItems.Add(itemsString[i]);
            }
            listViewItem.BackColor = modifiedItem.Highlight.Color;
            if (!modifiedItem.Correct)
            {
                listViewItem.BackColor = Css.ListView.Colors.PendingColor;
            }
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
            SetTotalText();
        }
示例#4
0
        /// <summary>
        /// Изменяет элемент
        /// </summary>
        /// <param name="oldItem">Элемент до измения</param>
        /// <param name="modifiedItem">Измененный элемент</param>
        public override void EditItem(WorkPackage oldItem, WorkPackage modifiedItem)
        {
            ListViewItem listViewItem = ItemsHash[GetWorkPackageReferenceByWorkPackageID(oldItem.ID)];

            PrepareItem(modifiedItem, ref listViewItem);
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
        }
        /// <summary>
        /// Изменяет элемент
        /// </summary>
        /// <param name="oldItem">Элемент до измения</param>
        /// <param name="modifiedItem">Измененный элемент</param>
        public override void EditItem(BaseDetailDirective oldItem, BaseDetailDirective modifiedItem)
        {
            ListViewItem listViewItem = ItemsHash[oldItem];//todo вот тут переделать если надо

            PrepareItem(modifiedItem, ref listViewItem);
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
        }
示例#6
0
        /// <summary>
        /// Изменяет элемент
        /// </summary>
        /// <param name="oldItem">Элемент до измения</param>
        /// <param name="modifiedItem">Измененный элемент</param>
        public override void EditItem(BaseDetailDirective oldItem, BaseDetailDirective modifiedItem)
        {
            ListViewItem listViewItem = ItemsHash[GetDirectiveReferenceByDirectiveID(oldItem.ID)];

            PrepareItem(modifiedItem, ref listViewItem);
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
        }
        /// <summary>
        /// Изменяет элемент
        /// </summary>
        /// <param name="oldItem">Элемент до измения</param>
        /// <param name="modifiedItem">Измененный элемент</param>
        public override void EditItem(ModificationItem oldItem,
                                      ModificationItem modifiedItem)
        {
            ListViewItem listViewItem = ItemsHash[GetModificationItemReferenceByModificationItemID(oldItem.ID)];

            PrepareItem(modifiedItem, ref listViewItem);
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
        }
示例#8
0
        /// <summary>
        /// Изменяет элемент
        /// </summary>
        /// <param name="oldItem">Элемент до измения</param>
        /// <param name="modifiedItem">Измененный элемент</param>
        public override void EditItem(IMaintainable oldItem, IMaintainable modifiedItem)
        {
            ListViewItem listViewItem = ItemsHash[GetIOverallsReferenceByIOverallsID(oldItem.ID)];

            PrepareItem(modifiedItem, ref listViewItem);
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
            SetTotalText();
        }
示例#9
0
 /// <summary>
 /// Удаляет элемент
 /// </summary>
 /// <param name="item"></param>
 public virtual void DeleteItem(T item)
 {
     if (Contains(item))
     {
         ItemsListView.Items.Remove(ItemsHash[item]);
         listViewItemList.Remove(ItemsHash[item]);
         ItemsHash.Remove(item);
         SetTotalText();
         itemsListView.Refresh();
     }
 }
        /// <summary>
        /// Изменяет элемент
        /// </summary>
        /// <param name="oldItem">Элемент до измения</param>
        /// <param name="modifiedItem">Измененный элемент</param>
        public override void EditItem(TemplateBaseDetailDirective oldItem, TemplateBaseDetailDirective modifiedItem)
        {
            string[] itemsString         = GetItemsString(modifiedItem);
            string[] itemsStringModified = new string[itemsString.Length - 1];
            Array.Copy(itemsString, 1, itemsStringModified, 0, itemsStringModified.Length);
            ListViewItem listViewItem = ItemsHash[GetDirectiveReferenceByDirectiveID(oldItem.ID)];

            listViewItem.SubItems.Clear();
            listViewItem.Text = modifiedItem.Title;
            listViewItem.SubItems.AddRange(itemsStringModified);
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
        }
        public override void EditItem(JobCard oldItem, JobCard modifiedItem)
        {
            string[] itemsString         = GetItemsString(modifiedItem);
            string[] itemsStringModified = new string[itemsString.Length - 1];
            Array.Copy(itemsString, 1, itemsStringModified, 0, itemsStringModified.Length);
            ListViewItem listViewItem = ItemsHash[GetJobCardReferenceByJobCardID(oldItem.ID)];

            listViewItem.SubItems.Clear();
            listViewItem.Text = modifiedItem.AirlineCardNumber;
            listViewItem.SubItems.AddRange(itemsStringModified);
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
        }
        public override void EditItem(EngineeringOrderDirective oldItem, EngineeringOrderDirective modifiedItem)
        {
            string[] itemsString         = GetItemsString(modifiedItem);
            string[] itemsStringModified = new string[itemsString.Length - 1];
            Array.Copy(itemsString, 1, itemsStringModified, 0, itemsStringModified.Length);
            ListViewItem listViewItem = ItemsHash[GetDirectiveReferenceByDirectiveID(oldItem.ID)];

            listViewItem.SubItems.Clear();
            listViewItem.Text = modifiedItem.Title;
            listViewItem.SubItems.AddRange(itemsStringModified);
            listViewItem.Tag       = modifiedItem;
            listViewItem.BackColor = COLORS[modifiedItem.Condition.GetHashCode()];
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
        }
示例#13
0
        public override void EditItem(MaintenanceSubCheck oldItem, MaintenanceSubCheck modefiedItem)
        {
            string[] itemsString         = GetItemsString(modefiedItem);
            string[] itemsStringModified = new string[itemsString.Length - 1];
            Array.Copy(itemsString, 1, itemsStringModified, 0, itemsStringModified.Length);
            ListViewItem listViewItem = ItemsHash[GetSubCheckReferenceBySubCheckID(oldItem.ID)];

            listViewItem.SubItems.Clear();
            listViewItem.SubItems.AddRange(itemsStringModified);
            listViewItem.Text = itemsString[0];

            listViewItem.Tag = modefiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modefiedItem, listViewItem);
            ItemsListView.Refresh();
        }
示例#14
0
        /// <summary>
        /// Изменяет элемент
        /// </summary>
        /// <param name="oldItem">Элемент до измения</param>
        /// <param name="modifiedItem">Измененный элемент</param>
        public override void EditItem(BaseDetailDirective oldItem, BaseDetailDirective modifiedItem)
        {
            ListViewItem listViewItem = ItemsHash[GetDirectiveReferenceByDirectiveID(modifiedItem.ID)];

            PrepareItem(modifiedItem, ref listViewItem);
            if (modifiedItem.ADType == ADType.Airframe)
            {
                listViewItem.Group = ItemsListView.Groups["AF"];
            }
            else
            {
                listViewItem.Group = ItemsListView.Groups["AP"];
            }
            ItemsHash.Remove(modifiedItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
        }
示例#15
0
        /// <summary>
        /// Изменяет элемент
        /// </summary>
        /// <param name="oldItem">Элемент до измения</param>
        /// <param name="modifiedItem">Измененный элемент</param>
        public override void EditItem(TemplateDetail oldItem, TemplateDetail modifiedItem)
        {
            string[] itemsString         = GetItemsString(modifiedItem);
            string[] itemsStringModified = new string[itemsString.Length - 1];
            Array.Copy(itemsString, 1, itemsStringModified, 0, itemsStringModified.Length);
            ListViewItem listViewItem = ItemsHash[GetDetailReferenceByDetailID(oldItem.ID)];

            listViewItem.SubItems.Clear();
            listViewItem.Text = modifiedItem.AtaChapter.ShortName;
            listViewItem.SubItems.AddRange(itemsStringModified);
            listViewItem.SubItems.Add(modifiedItem.AtaChapter.FullName);
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            sortMultiplier    = sortMultiplier * (-1);
            ataSortMultiplier = ataSortMultiplier * (-1);
            SortItems(oldColumnIndex);
            ItemsListView.Refresh();
        }
示例#16
0
        public override void EditItem(AircraftFlight oldItem, AircraftFlight modifiedItem)
        {
            string[]       subItemsString = GetSubItemsString(modifiedItem);
            AircraftFlight detail         = GetFlightReferenceByFlightID(oldItem.ID);

            if (detail == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[detail];

            listViewItem.SubItems.Clear();
            listViewItem.Text = modifiedItem.ATLBPageNo.ToString();
            listViewItem.SubItems.AddRange(subItemsString);
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
            SetTotalText();
        }
示例#17
0
        public override void EditItem(ATLB oldItem, ATLB modifiedItem)
        {
            string[] subItemsString = GetSubItemsString(modifiedItem);
            ATLB     atlb           = GetATLBReferenceByATLBID(oldItem.ID);

            if (atlb == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[atlb];

            listViewItem.SubItems.Clear();
            listViewItem.Text = modifiedItem.ATLBNo;
            listViewItem.SubItems.AddRange(subItemsString);
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
            SetTotalText();
        }
示例#18
0
        public override void EditItem(Detail oldItem, Detail modifiedItem)
        {
            string[] itemsString         = GetItemsString(modifiedItem);
            string[] itemsStringModified = new string[itemsString.Length - 1];
            Array.Copy(itemsString, 1, itemsStringModified, 0, itemsStringModified.Length);
            Detail detail = GetDetailReferenceByDetailID(oldItem.ID);

            if (detail == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[detail];

            //ListViewItem listViewItem = new ListViewItem(modifiedItem.AtaChapter.ShortName);
            listViewItem.SubItems.Clear();
            listViewItem.Text = modifiedItem.AtaChapter.ShortName;
            listViewItem.SubItems.AddRange(itemsStringModified);
            listViewItem.SubItems.Add(modifiedItem.AtaChapter.FullName);
            if (landingGearsFilter.Acceptable(modifiedItem))
            {
                listViewItem.SubItems.Add(TermsProvider.GetLandingGearPositionFullName(modifiedItem.PositionNumber));
            }
            listViewItem.BackColor = modifiedItem.Highlight.Color;

            if (modifiedItem.ConditionState == DirectiveConditionState.Notify)
            {
                listViewItem.BackColor = Css.ListView.Colors.NotifyColor;
            }
            else if (modifiedItem.ConditionState == DirectiveConditionState.NotSatisfactory)
            {
                listViewItem.BackColor = Css.ListView.Colors.NotSatisfactoryColor;
            }

            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            //SortItems(oldColumnIndex);
            ItemsListView.Refresh();
            SetTotalText();
        }
示例#19
0
        public override void EditItem(AbstractDetail oldItem, AbstractDetail modifiedItem)
        {
            string[]       itemsString = GetItemString(modifiedItem);
            AbstractDetail detail      = GetDetailReferenceByDetailID(oldItem.ID);

            if (detail == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[detail];

            listViewItem.SubItems.Clear();
            listViewItem.Text = itemsString[0];
            for (int i = 1; i < itemsString.Length; i++)
            {
                listViewItem.SubItems.Add(itemsString[i]);
            }
            int hashCode = 1;// modifiedItem.LimitationCondition.GetHashCode(); todo

            listViewItem.BackColor = modifiedItem.Highlight.Color;
            if (hashCode == 2 || modifiedItem.ExpirationDate < DateTime.Now)
            {
                listViewItem.BackColor = COLORS[2];
            }
            else if (hashCode == 1 || modifiedItem.NotificationDate < DateTime.Today)
            {
                listViewItem.BackColor = COLORS[1];
            }
            else
            {
                listViewItem.BackColor = COLORS[0];
            }
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
            SetTotalText();
        }
        public override void EditItem(AbstractRecord oldItem, AbstractRecord modifiedItem)
        {
            string[]       itemsString = GetItemString(modifiedItem);
            AbstractRecord detail      = GetAbstractRecordReferenceByAbstractRecordID(oldItem.ID);

            if (detail == null)
            {
                return;
            }
            ListViewItem listViewItem = ItemsHash[detail];

            listViewItem.SubItems.Clear();
            listViewItem.Text = itemsString[0];
            for (int i = 1; i < itemsString.Length; i++)
            {
                listViewItem.SubItems.Add(itemsString[i]);
            }
            listViewItem.Tag = modifiedItem;
            ItemsHash.Remove(oldItem);
            ItemsHash.Add(modifiedItem, listViewItem);
            ItemsListView.Refresh();
            SetTotalText();
        }