Beispiel #1
0
        public IActionResult Edit(DepartmentDeclareModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            if (ConfigurationManager.AppSettings.IsTrialVersion)
            {
                response.SetIsTrial();
                return(Ok(response));
            }
            using (_dbContext)
            {
                var entity = _dbContext.DepartmentDeclare.FirstOrDefault(x => x.DepartmentDeclareUuid == model.DepartmentDeclareUuid);
                entity.DeclareName       = model.DeclareName;       //姓名
                entity.DeclareDepartment = model.DeclareDepartment; //部门
                entity.DeclareTime       = model.DeclareTime;       //时间
                entity.BonusPoint        = model.BonusPoint;        //加分项
                entity.PlusScore         = model.PlusScore;         //加分分值
                entity.PlusContent       = model.PlusContent;       //加分内容
                entity.Deduction         = model.Deduction;         //减分项
                entity.DeductionScore    = model.DeductionScore;    //减分分值
                entity.DeductionContent  = model.DeductionContent;  //减分内容
                entity.Remark            = model.Remark;            //备注
                int res = _dbContext.SaveChanges();
                if (res > 0)
                {
                    ToLog.AddLog("编辑", "成功:编辑:绩效申报信息数据", _dbContext);
                }
                return(Ok(response));
            }
        }
Beispiel #2
0
        public IActionResult Create(DepartmentDeclareModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            using (_dbContext)
            {
                var personaldiary = new DepartmentDeclare();
                personaldiary.DeclareName       = model.DeclareName;                            //姓名
                personaldiary.DeclareDepartment = model.DeclareDepartment;                      //部门
                personaldiary.DeclareTime       = model.DeclareTime;                            //时间
                personaldiary.BonusPoint        = model.BonusPoint;                             //加分项
                personaldiary.PlusScore         = model.PlusScore;                              //加分分值
                personaldiary.PlusContent       = model.PlusContent;                            //加分内容
                personaldiary.Deduction         = model.Deduction;                              //减分项
                personaldiary.DeductionScore    = model.DeductionScore;                         //减分分值
                personaldiary.DeductionContent  = model.DeductionContent;                       //减分内容
                personaldiary.Remark            = model.Remark;                                 //备注
                personaldiary.EstablishTime     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); //添加时间
                personaldiary.EstablishName     = AuthContextService.CurrentUser.DisplayName;   //添加人
                personaldiary.IsDeleted         = 0;                                            //是否删除
                _dbContext.DepartmentDeclare.Add(personaldiary);
                int res = _dbContext.SaveChanges();
                if (res > 0)
                {
                    ToLog.AddLog("添加", "成功:添加:绩效申报信息数据", _dbContext);
                }
                response.SetSuccess();
                return(Ok(response));
            }
        }