Ejemplo n.º 1
0
        public void ModifyStaffInfo(StaffConfig request, StaffConfigResponse response)
        {
            ValidRequest(request, new StaffConfigVaildator(), ruleSet: "Edit");
            //验证员工编号是否存在
            var staffConfigs = _privilegeRepository.QueryStaffInfo();

            if (!(staffConfigs.Any(i => i.STAFFNO == request.StaffNo)))
            {
                throw new Utility.WeChatException("STAFF_EDIT_ERROR", "当前员工编号在库中不存在,无法编辑");
            }
            DateTime updateTime = DateTime.Now;

            _privilegeRepository.UpdateStaffInfo(request.StaffNo, request.StaffName,
                                                 request.DepartNo, request.DimissionTag, request.CurrOper, updateTime);

            response.ResponseStatus.ErrorCode = "OK";
        }