/// <summary>
 /// Создает форму для добавления инженерного задания <see cref="EngineeringOrderTask"/>
 /// </summary>
 /// <param name="parentDirective">Родительская директива</param>
 public EngineeringOrderDirectiveTaskForm(EngineeringOrderDirective parentDirective)
 {
     this.parentDirective = parentDirective;
     mode = ScreenMode.Add;
     task = new EngineeringOrderTask();
     InitializeComponents();
 }
 /// <summary>
 /// Создает форму для отображения отдельного инженерного задания <see cref="EngineeringOrderTask"/>
 /// </summary>
 /// <param name="task">Инженерное задание</param>
 /// <param name="mode">Режим формы</param>
 public EngineeringOrderDirectiveTaskForm(EngineeringOrderTask task, ScreenMode mode)
 {
     this.mode           = mode;
     this.task           = task;
     permissionForUpdate = task.HasPermission(Users.CurrentUser, DataEvent.Update);
     InitializeComponents();
     UpdateInformation();
 }
Exemplo n.º 3
0
        private void listView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            EngineeringOrderTask item = (EngineeringOrderTask)e.Item.Tag;

            if (e.IsSelected)
            {
                selectedItems.Add(item);
            }
            else
            {
                if (selectedItems.Contains(item))
                {
                    selectedItems.Remove(item);
                }
            }
            buttonEdit.Enabled   = (permissionForUpdate && listView.SelectedItems.Count == 1);
            buttonDelete.Enabled = (permissionForUpdate && listView.SelectedItems.Count > 0);
        }