Ejemplo n.º 1
0
        /// <summary>
        /// 根据前后打分记录,添加修正记录
        /// </summary>
        /// <param name="oldMarks">修正前</param>
        /// <param name="newMarks">修正后</param>
        public void Insert(EvaluateMarksRecordsEntity oldMarks, EvaluateMarksRecordsEntity newMarks)
        {
            var db = new RepositoryFactory().BaseRepository();
            //Operator user = OperatorProvider.Provider.Current();
            EvaluateItemEntity evaluateItemEntity = null;

            evaluateItemEntity = db.FindEntity <EvaluateItemEntity>(oldMarks.EvaluateItemId);
            EvaluateCategoryItemEntity categoryItemEntity = null;

            categoryItemEntity = db.FindEntity <EvaluateCategoryItemEntity>(evaluateItemEntity.EvaluateContentId);
            EvaluateCategoryEntity categoryEntity = null;

            categoryEntity = db.FindEntity <EvaluateCategoryEntity>(categoryItemEntity.CategoryId);
            EvaluateGroupEntity evaluateGroup = null;

            evaluateGroup = db.FindEntity <EvaluateGroupEntity>(evaluateItemEntity.EvaluateGroupId);
            EvaluateEntity evaluate = null;

            evaluate = db.FindEntity <EvaluateEntity>(evaluateGroup.EvaluateId);

            EvaluateReviseEntity reviseEntity = new EvaluateReviseEntity()
            {
                Id                 = Guid.NewGuid().ToString(),
                Category           = categoryEntity?.Category,
                CategoryId         = categoryEntity?.CategoryId,
                CreateDate         = DateTime.Now,
                CreateUser         = newMarks.CreateUserName,
                CreateUserId       = newMarks.CreateUserId,
                DepartmentId       = evaluateGroup?.DeptId,
                DepartmentName     = evaluateGroup?.DeptName,
                DeptCause          = oldMarks.Cause,
                DeptEvaluateUserId = oldMarks.CreateUserId,
                DeptEvaluteUser    = oldMarks.CreateUserName,
                DeptScore          = oldMarks.Score,
                EvaluteContent     = evaluateItemEntity?.EvaluateContent,
                EvaluteContentId   = evaluateItemEntity?.EvaluateContentId,
                GroupId            = evaluateGroup?.GroupId,
                GroupName          = evaluateGroup?.GroupName,
                ReviseCause        = newMarks.Cause,
                ReviseScore        = newMarks.Score,
                ReviseUser         = newMarks.CreateUserName,
                ReviseUserId       = newMarks.CreateUserId,
                StandardScore      = evaluateItemEntity.Score,
                EvaluateId         = evaluate.EvaluateId,
                EvaluateSeason     = evaluate.EvaluateSeason
            };

            this.BaseRepository().Insert(reviseEntity);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 如果是公司级删除的部门级的数据,则会新增一条,否则的话就不会新增
        /// </summary>
        /// <param name="entity">所删除的部门级的数据</param>
        public void Insert(string deptid, EvaluateMarksRecordsEntity entity)
        {
            var db = new RepositoryFactory().BaseRepository();
            //Operator user = OperatorProvider.Provider.Current();
            DepartmentEntity userDept = db.FindEntity <DepartmentEntity>(deptid);

            if (entity.IsOrg == 0 && userDept.IsSpecial)//如果数据时部门级的,但是删除的用户的是部门级的,则添加一条记录
            {
                EvaluateItemEntity evaluateItemEntity = null;
                evaluateItemEntity = db.FindEntity <EvaluateItemEntity>(entity.EvaluateItemId);
                EvaluateCategoryItemEntity categoryItemEntity = null;
                categoryItemEntity = db.FindEntity <EvaluateCategoryItemEntity>(evaluateItemEntity.EvaluateContentId);
                EvaluateCategoryEntity categoryEntity = null;
                categoryEntity = db.FindEntity <EvaluateCategoryEntity>(categoryItemEntity.CategoryId);
                EvaluateGroupEntity evaluateGroup = null;
                evaluateGroup = db.FindEntity <EvaluateGroupEntity>(evaluateItemEntity.EvaluateGroupId);
                EvaluateEntity evaluate = null;
                evaluate = db.FindEntity <EvaluateEntity>(evaluateGroup.EvaluateId);

                EvaluateReviseEntity reviseEntity = new EvaluateReviseEntity()
                {
                    Id                 = Guid.NewGuid().ToString(),
                    Category           = categoryEntity?.Category,
                    CategoryId         = categoryEntity?.CategoryId,
                    CreateDate         = DateTime.Now,
                    CreateUser         = entity.CreateUserName,
                    CreateUserId       = entity.CreateUserId,
                    DepartmentId       = evaluateGroup?.DeptId,
                    DepartmentName     = evaluateGroup?.DeptName,
                    DeptCause          = entity.Cause,
                    DeptEvaluateUserId = entity.CreateUserId,
                    DeptEvaluteUser    = entity.CreateUserName,
                    DeptScore          = entity.Score,
                    EvaluteContent     = evaluateItemEntity?.EvaluateContent,
                    EvaluteContentId   = evaluateItemEntity?.EvaluateContentId,
                    GroupId            = evaluateGroup?.GroupId,
                    GroupName          = evaluateGroup?.GroupName,
                    ReviseCause        = "该打分项在 " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + " 被 " + entity.CreateUserName + " 删除",
                    ReviseUser         = entity.CreateUserName,
                    ReviseUserId       = entity.CreateUserId,
                    StandardScore      = evaluateItemEntity.Score,
                    IsDeleteType       = 1,//删除数据
                    EvaluateId         = evaluate.EvaluateId,
                    EvaluateSeason     = evaluate.EvaluateSeason
                };
                this.BaseRepository().Insert(reviseEntity);
            }
        }
Ejemplo n.º 3
0
 public void Add(EvaluateCategoryEntity model)
 {
     model.CategoryId = Guid.NewGuid().ToString();
     service.Add(model);
 }
Ejemplo n.º 4
0
 public void Edit(EvaluateCategoryEntity model)
 {
     service.Edit(model);
 }