예제 #1
0
파일: Form1.cs 프로젝트: wHo2/1000H
        void SeekDetail()
        {
            if (dgvSeek.SelectedRows.Count != 1)
            {
                MessageBox.Show("请选择一个项目");
                return;
            }
            string id = dgvSeek.CurrentRow.Cells["Id2"].Value.ToString();

            Project project = Logic.GetSeekListProject(id);
            if (project == null)
                return;
            SetProject setProject = new SetProject
            {
                Form1 = this,
                OldProject = project
            };
            if (project is Relax)
            {
                Project tempProject = new Project
                {
                    Name = "",
                    AssumeTime = project.UsedTime,
                    UsedTime = project.UsedTime,
                    StartTime = project.StartTime,
                    FinishedTime = project.FinishedTime,
                    Status = stat.完成
                };

                setProject.OldProject = tempProject;
                setProject.SetBtn("间隔的修改");
            }
            else
            {
                setProject.SetBtn("保存");
            }
            setProject.Show();
        }
예제 #2
0
파일: Form1.cs 프로젝트: wHo2/1000H
        private void ModifyProject()
        {
            if (dgvProject.SelectedRows.Count != 1)
            {
                MessageBox.Show("请选择一个项目");
                return;
            }
            string id = dgvProject.CurrentRow.Cells["Id"].Value.ToString();
            string status = dgvProject.CurrentRow.Cells["status"].Value.ToString();
            //if (status == "完成")
            //{
            //    MessageBox.Show("已完成的项目不能修改");
            //    return;
            //}
            Project project = Logic.FindProjectById(id);
            SetProject setProject = new SetProject
            {
                Form1 = this,
                OldProject = project
            };
            if (project is Relax)
            {
                Project tempProject = new Project
                {
                    Name = "",
                    AssumeTime = project.UsedTime,
                    UsedTime = project.UsedTime,
                    StartTime = project.StartTime,
                    FinishedTime = project.FinishedTime,
                    Status = stat.完成
                };

                setProject.OldProject = tempProject;
                setProject.SetBtn("间隔的修改");
            }
            else
                setProject.SetBtn("修改完成");
            Logic.Schedule();
            setProject.Show();
        }
예제 #3
0
파일: Form1.cs 프로젝트: wHo2/1000H
 void ModifyRoutine()
 {
     if (dgvRoutine.SelectedRows.Count != 1)
     {
         MessageBox.Show("请选择一个项目");
         return;
     }
     string id = dgvRoutine.CurrentRow.Cells["Id3"].Value.ToString();
     Routine project = Logic.GetRoutineProject(id);
     SetProject setProject = new SetProject
     {
         Form1 = this,
         OldRoutine = project
     };
     setProject.SetBtn("修改");
     setProject.Show();
 }
예제 #4
0
파일: Form1.cs 프로젝트: wHo2/1000H
 //添加项目按钮
 private void btnSetProject_Click(object sender, EventArgs e)
 {
     SetProject setProject = new SetProject { Form1 = this };
     setProject.SetBtn("完成");
     setProject.Show();
 }