/// <summary>
        /// Deletes a Keyword Subject
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="mandatoryOnly"></param>
        /// <returns></returns>
        internal int Delete(Keyword_Subject_DTO dto, bool?mandatoryOnly = null)
        {
            var inputParams = new List <ADO_inputParams>();

            if (dto.KsbCode != default(int))
            {
                inputParams.Add(new ADO_inputParams()
                {
                    name = "@KsbCode", value = dto.KsbCode
                });
            }
            if (dto.SbjCode != default(int))
            {
                inputParams.Add(new ADO_inputParams()
                {
                    name = "@SbjCode", value = dto.SbjCode
                });
            }
            if (mandatoryOnly != null)
            {
                inputParams.Add(new ADO_inputParams()
                {
                    name = "@KsbMandatoryFlag", value = mandatoryOnly
                });
            }

            var returnParam = new ADO_returnParam()
            {
                name = "@ReturnVal", value = 0
            };

            ado.ExecuteNonQueryProcedure("System_Navigation_Keyword_Subject_Delete", inputParams, ref returnParam);

            return((int)returnParam.value);
        }
Beispiel #2
0
        /// <summary>
        /// Deletes a Keyword subject
        /// </summary>
        /// <param name="Ado"></param>
        /// <param name="subjectDto"></param>
        /// <param name="mandatoryOnly"></param>
        /// <returns></returns>
        internal int Delete(ADO Ado, Subject_DTO subjectDto, bool?mandatoryOnly = null)
        {
            Keyword_Subject_ADO ksAdo = new Keyword_Subject_ADO(Ado);
            Keyword_Subject_DTO ksDto = new Keyword_Subject_DTO();

            ksDto.SbjCode = subjectDto.SbjCode;
            if (mandatoryOnly != null)
            {
                return(ksAdo.Delete(ksDto, mandatoryOnly));
            }
            else
            {
                return(ksAdo.Delete(ksDto));
            }
        }
        /// <summary>
        /// Reads Keyword subjects
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        internal List <dynamic> Read(Keyword_Subject_DTO dto)
        {
            var inputParams = new List <ADO_inputParams>();

            if (dto.KsbCode != default(int))
            {
                inputParams.Add(new ADO_inputParams {
                    name = "@KsbCode", value = dto.KsbCode
                });
            }

            if (dto.SbjCode != default(int))
            {
                inputParams.Add(new ADO_inputParams {
                    name = "@SbjCode", value = dto.SbjCode
                });
            }

            var reader = ado.ExecuteReaderProcedure("System_Navigation_Keyword_Subject_Read", inputParams);

            return(reader.data);
        }
        /// <summary>
        /// Updates a Keyword Subject
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        internal int Update(Keyword_Subject_DTO dto)
        {
            if (dto.LngIsoCode != null)
            {
                Keyword_BSO_Extract bse = new Keyword_BSO_Extract(dto.LngIsoCode);
                dto.KsbValue = bse.Singularize(dto.KsbValue);
            }

            var inputParams = new List <ADO_inputParams>()
            {
                new ADO_inputParams()
                {
                    name = "@KsbCode", value = dto.KsbCode
                },
                new ADO_inputParams()
                {
                    name = "@KsbValue", value = dto.KsbValue
                },
                new ADO_inputParams()
                {
                    name = "@KsbMandatoryFlag", value = dto.KsbMandatoryFlag != null?dto.KsbMandatoryFlag:false
                },
                new ADO_inputParams()
                {
                    name = "@KsbSingularisedFlag", value = dto.LngIsoCode != null
                }
            };

            var returnParam = new ADO_returnParam()
            {
                name = "@ReturnVal", value = 0
            };

            ado.ExecuteNonQueryProcedure("System_Navigation_Keyword_Subject_Update", inputParams, ref returnParam);

            return((int)returnParam.value);
        }