예제 #1
0
        private void SubmitWorkTimeTask(IfUser Submitter, IfUser Handler)
        {
            string strName = "填报工时_" + Handler.Name + "_" + DateTime.Today.ToShortDateString();

            if (mainDataSet.GetTaskItem(strName) != null)
            {
                ShowStatus("Task: " + strName + " already exists.");
                return;
            }
            DateTime   dDate    = DateTime.Now + new TimeSpan(3, 0, 0, 0);
            CustomTask newTask  = new CustomTask(strName, DateTime.Now, dDate, strName);
            TaskType   workTime = mainDataSet.GetTypeItem("填报工时");

            if (workTime == null)
            {
                workTime = new TaskType("填报工时", 70);
            }
            newTask.UpdateRealtion(workTime,
                                   Submitter,
                                   Handler,
                                   mainDataSet.GetQlevelItem("Q3"));
            mainDataSet.InsertCustomTask(newTask, workTime);
            mainDataSet.UpdateRuntimeDataSet();
        }