Пример #1
0
        public void SaveData(string year, string userId, List <BpcSp004Entity> entities)
        {
            BpcSp001Bll    bpcSp001Bll = new BpcSp001Bll();
            BpcSp004Entity existEntity;

            if (_service.ExistsRecord(userId, entities, out existEntity))
            {
                var tbEntity = bpcSp001Bll.GetEntity(existEntity.CJBBM);
                throw new Exception(tbEntity.CJBMC + $"  已经被配置给(用户:{existEntity.USERID}),请确认");
            }
            _service.SaveData(year, userId, entities);
        }
Пример #2
0
        public void SaveData(string year, string userId, List <BpcSp005Entity> entities)
        {
            BpcSp001Bll    bpcSp001Bll = new BpcSp001Bll();
            BpcSp005Entity existEntity;

            if (_service.ExistsRecord(userId, entities, out existEntity))
            {
                var tbEntity = bpcSp001Bll.GetEntity(existEntity.CJBBM);
                var userInfo = _service.GetUserInfo(existEntity.USERID) ?? new UserAuthTableInfoModel();
                if (userInfo.UserId.IsEmpty())
                {
                    //不存在此账户
                    _service.DeleteRecordByUserId(existEntity.USERID);
                }
                else
                {
                    throw new Exception(tbEntity.CJBMC +
                                        $"  已经被配置给【用户:{userInfo.UserName + "(账号:" + existEntity.USERID + ")"}】,请确认");
                }
            }

            _service.SaveData(year, userId, entities);
        }