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; } }
private void SubmitTask() { IList <string> taskIds = RequestData.GetList <string>("taskIds"); if (taskIds.Count > 0) { foreach (string str in taskIds) { ExamineTask etEnt = ExamineTask.Find(str); etEnt.State = "2"; etEnt.DoUpdate(); } } }
private void SaveSubScore() { string ExamineTaskId = RequestData.Get <string>("ExamineTaskId"); ExamineTask etEnt = ExamineTask.Find(ExamineTaskId); string IndicatorSecondId = RequestData.Get <string>("IndicatorSecondId"); decimal SubScore = RequestData.Get <decimal>("SubScore"); decimal Score = RequestData.Get <decimal>("Score"); IList <IndicatorScore> insEnts = IndicatorScore.FindAllByProperties(IndicatorScore.Prop_ExamineTaskId, ExamineTaskId, IndicatorScore.Prop_IndicatorSecondId, IndicatorSecondId); if (insEnts.Count > 0)//更新 { insEnts[0].SubScore = SubScore; insEnts[0].DoUpdate(); } else//创建 { IndicatorScore insEnt = new IndicatorScore(); IndicatorSecond isEnt = IndicatorSecond.Find(IndicatorSecondId); IndicatorFirst ifEnt = IndicatorFirst.Find(isEnt.IndicatorFirstId); string tooltip = "!" + ifEnt.InsteadColumn + "#" + isEnt.ToolTip;//加入#号前面的字符是为了验证经营开发正职 部分要素分是由人力资源部打的 insEnt.ExamineTaskId = ExamineTaskId; insEnt.IndicatorFirstId = isEnt.IndicatorFirstId; insEnt.IndicatorFirstName = isEnt.IndicatorFirstName; insEnt.FirstMaxScore = ifEnt.MaxScore; insEnt.FirstSortIndex = ifEnt.SortIndex; insEnt.IndicatorSecondId = isEnt.Id; insEnt.IndicatorSecondName = isEnt.IndicatorSecondName; insEnt.SecondMaxScore = isEnt.MaxScore; insEnt.SecondSortIndex = isEnt.SortIndex; insEnt.SubScore = SubScore; insEnt.ToolTip = tooltip; insEnt.DoCreate(); etEnt.Score = Score; etEnt.DoUpdate(); } etEnt.Score = Score; etEnt.DoUpdate(); }
private void SaveSubScore() { string ExamineTaskId = RequestData.Get <string>("ExamineTaskId"); ExamineTask etEnt = ExamineTask.Find(ExamineTaskId); string IndicatorSecondId = RequestData.Get <string>("IndicatorSecondId"); decimal SubScore = RequestData.Get <decimal>("SubScore"); //decimal Score = RequestData.Get<decimal>("Score"); IList <IndicatorScore> insEnts = IndicatorScore.FindAllByProperties(IndicatorScore.Prop_ExamineTaskId, ExamineTaskId, IndicatorScore.Prop_IndicatorSecondId, IndicatorSecondId); if (insEnts.Count > 0)//更新 { insEnts[0].SubScore = SubScore; insEnts[0].DoUpdate(); } else//创建 { IndicatorScore insEnt = new IndicatorScore(); IndicatorSecond isEnt = IndicatorSecond.Find(IndicatorSecondId); IndicatorFirst ifEnt = IndicatorFirst.Find(isEnt.IndicatorFirstId); string tooltip = "!" + ifEnt.CustomColumn + "#" + isEnt.ToolTip;//加入#号前面的字符是为了标识该指标下有自定义指标,有明细分 insEnt.ExamineTaskId = ExamineTaskId; insEnt.IndicatorFirstId = isEnt.IndicatorFirstId; insEnt.IndicatorFirstName = isEnt.IndicatorFirstName; insEnt.FirstMaxScore = ifEnt.MaxScore; insEnt.FirstSortIndex = ifEnt.SortIndex; insEnt.IndicatorSecondId = isEnt.Id; insEnt.IndicatorSecondName = isEnt.IndicatorSecondName; insEnt.SecondMaxScore = isEnt.MaxScore; insEnt.SecondSortIndex = isEnt.SortIndex; insEnt.SubScore = SubScore; insEnt.ToolTip = tooltip; insEnt.DoCreate(); } sql = "select isnull(SUM(SubScore),0) FROM BJKY_Examine..IndicatorScore WHERE ExamineTaskId = '" + ExamineTaskId + "'"; etEnt.Score = DataHelper.QueryValue <decimal>(sql); etEnt.DoUpdate(); PageState.Add("Score", etEnt.Score); }