示例#1
0
        private void  择计算任务ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (tasks == null)
            {
                MessageBox.Show("请先设置任务名称!"); return;
            }
            GofComputeNode curent = this.bindingSource1.Current as GofComputeNode;

            if (curent == null)
            {
                MessageBox.Show("请先选中任务!"); return;
            }
            Geo.Winform.Controls.ListItemSelecterForm form =
                new Geo.Winform.Controls.ListItemSelecterForm(tasks.ToArray());

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                curent.Tasks.Clear();

                foreach (object o in form.SelectedItems)
                {
                    curent.Tasks.Add(o as GofTask);
                }

                mgr.Edit(curent, this.bindingSource1.IndexOf(curent));
                mgr.Save();
                BindSub();
            }
        }
示例#2
0
        private void 增加测站ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (siteNames == null)
            {
                MessageBox.Show("请先设置任务名称!"); return;
            }
            Task curent = this.bindingSource_task.Current as Task;

            if (curent == null)
            {
                MessageBox.Show("请先选中任务!"); return;
            }
            Geo.Winform.Controls.ListItemSelecterForm form =
                new Geo.Winform.Controls.ListItemSelecterForm(siteNames);

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                curent.Sites.Clear();

                foreach (object o in form.SelectedItems)
                {
                    curent.Sites.Add(new Site()
                    {
                        Name = o.ToString()
                    });
                }

                mgr.Edit(curent, this.bindingSource_task.IndexOf(curent));
                mgr.Save();
                BindSub();
            }
        }