Beispiel #1
0
        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);
        }
Beispiel #2
0
        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();
        }