Esempio n. 1
0
        private void BrowserData(Int64 TaskID,string TaskName)
        {
            if (this.dataTask.Rows.Count != 0)
            {
                //Int64 TaskID = Int64.Parse (this.dataTask.SelectedCells[1].Value.ToString ());
                DataTable tmp = new DataTable();
                string dFile = "";

                //�ж����������Щ���ݣ��������л��Dzɼ����

                if (this.treeMenu.SelectedNode.Name == "nodRunning")
                {
                    cTaskRun tr = new cTaskRun();
                    tr.LoadSingleTask(TaskID);
                    dFile=tr.GetTempFile(0);
                    tr = null;
                }
                else if (this.treeMenu.SelectedNode.Name == "nodComplete")
                {
                    cTaskComplete tc = new cTaskComplete();
                    tc.LoadSingleTask(TaskID);

                    dFile = tc.GetTempFile(0);
                    tc = null;
                }

                string conName = "sCon" + TaskID;
                string pageName = "page" + TaskID;

                AddTab(TaskID, TaskName);

                if (File.Exists(dFile))
                {
                    try
                    {
                        tmp.ReadXml(dFile);
                    }
                    catch (System.Exception)
                    {
                        //�п����ڱ�������ʱ�����˴��������Ҫ���Դ���ֱ�ӽ���,����Ҫͨ��ϵͳ��Ϣ��ʾ����
                        ExportLog(DateTime.Now +  "��" + TaskName + rm.GetString ("Info43"));

                    }
                }

                ((cMyDataGridView)(this.tabControl1.TabPages[pageName].Controls[conName].Controls[0].Controls[0])).gData = tmp;

                if (tmp.Rows.Count == 0)
                {
                    this.toolExportData.Enabled = false;
                }
                else
                {
                    this.toolExportData.Enabled = true;
                }
                tmp = null;
            }
        }
Esempio n. 2
0
        //�������񷢲���ɵĹ���
        public void UpdateTaskPublished(Int64 TaskID,cGlobalParas.GatherResult tState)
        {
            //���Ѿ���ɷ�����������ӵ��������������ļ���
            Task.cTaskComplete t = new Task.cTaskComplete();
            t.InsertTaskComplete(TaskID, tState);
            t = null;

            //ɾ��taskrun�ڵ�
            cTaskRun tr = new cTaskRun();
            tr.LoadTaskRunData();
            tr.DelTask(TaskID);

            //�޸�Tabҳ������

            //ɾ��run�е�����ʵ���ļ�
            string FileName = Program.getPrjPath() + "Tasks\\run\\" + "Task" + TaskID + ".xml";
            System.IO.File.Delete(FileName);

            if (this.treeMenu.SelectedNode.Name == "nodPublish")
            {
                for (int i = 0; i < this.dataTask.Rows.Count; i++)
                {
                    if (this.dataTask.Rows[i].Cells[1].Value.ToString() == TaskID.ToString())
                    {
                        this.dataTask.Rows.Remove(this.dataTask.Rows[i]);
                        break;
                    }
                }
            }
            else if (this.treeMenu.SelectedNode.Name == "nodComplete")
            {
                //���¼���������������Ϣ
                LoadCompleteTask();
            }
        }
Esempio n. 3
0
        //��������ɼ���ɺ�Ĺ������������ѡ����������еĽڵ㣬��
        //ɾ���˽ڵ�,Ȼ���taskrun������ɾ��,Ȼ����ɾ��ʵ�ʵ��ļ�
        public void UpdateTaskComplete(Int64 TaskID)
        {
            //���Ѿ���ɵ�������ӵ��������������ļ���
            Task.cTaskComplete t = new Task.cTaskComplete();
            t.InsertTaskComplete(TaskID, cGlobalParas.GatherResult.GatherSucceed );
            t = null;

            //ɾ��taskrun�ڵ�
            cTaskRun tr = new cTaskRun();
            tr.LoadTaskRunData();
            tr.DelTask(TaskID);

            //ɾ��run�е�����ʵ���ļ�
            string FileName = Program.getPrjPath() + "Tasks\\run\\" + "Task" + TaskID + ".xml";
            System.IO.File.Delete(FileName);
        }
Esempio n. 4
0
        private void LoadCompleteTask()
        {
            ShowCompletedTask();

            //����ɵ������м���
            cTaskComplete t = new cTaskComplete();
            t.LoadTaskData();

            for (int i = 0; i < t.GetCount(); i++)
            {
                dataTask.Rows.Add(imageList1.Images["OK"],t.GetTaskID (i), cGlobalParas.TaskState.Completed, this.treeMenu.SelectedNode.Name,
                                   t.GetTaskName (i), cGlobalParas.ConvertName((int)t.GetTaskType (i)),
                                   //t.GetGatheredUrlCount(i), t.GetUrlCount(i) - t.GetGatheredUrlCount(i),
                                   t.GetUrlCount(i), cGlobalParas.ConvertName((int)t.GetTaskRunType(i)),
                                   cGlobalParas.ConvertName((int)t.GetPublishType(i)) );
            }

            this.dataTask.Sort(this.dataTask.Columns[4], ListSortDirection.Ascending);

            this.dataTask.ClearSelection();
        }
Esempio n. 5
0
        //ɾ���Ѿ���ɵ�����
        private bool DelCompletedTask()
        {
            if (this.dataTask.SelectedRows.Count == 0)
                return false;
            if (this.dataTask.SelectedRows.Count == 1)
            {
                if (MessageBox.Show(rm.GetString ("Info29") + this.dataTask.SelectedCells[4].Value.ToString() + "\r\n" +
                    rm.GetString("Quaere10"), rm.GetString("MessageboxQuaere"),
                    MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return false;
                }
            }
            else
            {
                if (MessageBox.Show(rm.GetString ("Quaere11"),
                    rm.GetString("MessageboxQuaere"),
                    MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return false;
                }
            }

            for (int index = 0; index < this.dataTask.SelectedRows.Count; index++)
            {
                Int64 TaskID = Int64.Parse(this.dataTask.SelectedRows [index].Cells[1].Value.ToString());
                string TaskName = this.dataTask.SelectedRows[index].Cells[4].Value.ToString();

                //ɾ��taskcomplete�ڵ�
                cTaskComplete tc = new cTaskComplete();
                tc.LoadTaskData();
                tc.DelTask(TaskID);
                tc = null;

                //ɾ��run�е�����ʵ���ļ�
                string FileName = Program.getPrjPath() + "data\\" + TaskName + "-" + TaskID + ".xml";
                System.IO.File.Delete(FileName);
            }

            return true;

            //while (this.dataTask.SelectedRows.Count > 0)
            //{
            //    this.dataTask.Rows.Remove(this.dataTask.SelectedRows[0]);
            //}
        }
Esempio n. 6
0
 private void CreateTaskComplete()
 {
     Task.cTaskComplete t = new Task.cTaskComplete();
     t.NewTaskCompleteFile();
     t = null;
 }