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; } } }
void mnuAddTask_Click(object sender, EventArgs e) { if (this.MyJob == "Project") { if (ucGantt1.gantt1.Groups != null) { Program.CursorWait(); KS.Gantt.Dialogs.TaskEditDialog Dlg = new KS.Gantt.Dialogs.TaskEditDialog(); Dlg.Edit(ucGantt1.gantt1, null); Dlg.ShowDialog(this); if (Dlg.OkPressed) { // Созданная задача GanttItem gt = ucGantt1.gantt1.SelectedItems[0]; InstHelperPLM.NewTask(gt); } Dlg.Dispose(); Dlg = null; } } }