예제 #1
0
파일: frmMain.cs 프로젝트: Veivan/GanttDll
 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;
         }
     }
 }
예제 #2
0
파일: frmMain.cs 프로젝트: Veivan/GanttDll
        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;
                }
            }
        }