void mnuAddGroup_Click(object sender, EventArgs e) { if (this.MyJob == "Project") { Program.CursorWait(); KS.Gantt.Dialogs.GroupEditDialog Dlg = new KS.Gantt.Dialogs.GroupEditDialog(); Dlg.Edit(ucGantt1.gantt1, null); Dlg.ShowDialog(this); if (Dlg.OkPressed) { // Созданная задача GanttItem gt = ucGantt1.gantt1.SelectedItems[0]; InstHelperPLM.NewGroup(gt); } Dlg.Dispose(); Dlg = null; ucGantt1.gantt1.AutoMoveItems(); } }
void gantt1_ItemDoubleClick(object sender, KS.Gantt.GanttItemMouseEventArgs e) { if (this.MyJob == "Project") { if (e.Item.ItemType == GanttItemType.TaskItem) { KS.Gantt.Dialogs.TaskEditDialog Dlg = new KS.Gantt.Dialogs.TaskEditDialog(); KS.Gantt.Gantt m_GanttControl = e.Item.GanttControl; Dlg.Edit(m_GanttControl, e.Item); Dlg.ShowDialog(this); if (Dlg.OkPressed) { var gt = (KS.Gantt.TaskItem)e.Item; InstHelperPLM.NewTask(gt); } Dlg.Dispose(); Dlg = null; } else { KS.Gantt.Dialogs.GroupEditDialog Dlg = new KS.Gantt.Dialogs.GroupEditDialog(); KS.Gantt.Gantt m_GanttControl = e.Item.GanttControl; Dlg.Edit(m_GanttControl, e.Item); Dlg.ShowDialog(this); if (Dlg.OkPressed) { var gt = (KS.Gantt.GroupItem)e.Item; InstHelperPLM.NewGroup(gt); } Dlg.Dispose(); Dlg = null; } } }
protected override void mnuNew_Click(object sender, EventArgs e) { base.mnuNew_Click(sender, e); if (m_GanttControl == null) return; Program.CursorWait(); KS.Gantt.Dialogs.GroupEditDialog Dlg = new KS.Gantt.Dialogs.GroupEditDialog(); Dlg.Edit(m_GanttControl, null); Dlg.ShowDialog(this); Dlg.Dispose(); Dlg = null; }