Beispiel #1
0
        public void AddStaffInfo(StaffConfig request, StaffConfigResponse response)
        {
            ValidRequest(request, new StaffConfigVaildator(), ruleSet: "Add");
            //验证员工编号是否重复
            var staffConfigs = _privilegeRepository.QueryStaffInfo();

            if (staffConfigs.Any(i => i.STAFFNO == request.StaffNo))
            {
                throw new Utility.WeChatException("STAFF_ADD_ERROR", "员工号在库中存在重复记录");
            }

            DateTime updateTime = DateTime.Now;

            _privilegeRepository.InsertStaffInfo(request.StaffNo, request.StaffName,
                                                 DecryptPwdHelper.EncodePwd("123456"),
                                                 request.DepartNo, request.DimissionTag, request.CurrOper, updateTime);

            response.ResponseStatus.ErrorCode = "OK";
        }