Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ExamineStageId = RequestData.Get <string>("ExamineStageId");
            ToUserId       = RequestData.Get <string>("ToUserId");
            if (!string.IsNullOrEmpty(ExamineStageId))
            {
                esEnt = ExamineStage.Find(ExamineStageId);
            }
            switch (RequestActionString)
            {
            case "delete":
                IList <string> taskIds = RequestData.GetList <string>("taskIds");
                foreach (string taskId in taskIds)
                {
                    ExamineTask etEnt = ExamineTask.Find(taskId);
                    etEnt.DoDelete();
                }
                esEnt.TaskQuan = esEnt.TaskQuan - taskIds.Count;
                esEnt.DoUpdate();
                break;

            default:
                DoSelect();
                break;
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ExamineStageId = RequestData.Get <string>("ExamineStageId");
            if (!string.IsNullOrEmpty(ExamineStageId))
            {
                esEnt = ExamineStage.Find(ExamineStageId); //如果考核阶段的状态是已生成  任务状态是0  如果是已启动  任务状态为1
                state = esEnt.State == 1 ? "0" : "1";
            }
            switch (RequestActionString)
            {
            case "AmendTask":
                //需要添加的任务
                ttEnts = TempTask.FindAllByProperties(TempTask.Prop_ExamineStageId, ExamineStageId, TempTask.Prop_AmendState, "+");
                int addQuan = ttEnts.Count;
                foreach (TempTask ttEnt in ttEnts)    //特殊任务也连同判断了
                {
                    ExamineTask etEnt = new ExamineTask("", ttEnt.ExamineStageId, ttEnt.ToUserId, ttEnt.ToUserName, ttEnt.ToDeptId, ttEnt.ToDeptName,
                                                        ttEnt.ToRoleCode, ttEnt.ToRoleName, ttEnt.BeUserId, ttEnt.BeUserName, ttEnt.BeDeptId, ttEnt.BeDeptName, ttEnt.BeRoleCode,
                                                        ttEnt.BeRoleName, null, state, ttEnt.Tag, null, UserInfo.UserID, UserInfo.Name, System.DateTime.Now,
                                                        ttEnt.ExamineIndicatorId, ttEnt.ExamineRelationId);
                    etEnt.DoCreate();
                    ttEnt.DoDelete();
                }
                etEnts = ExamineTask.FindAllByProperties(ExamineTask.Prop_ExamineStageId, ExamineStageId, ExamineTask.Prop_AmendState, "-");
                int reduceQuan = etEnts.Count;
                foreach (ExamineTask etEnt in etEnts)
                {
                    etEnt.DoDelete();
                }
                esEnt.TaskQuan = esEnt.TaskQuan + addQuan - reduceQuan;
                esEnt.DoUpdate();
                PageState.Add("Result", "增补任务数量:【" + addQuan.ToString() + "】  删除任务数量:【" + reduceQuan.ToString() + "】!");
                break;

            case "CancelAmendTask":
                ttEnts = TempTask.FindAllByProperties(TempTask.Prop_ExamineStageId, ExamineStageId, TempTask.Prop_AmendState, "+");
                foreach (TempTask ttEnt in ttEnts)    //特殊任务也连同判断了
                {
                    ttEnt.DoDelete();
                }
                etEnts = ExamineTask.FindAllByProperties(ExamineTask.Prop_ExamineStageId, ExamineStageId, ExamineTask.Prop_AmendState, "-");
                foreach (ExamineTask etEnt in etEnts)
                {
                    etEnt.AmendState = null;
                    etEnt.DoUpdate();
                }
                break;

            default:
                DoSelect();
                break;
            }
        }